Post

Replies

Boosts

Views

Activity

Defer system gestures in a WatchKit app
Hi, I'm making a WatchKit game app with SpriteKit and Objective-C, and I'm encountering an annoyance where system gestures, namely long-pressing the top and bottom edges to pull Notification/Control Center, interfere with the controls of the game. In iOS, this can be mitigated by using overriding preferredScreenEdgesDeferringSystemGestures in UIViewController, but I couldn't find any equivalent API in any WatchKit class, and searching for similar symbols only yielded a single private API (-[_UISystemAppearanceManager screenEdgesDeferringSystemGestures]) that isn't ever called on watchOS. Any idea how to achieve a similar effect on watchOS?
1
0
168
2w
Downloading files from iCloud
I'm trying to safely perform the apparently complex task for a cloud storage API, namely "downloading files", but it seems like iCloud APIs are comically broken beyond repair: -[NSFileCoordinator coordinateAccessWithIntents:queue:byAccessor:] calls the accessor block before all files have finished downloading. The same API will also return success (called the block with error == nil) even if the download fails (e.g. the phone is in airplane mode). I both cases, the files requested by the intents will not exist. -[NSFileManager startDownloadingUbiquitousItemAtURL:error:] does not have a completion block (Why?!?!) Similarly, this API will return success even if it fails (e.g. airplane mode) Manually checking NSURLUbiquitousItemIsDownloadingKey is broken as well, failed downloads (e.g. Airplane mode again) will retain their "Downloading" status, and NSURLUbiquitousItemDownloadingErrorKey is never updated. How can one safely download a file from iCloud if all of the APIs are broken?
6
0
422
Sep ’24
UTI Conflicts, iOS
My iOS app wants to associate itself with a certain file extension, let's say .aaa. To do so I declare the following exported type: <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> </array> <key>UTTypeDescription</key> <string>AAA File</string> <key>UTTypeIdentifier</key> <string>com.myapp.aaa</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>aaa</string> </array> </dict> </dict> As well as this under the supported document types: <dict> <key>CFBundleTypeExtensions</key> <array> <string>aaa</string> </array> <key>CFBundleTypeName</key> <string>AAA File</string> <key>LSItemContentTypes</key> <array> <string>com.myapp.aaa</string> </array> <key>LSHandlerRank</key> <string>Owner</string> </dict> Turns out, several other apps on the App Store also register the .aaa file extension, each under a different UTI, making it impossible to open .aaa in my app if they installed it after already having installed another app claiming this extension. Moreover, some of these app declare all of their supported file extensions under a single UTI (e.g. both .aaa and .bbb are associated with the com.theirapp.generic UTI), so I can't even add their UTI to LSItemContentTypes without associating myself with files I don't support. How do I force iOS to allow opening every file with the .aaa extension with my app, regardless of any potential third-party app registering the same extension? For clarification – the .aaa file extension in this example is always associate with a single type and format, but it doesn't have an agreed-on UTI identifier or MimeType, nor is there a single app that should be the sole "exporter" of the UTI type.
2
1
549
May ’24
StoreKit 1 Subscriptions
In StoreKit 1 and Objective-C, how do I obtain currently active subscriptions? I'm trying to obtain this information: The currently active (i.e. valid and not refunded) subscription in a subscription group A "pending" subscription, if any (when changing subscription types mid-period), and its starting date Sadly, all StoreKit 1 documents are buried deep under StoreKit 2 docs. Using StoreKit 2 is not an option.
0
0
426
Apr ’24
Remounting the root partition as R/W
Hi I’m a power user who often modifies system files, either temporarily or permanently, for the sake of customizing undesired system behaviors, advanced troubleshooting, and so on. As such, I require being able to modify the system partition without having to reboot my Mac for changes to take effect. Between El Capitan and Mojave, disabling SIP was enough. In Catalina a single remount command per boot was additionally required. But starting with Big Sur I failed to find a way to modify, temporarily or not, a system file without rebooting the machine. The inability to do so is currently preventing me from upgrading to Big Sur on the majority of my machines because this is a must-have feature to me, as well as preventing me from upgrading my Mac due to Big Sur being the only version supported on ARM based Macs. What steps do I have to take to prevent macOS from booting into an immutable snapshot rather than a raw APFS partition? Existing APFS snapshot managing tools seem to be unable to delete the snapshot from the system partition.
0
0
513
Jun ’21