Post

Replies

Boosts

Views

Activity

Reply to Localization issue?
In your actual code, are you formatting a variable, or is it an integer literal as in the example? Assuming it’s a variable, I’d suspect not a localization bug but a change in behavior causing the variable to have a garbage value that gets formatted. Does this issue occur when (1) you run a Release build locally; and (2) when you submit a Debug build to TestFlight?
Jul ’22
Reply to Does iPadOS really exist? If so, why is there no Xcode compiler directive for it?
You said the quiet part out loud. Indeed “iPadOS” is mostly a marketing gimmick. On the technical side nothing really changed and there’s still a single iOS SDK. If you have separate build targets for iPad and iPhone (“and iPod touch!” says a lonely voice from the back row) then of course you can define your own compile-time condition for that in each target. But for App Store distribution it still needs to be a single build for all iOS devices, so building different binaries for different idioms wouldn’t be useful.
Jul ’22
Reply to Access other app notifications
In general[1], there’s no public API to discover anything about other apps installed on the device. That would be a big privacy fail. There’s actually a tiny crack in the armor with the UIApplication.canOpenURL function, but it wouldn’t help with what you are trying to do.
Topic: App & System Services SubTopic: Hardware Tags:
Jul ’22
Reply to XCode signing says NSHomeKitUsageDescription not supplied, how do I do that?
Wait, is the error message from just trying to build in Xcode, or is it when trying to upload an archived build to App Store Connect? I assumed the latter since it does sound like the kind of messages you can get upon a failed upload. Either way, does the issue repro if you create a new empty app and perform the steps to add HomeKit? And if it’s when trying to upload, does the organizer’s Validate feature produce the same error, or does Validate run clean and it fails only when trying a real upload?
Jul ’22
Reply to XCode signing says NSHomeKitUsageDescription not supplied, how do I do that?
I looked at the profile under my development account and I can see the HomeKit entitlement Do you mean you see that capability enabled in your App ID, or you mean you have a manually-created provisioning profile and see it there? Is the app using a manual provisioning profile or one that Xcode manages for you? (The kind not listed in your account online.) I have HomeKit enabled in the .entitlements file Did you add the HomeKit capability via Xcode’s Signing & Capabilities screen, or by manually editing the entitlement file? Just trying to figure out what may be different from the standard automated behavior, if any.
Jul ’22
Reply to NSProccessInfo systemUptime gives massively different values in iOS simulator versus device
By experiment with the Swift REPL, I’m seeing that the simulator’s ProcessInfo.processInfo.systemUptime is just a passthrough to the same property on macOS. It seems to indicate the time the Mac has been awake, as documented. But testing your code here, I’m seeing that systemUptime and every event timestamp are in sync, differing only by milliseconds as expected instead of thousands of seconds. Does this problem repro for you in a minimalist test app, in addition to your main app? And what is this “main thread clogged up somehow” condition that motivated this in the first place? Needing to debounce system click events like this is very unusual.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22
Reply to XCode signing says NSHomeKitUsageDescription not supplied, how do I do that?
Go to your target settings and select the Info tab. You’ll add your setting in the Custom iOS Target Properties section. In this screen the key name is rendered as Privacy - HomeKit Usage Description. Under the hood Xcode stores it as a user-defined build setting with a key of INFOPLIST_KEY_NSHomeKitUsageDescription and then copies it into the final Info.plist file at build time. You can see this key (after you add it) in the Build Settings list, but this is really more of an implementation detail.
Jul ’22
Reply to iPhone 12 mini simulator
What’s the issue? The simulator is accurate. But note the phone has two “Display Zoom” options: Standard and Zoomed. Mismatch between these modes may be what the OP is reporting above. As for the mismatch where the device’s physical pixel resolution isn’t equal to the (Standard mode) point resolution multiplied by the scale (3.0), that’s correct. Some iPhone models slightly downscale the “logical” point coordinate system into the “native” pixel coordinate system. But you should be able to ignore this. Just test your app using both Standard and Zoomed modes on simulator models that support it.
Jul ’22
Reply to Overuse of DispatchQueue.main.async?
if the calling code was already on the main thread, and the function they called also called the DispatchQueue.main.async, it seems like that call was delayed/not-called, and being requeued on the run loop for the next call. That is correct behavior, not a bug. No matter what queue you are currently executing on, the async() call just adds your closure to the target queue and returns. Is there any better way to debug this? No magic bullet here, but I’ve found this function is handy for verifying assumptions about what queue you are executing on: dispatchPrecondition(condition: .onQueue(.main)) // or whatever queue you want to check
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22
Reply to App Transport Security has blocked a cleartext HTTP connection since it is insecure
Your NSExceptionAllowsInsecureHTTPLoads key is in the wrong place. It needs to be a child of the domain key (your redacted red item) rather than a child of the Exception Domains key which is one level up. It should look like the last screenshot shown on this page. Tip: In Xcode’s property list editor, to add a key to a dictionary, make sure to expand the dictionary (so the disclosure chevron points down) before you click the ⊕ button. That will create the new key as a child of the current row. Otherwise (if not expanded) it will add the new key as a sibling of the current row, which may have happened in your case.
Jul ’22
Reply to HourWeather timezone offset?
Scratch that. Now I’m going with the theory (commented in your other thread) that your chart is correct but actually showing weather data from somewhere else. If the longitude were flipped from 119ºW to 119ºE then it would designate a place with the same season and the same daily sun cycle, just shifted about 8 hours behind. This could explain all the weird results you’re seeing.
Topic: App & System Services SubTopic: General Tags:
Jun ’22
Reply to HourWeather timezone offset?
How are you formatting those time strings? You would need to use a date formatter with the time zone set correctly. WeatherKit uses the good old Date type and (in my testing here) they are correct, whether I view them in the debugger or print them using a date formatter set to my time zone.
Topic: App & System Services SubTopic: General Tags:
Jun ’22