Skip to content

Add iOS targets#183

Merged
dokar3 merged 1 commit intomainfrom
add-ios-targets
Feb 12, 2026
Merged

Add iOS targets#183
dokar3 merged 1 commit intomainfrom
add-ios-targets

Conversation

@dokar3
Copy link
Owner

@dokar3 dokar3 commented Feb 12, 2026

Summary by CodeRabbit

  • New Features
    • Added iOS platform support for ChipTextField across multiple architecture variants (64-bit device, simulator arm64, and device simulator)
    • Included a complete iOS sample application with full project configuration and UI components

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

This PR adds complete iOS platform support to the ChipTextField multiplatform library and sample application. It enables iOS targets across multiple Gradle build configurations, provides iOS-specific Kotlin implementations for core platform abstractions (text styling and frame timing), and includes a fully configured Xcode iOS app with SwiftUI integration bridging to Compose UI.

Changes

Cohort / File(s) Summary
Build Configuration - iOS Targets
chiptextfield-core/build.gradle, chiptextfield-m3/build.gradle, chiptextfield/build.gradle, sample/shared/build.gradle.kts
Enables iOS architecture targets (iosX64, iosArm64, iosSimulatorArm64) across library modules and sample. Configures static framework binding for shared code compilation on iOS.
Core Platform Implementations
chiptextfield-core/src/iosMain/kotlin/com/dokar/chiptextfield/Platform.ios.kt
Implements iOS-specific suspend function awaitFrame() delegating to withFrameNanos, and provides DefaultPlatformTextStyle value with default span and paragraph styles.
Sample App - iOS Platform Integration
sample/shared/src/iosMain/kotlin/com/dokar/chiptextfield/sample/MainViewController.kt, sample/shared/src/iosMain/kotlin/com/dokar/chiptextfield/sample/Platform.ios.kt
Adds MainViewController entrypoint returning ComposeUIViewController hosting SampleScreen. Implements image loading setup using Coil with KtorNetworkFetcherFactory and AsyncImage composable wrapper.
Sample App - Xcode Project Configuration
sample/iosApp/iosApp.xcodeproj/project.pbxproj, sample/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata, sample/iosApp/Configuration/Config.xcconfig
Establishes complete Xcode project structure with build targets, build phases, framework configuration, Kotlin compilation script, and signing/deployment settings.
Sample App - iOS App Setup
sample/iosApp/iosApp/iOSApp.swift, sample/iosApp/iosApp/ContentView.swift
Defines SwiftUI application entry point (iOSApp struct with App protocol) and ContentView wrapper bridging SwiftUI to UIKit's ComposeView for Compose integration.
Sample App - Project Metadata & Assets
sample/iosApp/.gitignore, sample/iosApp/iosApp/Info.plist, sample/iosApp/iosApp/Assets.xcassets/*, sample/iosApp/iosApp/Preview\ Content/Preview\ Assets.xcassets/Content.json
Adds iOS project metadata (bundle identity, versioning, device capabilities, interface orientations), asset catalogs (AppIcon variants with appearance overrides), and Xcode ignore patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Kotlin 2.3.0, Compose 1.10.0, and more #175: Adds expect/common declarations for DefaultPlatformTextStyle and awaitFrame() platform abstractions; this PR provides the iOS-specific actual implementations completing the multiplatform abstraction.

Poem

🐰 A rabbit hops to iOS land, with Gradle builds so grand,
SwiftUI views and Compose embrace, in Xcode's perfect space,
Platform code for frame and style, making Chip shine all the while! 🎯

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add iOS targets' accurately summarizes the main change—enabling iOS compilation targets across multiple Gradle files and implementing iOS-specific platform code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-ios-targets

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@sample/iosApp/iosApp.xcodeproj/project.pbxproj`:
- Around line 315-321: OTHER_LDFLAGS currently includes malformed entries that
embed literal newlines and duplicate the "-framework Shared" flag (e.g.,
"Shared\n$(inherited)" and "Shared\n"), so remove the embedded "\n" and the
duplicate framework/linker tokens and ensure $(inherited) is a standalone entry;
specifically, in the OTHER_LDFLAGS array replace any entries like
"Shared\n$(inherited)" or "Shared\n" with a single "-framework" followed by
"Shared" (only once) and keep "$(inherited)" as its own element so the final
OTHER_LDFLAGS contains "$(inherited)", "-framework", "Shared" (no embedded
newlines and no duplicates) for both Debug and Release target configs.
- Around line 305-308: The FRAMEWORK_SEARCH_PATHS entries contain quoted strings
with trailing "\n" characters (e.g. "\"$(inherited)\n\"" and the
"$(SRCROOT)/../shared/..." entry) which become literal newlines in the pbxproj
and can break path resolution; remove the trailing "\n" from these quoted values
in the FRAMEWORK_SEARCH_PATHS arrays for both Debug and Release target
configurations so the entries read "\"$(inherited)\"" and the SRCROOT path
without the "\n", ensuring all FRAMEWORK_SEARCH_PATHS occurrences (including the
other block around lines 339-342) are updated consistently.
🧹 Nitpick comments (1)
sample/iosApp/iosApp/Info.plist (1)

32-35: Consider updating UIRequiredDeviceCapabilities to arm64.

The armv7 capability is outdated — Compose Multiplatform for iOS requires iOS 15+, which only runs on arm64 devices. While this won't cause a build or runtime failure (arm64 devices are a superset of armv7), updating to arm64 more accurately reflects the actual hardware requirement and prevents the app from appearing compatible with very old 32-bit devices on the App Store.

Suggested change
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
-		<string>armv7</string>
+		<string>arm64</string>
 	</array>

Comment on lines +305 to +308
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)\n",
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n",
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

FRAMEWORK_SEARCH_PATHS entries have trailing \n inside the quoted strings.

In both Debug and Release target configs, the path entries include a trailing \n (e.g., "$(inherited)\n" and the $(SRCROOT)/... path). In the pbxproj format these become literal characters appended to the path, which could interfere with path resolution.

🔧 Proposed fix (apply to both Debug and Release target configs)
 				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)\n",
-					"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n",
+					"$(inherited)",
+					"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
 				);

Also applies to: 339-342

🤖 Prompt for AI Agents
In `@sample/iosApp/iosApp.xcodeproj/project.pbxproj` around lines 305 - 308, The
FRAMEWORK_SEARCH_PATHS entries contain quoted strings with trailing "\n"
characters (e.g. "\"$(inherited)\n\"" and the "$(SRCROOT)/../shared/..." entry)
which become literal newlines in the pbxproj and can break path resolution;
remove the trailing "\n" from these quoted values in the FRAMEWORK_SEARCH_PATHS
arrays for both Debug and Release target configurations so the entries read
"\"$(inherited)\"" and the SRCROOT path without the "\n", ensuring all
FRAMEWORK_SEARCH_PATHS occurrences (including the other block around lines
339-342) are updated consistently.

Comment on lines +315 to +321
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
"Shared\n$(inherited)",
"-framework",
"Shared\n",
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

OTHER_LDFLAGS contains duplicate framework linkage and embedded newlines.

Both Debug and Release target configs link -framework Shared twice, and the entries embed \n and a misplaced $(inherited) inside the framework name string (e.g., "Shared\n$(inherited)"). This produces malformed linker arguments — $(inherited) is already listed separately, and the trailing \n characters within the string values will be interpreted literally.

🔧 Proposed fix (apply to both Debug and Release target configs)
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-framework",
-					"Shared\n$(inherited)",
-					"-framework",
-					"Shared\n",
+					Shared,
 				);

Also applies to: 349-355

🤖 Prompt for AI Agents
In `@sample/iosApp/iosApp.xcodeproj/project.pbxproj` around lines 315 - 321,
OTHER_LDFLAGS currently includes malformed entries that embed literal newlines
and duplicate the "-framework Shared" flag (e.g., "Shared\n$(inherited)" and
"Shared\n"), so remove the embedded "\n" and the duplicate framework/linker
tokens and ensure $(inherited) is a standalone entry; specifically, in the
OTHER_LDFLAGS array replace any entries like "Shared\n$(inherited)" or
"Shared\n" with a single "-framework" followed by "Shared" (only once) and keep
"$(inherited)" as its own element so the final OTHER_LDFLAGS contains
"$(inherited)", "-framework", "Shared" (no embedded newlines and no duplicates)
for both Debug and Release target configs.

@dokar3 dokar3 merged commit 5e1928c into main Feb 12, 2026
2 checks passed
@dokar3 dokar3 deleted the add-ios-targets branch February 12, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant