Frameworks

RSS for tag

Ask questions about APIs that can drive features in your apps.

Posts under Frameworks tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Are PhysicsJoints supported?
I am trying to add joints via code in my visionOS app. My scenario requires me to combine models from Reality Composer Pro with entities and components from code to generate the dynamic result. I am using the latest visionOS beta and Xcode versions and there is no documentation about joints. I tried to add them via the available API but regardless of how I combine pins, joints and various component, my entities will not get restricted or stay fixated like they are when they are in a child/parent relationship. I am using RealityKit and RealityView in mixed mode. I also searched the whole internet for related information without finding anything. Any insights or pointers appreciated!
0
0
90
2d
Text Above List w/ VStack Appears as View's Title
I am curious about the fact that the Text above the VStack is shown as a title to the view. I didn't know one could place Text above a VStack without another VStack. Here's the partial code showing the situation. @State private var results = [Result]() var body: some View { Text("Songs of Al Di Meola on iTunes") .font(.title3) .fontWeight(.bold) List(results, id: \.trackId) { item in VStack(alignment: .leading) { Text(item.trackName) .font(.headline) Text(item.collectionName) } } .task { await loadData() } } See picture for details.
0
0
79
4d
Universal Frameworks and Requirements for Deployment
I got some beacons from a company who provides an SDK to connect to them. They provided two sets of framework files which the SDK is dependent on. The first set is built for Arm 64, and the second is built for x86. I am using them to build a framework for a company which says they require frameworks they integrate into their apps to work for both device and simulator. I think this is primarily for convenience during development. I've run into some walls trying to fulfill these requirements and have some questions about what is possible. The Beacon manufacturer claims the x86 framework files should work for both simulator and device during development, and that arm64 would be for deployment to the app store. I am unable to get x86 to work during development when my device is plugged in though. What does a framework need to work for both device and simulator? Is is possible, from strictly arm64 and strictly x86 framework files, to build universal framework files that supports both arm64 and x86? Then from those to build a new universal framework that leverages all of those? Can this resulting framework not only be used for development on simulator and device, but also be deployed to the app store? Thank you kindly, for your expertise.
2
0
117
5d
Not receive onDisappear event on the first WindowGroup
Hi, I'm working on visionOS and find I can't get onDisappear event just on the first window after app launch. It comes like that: WindowGroup(id:"WindowA"){ MyView() .onDisappear(){ print("WindowA disappear") } } WindowGroup(id:"WindowB"){ MyView() .onDisappear(){ print("WindowB disappear") } } WindowGroup(id:"WindowC"){ MyView() .onDisappear(){ print("WindowC disappear") } } When the app first launch, it will open WindowA automatically And then I open WindowB and WindowC programatically. Then I tap the close button on window bar below window. If I close WindowB/WindowC, I can receive onDisappear event If I close WindowA, I can't receive onDisappear event If I reopen WindowA after it is closed and then close it again by tap the close button below window, I can receive onDisappear event Is there any logic difference for the first window on app launch? How can I get onDisappear Event for it. I'm using Xcode 16 beta 2
3
0
181
4d
can not create framework for ealiear code?
I want to create framework for this repo:https://github.com/BradLarson/GPUImage but failed. 1.I downloaded this repo and run below: xcodebuild archive -project GPUImage.xcodeproj -scheme GPUImage -destination "generic/platform=iOS" -archivePath "archives/GPUImage" xcodebuild archive -project GPUImage.xcodeproj -scheme GPUImage -destination "generic/platform=iOS Simulator" -archivePath "archivessimulator/GPUImage" xcodebuild -create-xcframework -archive archives/GPUImage.xcarchive -framework GPUImage.framework -archive archivessimulator/GPUImage.xcarchive -framework GPUImage.framework -output xcframeworks/GPUImage.xcframework there is error :cryptexDiskImage' is an unknown content type and com.apple.platform.xros' is an unknown platform identifier
0
0
113
1w
Is there any script that can detect Apple Submission to TestFlight errors early? like: ".framework contains disallowed nested bundles"
Some of the errors like ".framework contains disallowed nested bundles" we find out at later stage when uploading builds to TestFlight. It will be great if we can have similar script that apple uses or some custom script to verify it during the build time. So before I reinvent the wheel is there any script I can use at build time to detect this issue?
1
0
171
1w
Link to a Precompiled Static C Library in a Swift Library Package
I want to build a Swift library package that uses modified build of OpenSSL and Curl. I have already statically compiled both and verified I can use them in an Objective-C framework on my target platform (iOS & iOS Simulator). I'm using XCFramework files that contain the static library binaries and headers: openssl.xcframework/ ios-arm64/ openssl.framework/ Headers/ [...] openssl ios-arm64_x86_64-simulator/ openssl.framework/ Headers/ [...] openssl Info.plist I'm not sure how I'm supposed to set up my Swift package to import these libraries. I can use .systemLibrary but that seems to use the embedded copies of libssl and libcurl on my system, and I can't figure out how to use the path: parameter to that. I also tried using a .binaryTarget pointing to the XCFramework files, but that didn't seem to work as there is no module generated and I'm not sure how to make one myself. At a basic high level, this is what I'm trying to accomplish: where libcrypto & libssl come from the provided openssl.xcframework file, and libcurl from curl.xcframework
6
0
269
1w
"SYSTEM EXTENSION" entitlements in framework
Hello everyone! I'm developing framework and app for macOS for PCI devices. For communication with driverkit, I'm verifying by giving userclient access entities of system extension to app. However, the app is just a sample program, and our customer is trying to develop the app using a framework with PCI communication part. Is there a way to build a framework with my company's signature, and to build and execute it without acquiring userclient access elements by any chance by a customer developer? Moreover, userclient access is only available to developers who have subscribed to the Apple Developer Program, so I hope that client/developers do not need to obtain separate entries.
3
0
247
2w
Screen Sleep Issue When Removing Vision Pro
Hello VisionOS Developer Community, I am currently working on a demo application for VisionOS, tailored for the Vision Pro. In my application, I have implemented a feature to prevent the screen from sleeping using the following code: UIApplication.shared.isIdleTimerDisabled = true This works perfectly on iOS, ensuring the screen remains active regardless of other system settings. However, I've run into a snag with VisionOS. Even with isIdleTimerDisabled set to true, the screen still sleeps when I take off the Vision Pro.
1
0
158
2w
Screen Sleep Issue When Removing Vision Pro
Hello VisionOS Developer Community, I am currently working on a demo application for VisionOS, tailored for the Vision Pro. In my application, I have implemented a feature to prevent the screen from sleeping using the following code: UIApplication.shared.isIdleTimerDisabled = true This works perfectly on iOS, ensuring the screen remains active regardless of other system settings. However, I've run into a snag with VisionOS. Even with isIdleTimerDisabled set to true, the screen still sleeps when I take off the Vision Pro.
0
0
147
2w
Distributing Binary via Cocoapods & Swift Packages
I maintain a library that has thus far used Cocoapods to manage dependencies and also distribute an xcframework of the library. I'd now like to also distribute the same library through Swift Packages but am running into issues. I'm using the same xcframework in a local Swift Package and have added all the necessary dependencies to Package.swift, but when I attempt to add this Swift Package to a test app, the app will build correctly but fail at runtime due to a missing .framework file for a dependency I'll just call THE_DEPENDENCY: dyld[61483]: Library not loaded: @rpath/THE_DEPENDENCY.framework/THE_DEPENDENCY Referenced from: <75074516-C1CD-3251-8807-94A7502176A7> /Users/ME/Library/Developer/Xcode/DerivedData/MY_TEST_APP-bwfsfwjjnagdurdnjrhhdppgitvr/Build/Products/Debug-appletvsimulator/MY_LIBRARY.framework/MY_LIBRARY Reason: tried: '/Users/ME/Library/Developer/Xcode/DerivedData/MY_TEST_APP-bwfsfwjjnagdurdnjrhhdppgitvr/Build/Products/Debug-appletvsimulator/THE_DEPENDENCY.framework/THE_DEPENDENCY' (no such file) Indeed, there is no THE_DEPENDENCY.framework file anywhere, it is only present in a version of the test app that uses Cocoapods. As you can see, the reference to this file arises from MY_LIBRARY, and in MY_LIBRARY.xcodeproj I can see there is a reference to THE_DEPENDENCY.framework, which appears as a consequence of running pod install. Thus, it looks to me like the .framework file appears either as part of Cocoapods dependency injection, or perhaps as a consequence of how that dependency is distributed through Cocoapods. I'm forced to install pods during my build process because, as I understand it, all dependencies must be available during the archiving process to avoid compilation errors. If the dependencies must be available during archiving, but adding the dependencies via Cocoapods creates a reference to .framework files that will not be present in a Swift Package project, what is the best practice for distributing xcframework binaries to both Cocoapods and Swift Package Manager? It looks as though I'll have to build two different xcframeworks: one built with dependencies provided via pods, and the other via swift packages. Is this correct?
0
0
145
3w
Test Swift Package that vends XCFramework and has dependencies in example app before distribution
I've created a closed source iOS SDK from a local Swift package, which has dependencies on other Swift packages, and successfully created a binary XCFramework following the solution from my previous post. I would now like to create a Package.swift to vend this XCFramework and test it in an example app to verify it works as expected before I upload it to a public repo for distribution. I understand that binaryTarget does not support dependencies so we need to use a wrapper. I created a directory containing the following: Package.swift MyFramework.xcframework/ MyFrameworkWrapper/ ├─ dummy.swift Package.swift contains: // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework", platforms: [ .iOS(.v14) ], products: [ .library( name: "MyFramework", targets: ["MyFramework", "MyFrameworkWrapper"] ) ], dependencies: [ .package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1") ], targets: [ .target( name: "MyFrameworkWrapper", dependencies: [ "FittedSheets" ], path: "MyFrameworkWrapper" ), .binaryTarget( name: "MyFramework", path: "MyFramework.xcframework" ) ] ) I created a new iOS app, selected the project, Package Dependencies > + > Add Local, and added the directory containing this Package.swift. Xcode resolves the dependencies and lists them in the sidebar. I added code to import and use the framework. It builds successfully but the app crashes when run: dyld[63959]: Library not loaded: @rpath/FittedSheets.framework/FittedSheets Referenced from: <7DE247FC-DAFF-3946-AD21-E80F5AF841C9> /Users/Jordan/Library/Developer/Xcode/DerivedData/MyFramework-Example-gaeeymnqzenzrbbmhuebpodqctsz/Build/Products/Debug-iphonesimulator/MyFramework.framework/MyFramework How do I get this working? I'm wondering is my package set up properly to vend the framework specifying its dependencies, and is my XCFramework created correctly? The Package.swift for the framework's source code contains: // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework", platforms: [ .iOS(.v14) ], products: [ .library( name: "MyFramework", type: .dynamic, targets: ["MyFramework"] ) ], dependencies: [ .package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1") ], targets: [ .target( name: "MyFramework", dependencies: [ "FittedSheets" ], path: "Sources" ) ] ) And I created the XCFramework following the steps in that previous thread: Create archive from package via xcodebuild archive -workspace "$PACKAGE_PATH" -scheme "$FRAMEWORK_NAME" -destination 'generic/platform=iOS' -archivePath "$ARCHIVE_PATH/iOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES ENABLE_USER_SCRIPT_SANDBOXING=NO ENABLE_MODULE_VERIFIER=NO OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface Create the Modules directory in the framework via mkdir -p "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules" Copy the Swift interface files into the framework from the build in DerivedData via cp -a "$BUILD_PRODUCTS_PATH/Build/Intermediates.noindex/ArchiveIntermediates/$FRAMEWORK_NAME/BuildProductsPath/Release-iphoneos/$FRAMEWORK_NAME.swiftmodule" "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules" Repeat 1-3 for iOS Simulator Create an XCFramework via xcodebuild -create-xcframework -framework "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -framework "$ARCHIVE_PATH/iOS_Simulator.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -output "$ARCHIVE_PATH/$FRAMEWORK_NAME.xcframework"
0
0
208
3w
Framework compilation with Command CodeSign failed with a nonzero exit code
I am trying to extract a protocol from an app to be able to use it in a siri intent. Yet when I compile it I get: note: Injecting stub binary into codeless framework (in target 'Virtual Tags Framework' from project 'Virtual Tags Framework') /Users/fabriziobartolomucci/Library/Developer/Xcode/DerivedData/Virtual_Tags_Framework-chxutmulwgujeiceazyyzaphwner/Build/Products/Debug-iphonesimulator/Virtual_Tags_Framework.framework/Frameworks/ARKit.framework/Versions/A: bundle format unrecognized, invalid, or unsuitable Command CodeSign failed with a nonzero exit code
1
0
189
1w
FinanceKit requestAuthorization denied
Hello all 👋 I'm getting unexpected behavior when testing FinanceKit for my app and was hoping to get assistance. Pre-reqs (defined at https://developer.apple.com/documentation/financekit): I've been given the FinanceKit entitlement I have the com.apple.developer.financekit entitlement set to financial-data I also have NSFinancialDataDescription set in Info.plist. I am targeting iOS 17.4 (a physical device) When I call FinanceStore.shared.requestAuthorization(), I immediately get a denied status without any alert dialogs. No data about my app is listed in Settings > Privacy & Security > Wallet Any idea what else is needed here? Thanks so much for the help! Code import SwiftUI import FinanceKit @main struct myApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var status: AuthorizationStatus? @State private var dataAvail: Bool? var body: some View { VStack { Text("Data available \(String(describing: dataAvail))") Text("Auth status \(String(describing: status))") Button("Get Status") { Task{ dataAvail = FinanceStore.isDataAvailable(.financialData) status = try await FinanceStore.shared.authorizationStatus() } }.buttonStyle(.borderedProminent) Button("Request Auth") { Task{ do{ status = try await FinanceStore.shared.requestAuthorization() }catch{ print(error) } } }.buttonStyle(.borderedProminent) } .padding() } } #Preview { ContentView() } app.entitlements: <?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>com.apple.developer.financekit</key> <array> <string>financial-data</string> </array> </dict> </plist> Info.plist: <?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>NSFinancialDataDescription</key> <string>Budget across all your accounts</string> </dict> </plist> VIdeo demo:
1
1
176
3w
Distribute XCFramework that has dependencies on Swift Packages with Example project
I've created a closed source iOS SDK from a local Swift package, which has dependencies on other Swift packages, and successfully created a binary XCFramework following the solution from my previous post. Now I'm proceeding with the process to distribute this SDK. I believe I want to upload the XCFramework to a public repo alongside a Package.swift file and an Example app project that uses the XCFramework. So each time I go to create a new release I’ll create a new XCFramework replacing the current one, verify it's working properly in the example app, then commit, tag, and push to the repo. My question is how do I set this up as a Swift package that includes an example app that uses the local XCFramework (not a remote url to a zip of the framework) and properly resolves dependencies? So far I created a directory containing MyFramework.xcframework and Package.swift containing: // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework", platforms: [ .iOS(.v14) ], products: [ .library( name: "MyFramework", targets: ["MyFramework"] ) ], dependencies: [ .package(url: "https://github.com/example/example.git", from: "1.0.0") ], targets: [ .binaryTarget( name: "MyFramework", path: "MyFramework.xcframework" ) ] ) I then created an Example iOS app project in that directory and now need to integrate the local XCFramework. I wondered if I could do that via File > Add Package Dependencies > Add Local, but when I navigate to that Package.swift and click Add Package it says The selected package cannot be a direct ancestor of the project. Do I need a different Package.swift for the Example app, and if so, how do I get that set up? I created a separate Package.swift (contents below) alongside the xcodeproj but when I try to add that in Xcode I get the same error, despite the fact this package is a sibling of the project not an ancestor. // swift-tools-version: 5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "MyFramework-Example", platforms: [ .iOS(.v14) ], dependencies: [ .package(name: "MyFramework", path: "../") ], targets: [ .target( name: "MyFramework-Example", dependencies: ["MyFramework"] ) ] )
1
0
229
3w