Post

Replies

Boosts

Views

Activity

Reply to What is "focus"?
You must be a teacher with your own opinions already cemented. The documentation is very clear and provides examples. Stop fighting the system and follow the examples, perform actual test, and assess the results instead of fighting those providing the answers to your somewhat rant list of questions. As some will say, Read The ******* Manual. Look, I am just asking these simple questions: What exactly is "focus"? What isn't focus? What is the relationship between FocusState and accessibility focus? What is the relationship between whether a SecureField is being edited, and whether it's "focused"? If you know the answer, even if you're just copy-pasting it from somewhere else, please leave it as a response to this post, and if it's correct then I'll mark it correct. But please don't just reply and accuse me of being a teacher, because (a) I'm not a teacher, and (b) the documentation does not define what focus means, exactly, or whether it always directly corresponds with what's being edited, or not. I'm not fighting any systems; I just want to know the answer to these simple questions. Performing tests on devices or simulators won't tell me how it's supposed to work. Thanks.
Apr ’22
Reply to What is "focus"?
Note: I did find this discussion of the five "focusable states" in tvOS but this doesn't tell me which of these states "isBeingEdited" (if it existed for SecureField, which it doesn't) should correspond to if we're talking about iOS instead of tvOS. https://developer.apple.com/design/human-interface-guidelines/tvos/app-architecture/focus-and-selection/
Apr ’22
Reply to customizable/resizable sheets in SwiftUI?
@Frameworks Engineer wrote: If the system medium detent isn't sufficient for your use case, you may need to continue to use your own card/sheet implementation. < < < Problem is, the .sheet modifier doesn't give you the medium detent. It only gives the large detent. (Always covers the whole screen.) Apple... if you're listening... please add more flexibility to these SwiftUI APIs. Like... why are you adding functionality that's only available to UIKit? Are you deliberately trying to make adoption go as slow as possible while we reinvent every wheel?
Mar ’22
Reply to App crashes, but only on iOS 14, and only if installed via MDM
Also see this in the logs: -CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Sending EndInterruption to com.REDACTED.REDACTED with pid '49,178' because client moved to ForegroundRunning and is not allowed to play in the background. Could this be related? I googled "because client moved to ForegroundRunning and is not allowed to play in the background" and see some similar crash reports from people indicating an intermittent, device-only crash that only affects certain users, such as this post.
Nov ’21
Reply to Not able to install enterprise build in iOS 15 beta version
On iOS 15, when our app runs we see: AMFI: constraint violation /private/var/containers/Bundle/Application/272392ED-BF0A-48A0-8FB1-4FB707B234A0/REDACTED.app/Frameworks/SwiftProtobuf.framework/SwiftProtobuf has entitlements but is not a main binary for all our .frameworks. I checked and all our .frameworks have an empty plist as their entitlements, even though none of them specify an entitlements plist in anywhere in Xcode. Pray tell why these empty plists are being added Eskimo? And also, why does it trigger a violation in AMFI?
Nov ’21
Reply to App crashes, but only on iOS 14, and only if installed via MDM
Upon further investigation I noticed a Jetsam event around this crash implicating the app's process in being terminated due to using too much memory (2GB!) (see report below). Using up all the memory could only be possible if we have an infinite loop, and I also found several similar crash reports, with EXC_BAD_ACCESS and KERN_INVALID_ADDRESS or KERN_PROTECTION_FAILURE with Segmentation Fault 11 and Code 0xb, that indicate this could be caused by an infinite loop. So, what could cause an infinite loop, but only for MDM installs? I found another thread on this forum (link here) where someone had incurred an infinite loop due to following this code example from WWDC 2013 (link here) where an MDM manager class sets up an observer on NSUserDefaultsDidChangeNotification. Their infinite loop was due to someone putting a write call to UserDefaults in the target method of that observer. >.< So I checked and, sure enough, we have a write call to UserDefaults in the target method of the observer on NSUserDefaultsDidChangeNotification in our MDM manager. It was wrapped with an ivar to prevent the recursion, but it was not a perfect solution obviously. Something about how our iOS 14 build is optimized or the timing of when the method gets called on those builds triggers the recursion, which doesn't happen in iOS 15. In any event... the fix would be to not write to UserDefaults in that method if the change we want to make in UserDefaults already exists. So we're trying that, will reply here if it worked. { "uuid" : "1b20964b-84fa-329a-b8d0-7ad5df6f42ce", "states" : [ "frontmost" ], "killDelta" : 5005, "genCount" : 0, "age" : 73179629, "purgeable" : 0, "fds" : 50, "coalition" : 1975, "rpages" : 196608, "priority" : 10, "reason" : "per-process-limit", "physicalPages" : { "internal" : [ 135870, 60638 ] }, "pid" : 21668, "cpuTime" : 1.3859840000000001, "name" : "REDACTED", "lifetimeMax" : 196608 },
Nov ’21
Reply to Custom UIWindow subclass with UIWindowScene
There is another trick you can use. First you make a dummy class that conforms to UIWindowSceneDelegate: swift open class MyWindowSceneDelegate: NSObject &amp; UIWindowSceneDelegate {} Since all the requirements of UIWindowSceneDelegate are optional, the compiler will be happy. Afterwards you can do this: swift open class MyRealWindowSceneDelegate: MyWindowSceneDelegate { @objc var window: MyCustomUIWindowSubclass } At runtime when window is resolved, it will be of type MyCustomUIWindowSubclass.
May ’21