Post

Replies

Boosts

Views

Activity

Reply to Battery level getting from UIDevice is not accurate on iOS17
@Frameworks Engineer It looks like this is not working at all on MacCatalyst builds. I'm consistently getting batteryLevel: 0 and the following error printed to console while debugging: Error retrieving battery status: result=-536870207 percent=-2109898751 hasExternalConnected=0 isCharging=4 isFullyCharged=244 Is this also intended behavior? We're depending on this value while in fullscreen mode for our users to have a semi-accurate representation of their battery life, specifically for MacBook users.
Jun ’24
Reply to iOS13 SKStoreProductViewController cannot be subclassed
Giving kudos to this SO post - https://stackoverflow.com/a/32171894 for giving me the idea. I happened upon this crash in my app and I used the approach outlined there to keep my app fixed in landscape while allowing the SKStoreProductViewController to be presented in portrait. It's not the perfect experience when on an iPhone, the SKProductViewController will present in portrait although the screen launching it will be in landscape. For me this experience is better than a crash. In you AppDelegate file: (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window { if (UIDevice.isPad) { /* I have `isPad` in a Swift extension as a computed class var on UIDevice - `current.userInterfaceIdiom == .pad`*/ return UIInterfaceOrientationMaskAll; } else { return UIInterfaceOrientationMaskAllButUpsideDown; } } Then in your base view controller use: (UIInterfaceOrientationMask)supportedInterfaceOrientations {     return UIInterfaceOrientationMaskLandscape; } It's working perfectly for me and no more crash! Hope it helps someone even though the original question is from a year ago.
Feb ’21