Skip to content

Instantly share code, notes, and snippets.

@DevSrSouza
Created March 24, 2024 20:17
Show Gist options
  • Save DevSrSouza/48fb2989fb138539dd1f6273504a5cad to your computer and use it in GitHub Desktop.
Save DevSrSouza/48fb2989fb138539dd1f6273504a5cad to your computer and use it in GitHub Desktop.
Xcodegen configuration for a Compose Multiplatform app sample
ComposeSample.xcodeproj
import UIKit
import SwiftUI
import ComposeSample
struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
Main_uikitKt.MainComposeViewController()
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
var body: some View {
ComposeView()
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>ComposeSample</string>
</dict>
</plist>
import SwiftUI
@main
struct iOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
name: ComposeSample
options:
bundleIdPrefix: br.com.devsrsouza.ComposeSample
settings:
CODE_SIGN_IDENTITY: "iPhone Developer"
CODE_SIGN_STYLE: Automatic
MARKETING_VERSION: "1.0"
CURRENT_PROJECT_VERSION: "4"
SDKROOT: iphoneos
targets:
ComposeSample:
type: application
platform: iOS
deploymentTarget: "14.0"
info:
path: plists/Ios/Info.plist
properties:
UILaunchStoryboardName: ComposeSample
settings:
LIBRARY_SEARCH_PATHS: "$(inherited)"
ENABLE_BITCODE: "YES"
ONLY_ACTIVE_ARCH: "NO"
VALID_ARCHS: "arm64"
sources:
- path: source
excludes:
- "**/.gitkeep"
- path: ../composeApp/src/commonMain/resources
optional: true
buildPhase: resources
- path: ../composeApp/src/uikitMain/resources
optional: true
buildPhase: resources
- path: ../composeApp/src/iosMain/resources
optional: true
buildPhase: resources
preBuildScripts:
- name: Build KMP
script: |
cd ../../../
./gradlew :composeApp:embedAndSignAppleFrameworkForXcode
dependencies:
- framework: "../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)/ComposeSample.framework"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment