Posts

Post not yet marked as solved
1 Replies
1.1k Views
When I build my iOS app for the visionOS simulator, it works fine, and it runs in the compatibility mode. When I try to build against the new visionOS SDK, I get build errors related to the bridging header: SimpleList-Bridging-Header.h:5:9: error: 'MyFramework/MyFramework.h' file not found #import <MyFramework/MyFramework.h> ^ 1 error generated. :0: error: failed to emit precompiled header '...DerivedData/CJ-bkylkdabwgxlstdympoknglfewum/Build/Intermediates.noindex/PrecompiledHeaders/SimpleList-Bridging-Header-swift_3HAL1I7NW16O7-clang_3RN0BYG6SZHIS.pch' for bridging header '.../SimpleList/Classes/SimpleList-Bridging-Header.h' 2 errors generated. I don't know why it's not finding my framework for the visionOS SDK, while it works fine for the iOS SDK. The framework is included in the project itself (i.e. it's not an external dependency). Any tips?
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
6 Replies
4k Views
Hi,I saw the WWDC talk on the new Contacts framework, and I had a couple of questions about the identifier property:When users upgrade from iOS8 to iOS9, will their old AddressBook recordIDs still work if we are using the AddressBook framework in the app (i.e. haven't upgraded to using Contacts framework)?Are the new CNContact identifiers consistent across iOS and Mac devices? i.e. if we have the identifier on one device, we can lookup the contact on another device with the same identifier?Can these identifiers change in the lifetime of that contact? This was a problem with AddressBook recordIDs ... if you removed the account and then synced it back again, all the contacts would get a different identifier. Same with restoring the device. Will the CNGroup and CNContainer identifiers also be consistent across devices?Hope someone in the Apple Contacts frameworks team can answer. Thanks.
Posted
by zulfishah.
Last updated
.
Post marked as solved
1 Replies
963 Views
The [[UIScreen mainScreen] scale] API is unavailable for visionOS, but I use it in various places to pass into Apple's drawing APIs ... for e.g.: UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); and for generating thumbnails: QLThumbnailGenerationRequest *request = [[QLThumbnailGenerationRequest alloc] initWithFileAtURL:fileURL size:size scale:screenScale representationTypes:QLThumbnailGenerationRequestRepresentationTypeThumbnail]; What would be the best way to get the 'scale' factor in this case, when building for visionOS?
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
Hi, My iOS app includes 4 dependencies added through SPM, and a xcframework file from an external source. When I build the iOS app for the visionOS simulator, it works fine, and it runs in the compatibility mode. When I try to build for the new visionOS SDK, I get build errors related to these external dependencies, like "When building for visionOS Simulator, no library for this platform was found ..." How do I remove these dependencies for just the visionOS SDK? Any help would be appreciated. Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
1 Replies
491 Views
Hi, Is there a way to take a screenshot of just your widget, in code or even some user action? Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
5 Replies
2.3k Views
Hi,My app supports 2 different share extensions, and before iOS13, it was easy to tell them apart, because I would specify this in the Bundle Display Name (CFBundleDisplayName in info.plist). With iOS13, it seems to only show the name of the app for both share extensions, and not the Display Name specified, which will make it confusing to users if they see the same app icon + name in the share sheet.I filed a Radar for this, but it was returned with "Resolution:Investigation complete - Change required from 3rd party" ... but it didn't specify what kind of change to make.Anyone know how to customize the name of the share extension going forward?Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
0 Replies
847 Views
I am trying to create a Swift Package for a custom framework I'm building for a client. The framework has a dependency on a couple of 3rd party frameworks. I've read about how even though binary frameworks don't support dependencies directly, there is way to do this with a 'wrapper' target, so this is what I came up with for Package.swift: let package = Package( name: "SBCardScannerFramework", platforms: [ .iOS(.v16) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "SBCardScannerFramework", targets: ["SBCardScannerFramework-Target"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"), .package(url: "https://github.com/marmelroy/PhoneNumberKit.git", from: "3.3.3") ], targets: [ .target(name: "SBCardScannerFramework-Target", dependencies: [ .target(name: "SBCardScannerFramework", condition: .when(platforms: [.iOS])), .product(name: "Algorithms", package: "swift-algorithms"), .product(name: "PhoneNumberKit", package: "PhoneNumberKit") ] ), .binaryTarget(name: "SBCardScannerFramework", path: "SBCardScannerFramework.xcframework") ] ) This works, and I can add the package to my test project and import the framework and it links against the dependancies as well, and works correctly. The problem is that every time I run the app, it also shows these messages in the Xcode console: objc[845]: Class _TtC14PhoneNumberKitP33_0FE53357E470A64027C8F0CAF7B114C812BundleFinder is implemented in both /private/var/containers/Bundle/Application/EEE0C0A6-4FF5-44BC-B81A-F95401219D32/TestSBCardScannerFrameworkImport.app/Frameworks/SBCardScannerFramework.framework/SBCardScannerFramework (0x100f4aaf0) and /private/var/containers/Bundle/Application/EEE0C0A6-4FF5-44BC-B81A-F95401219D32/TestSBCardScannerFrameworkImport.app/TestSBCardScannerFrameworkImport (0x10069b778). One of the two will be used. Which one is undefined. There's multiple lines for different classes that show the "Class X is implemented in both [.../MyApp.app/Frameworks/MyFramework.frameworkMyFramework/] and [.../MyApp.app/MyApp]". I'm not sure how to avoid this problem, and whether this could cause a problem down the line. The framework that is the basis for this Swift Package is linked against the two dependencies, because I wouldn't be able to build the framework without them. But they also need to be added to the app target (at least, and if I don't, I get a run-time crash when using the PhoneNumberKit initializer. PhoneNumberKit/resource_bundle_accessor.swift:40: Fatal error: unable to find bundle named PhoneNumberKit_PhoneNumberKit Is there a good way to resolve this issue? I'm worried this will could be a problem for the client when they integrate it into their app, and the app is deployed to 1000s of devices.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
0 Replies
439 Views
Hi, I am working on distributing a 'framework' I made to a client. The framework itself has a couple of dependencies on a couple of 3rd-party frameworks. Also, I don't want to disclose my source code to the client. So after doing some research, it seems like the best way to do this would be to use Swift Packages, and make it a binary distribution, which would basically wrap a .xcframework (which I would generate with my source code). But I'm confused about the next steps ... how would I go about sharing the 'package' with the client? Would I just zip up the 'package' folder and email it to them, and they can unzip it on their end, and add it to their project by using "Add local package"? Or is there a more elegant way to do this, which doesn't require publishing a package publicly?
Posted
by zulfishah.
Last updated
.
Post marked as solved
1 Replies
2.7k Views
Hi, I am developing a 'framework' for a client so they can embed some of my code into their own custom app. I'm confused a bit about the best option to distribute this. I have created an iOS 'framework' within my Xcode project and added all the necessary files there. Can I just build the framework and send them the build folder for the framework? Or is it better to generate an .xcframework that I read about somewhere? I'm just not completely sure about the benefits for distributing an .xcframework file (which there doesn't seem to be an option to generate from Xcode) over just the .framework folder from the built products? Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
Hi, I've been working with Core Data for a number of years, and I remember that when I needed to add attributes or entities to the data model, I had to first create a new model version, then add the new attributes/entities, and then use the "lightweight migration' flag when adding the NSPersistentStore to the NSPersistentStoreCoordinator. If it didn't add the new model version, the app would crash. I've tried adding something to my data model now after a few years, without adding a new model version in Xcode. And right now, it seems to work fine. I can read/write to the new attribute that I added to an entity, and nothing crashed. I tried this on the simulator, as well as on my device. Did something change at some point, where adding a new model version isn't a requirement for using lightweight migration? Or am I missing something? Why isn't it crashing anymore (and will it crash if I change my model without adding a new model version and ship it to production)? Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
2 Replies
2.2k Views
HiI'm trying to use Xcode's "Build With Timing Summary" feature. It kicks off a build, and I can see the new build in the Build Reports navigator, but when I look through All Messages in the build results, there is "Timing Summary" information. It just says "Build Success - &lt;date&gt; - 75 seconds", but there isn't a breakdown of the timing results.My target builds an iOS app with many extensions, so I can't post the whole logs here. But is there any reason why I can't find the timing results? I do have that older Xcode flag 'ShowBuildOperationDuration' which still works, but only gives the same overall build summary time, not a breakdown.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
1 Replies
594 Views
Hi, I plan to use the new AppTransaction.shared API in StoreKit2 to find the user's original purchase date and version for my macOS app. However, when testing this running in the debugger, the app shows up with an App Store login prompt, asking for my login and password, which is undesirable. I wanted to know if this is just a sandbox quirk, or is the "AppTransaction.shared" API supposed to trigger this prompt for all users, even in production? In that case, is it like the old "Refresh receipt" API where we shouldn't trigger this automatically when a user opens the app, and instead have a button somewhere that triggers the call? Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
0 Replies
602 Views
Hi, I have a paid macOS app available in the Mac App Store for the past few years, and I'm looking into converting it into a freemium app. I wanted to add a check to see if the app was purchased legitimately or not, since I know there's a lot of pirated copies available on the internet. I just did some basic analytics with the app already on the store, the app receipt validation fails because there's no file found at the receipt URL location. I'm just doing this basic check and it fails for a lot of the cases ....     NSURL *receiptURL = [NSBundle mainBundle].appStoreReceiptURL;     BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:receiptURL.path isDirectory:nil]; Does this signify that the user has a non-AppStore copy of the app? Or could the receipt be missing for other legitimate reasons? Do I have to make a call to refresh the receipt to confirm this (as I would on iOS)? Again, this is for an existing app on the Mac App Store, not testing for sandbox users. Thanks.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
2 Replies
628 Views
Hi, I have been using the BackgroundTasks API on iOS for a while, and it works great. I want to do something similar on macOS, where I can easily run some background process from my app every X minutes, even if the app is closed. My Mac app runs in the sandbox, and isn't Catalyst-based, so I can't run the UIKit 'BackgroundTasks' API, and I haven't found anything similar on macOS. Does something like that exist, that is easy to adopt?
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
3 Replies
1.9k Views
I have a couple of questions about NSSharingService, specifically with NSSharingServiceNameComposeEmail:1) I use [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeMessage], then set the correct parameters and call `performWithItems` on it. This works fine if the Mail app is configured to be the "Default email reader" in Mail.app's Preferences. If I change this to some of the other email clients I have, this doesn't work anymore. I have tried MS Outlook, Airmail and Unibox apps, and this doesn't work in any of them. Is this intentional? Does the sharing service with NSSharingServiceNameComposeMessage only work for Mail.app?2) If that isn't the case, and other apps can be responsible for composing emails as well, what does an app have to do to handle this? If I want to set myself as an email client app, and let others call ComposeMessage, what API should I implement? If anyone has an idea on how to do this, would really appreciate the help.Thanks.
Posted
by zulfishah.
Last updated
.