Post

Replies

Boosts

Views

Activity

Reply to Does the Random Number Generation (RGN) process change over different OS versions?
What random number API are you using? Does its documentation specify its exact algorithm? If not, then there’s always a risk that you are accidentally relying on undefined behavior that could change over time. That said, I’d be a little surprised if Apple is putting much effort into improving the older PRNG functions such as rand and random (C functions). There’s also arc4random but it’s not seedable, so I’m guessing that’s not the one you are using.
Oct ’24
Reply to Swift Exception Handling in Apple OSes
When I say exceptions in Swift, I mean, divide by zero, force unwrapping of an optional containing nil, out of index access in an array, etc. Those are programmer errors which of course ideally (!) should never occur in shipping code. They are treated as unrecoverable by the Swift runtime. You should make sure to distinguish these from error conditions that can occur due to run time conditions rather than errors not caught at development time. Swift’s error mechanism is designed to handle the latter but not the former. Consider: if your code tries to execute one of those serious programmer errors, then clearly the app is already off the rails in some way, so any recovery logic you want to attempt may be unhelpful at that point. The app should be considered unstable and broken. In Android, there is the setDefaultUncaughtExceptionHandler method to register for all kinds of exceptions in any thread in Kotlin. I'm looking for something similar in Swift There is no equivalent in Swift. Currently, I'm reading about ExceptionHandling framework That’s for Objective-C. The exception mechanisms of Objective-C and Swift are totally separate.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’24
Reply to Can I Implement an Exit Button in an iOS App?
Having an app abruptly vanish and dump back to the home screen is also known as “crashing.” Why do you want that user experience in your app? The user can always go directly to the home screen or task switch to another app using the standard interactions for doing so. Here’s an old but apparently still valid document on the subject: How do I programmatically quit my iOS application?
Topic: Design SubTopic: General
Nov ’24
Reply to How to disable automatic modification of struct to enum in my code
Is your project configured (by someone) to run a linter as a build step? If so, is that linter performing auto corrections? (Yikes!) And if so, is that linter triggering on your structs that contain no instance properties? (I’m familiar with SwiftLint which has a rule that suggests changing struct to enum when there are only static properties, but it doesn’t trigger on your Padding struct. Maybe a different linter does something similar but goes wrong in your case.)
Nov ’24
Reply to Restroom Symbol In SF Symbols?
There are a few with “toilet” in the name, available starting in iOS versions 16.0 and 16.1. They look like what they sound like. There don’t seem to be any for the pants-wearing person and skirt-wearing person icons commonly found on restroom doors. To request something new, probably just file a regular suggestion via Feedback Assistant.
Topic: Design SubTopic: General Tags:
Nov ’24
Reply to Determing cause of a crash with a generic stacktrace
Are these crashes being missed by Crashlytics, or is there some issue with dSYSMs in Crashlytics? This isn’t a specific answer, but if using a 3rd party crash reporter you should start with a little light reading on Implementing Your Own Crash Reporter.
Replies
Boosts
Views
Activity
Sep ’24
Reply to Has iOS 18 changed the threshold for decoding base64 into ASCII code?
Why doesn't switching from .ascii to .utf8 work? Doesn't this allow for the high bit to be set? Not all possible byte sequences are valid UTF-8.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Does the Random Number Generation (RGN) process change over different OS versions?
What random number API are you using? Does its documentation specify its exact algorithm? If not, then there’s always a risk that you are accidentally relying on undefined behavior that could change over time. That said, I’d be a little surprised if Apple is putting much effort into improving the older PRNG functions such as rand and random (C functions). There’s also arc4random but it’s not seedable, so I’m guessing that’s not the one you are using.
Replies
Boosts
Views
Activity
Oct ’24
Reply to How to handle to WiFi networks with same SSIDs?
You may find this thread helpful, particularly this part: [quote='773887022, DTS Engineer, /thread/742549?answerId=773887022#773887022'] iOS’s underlying Wi-Fi infrastructure assumes that all APs with the same SSID lead to the same network [/quote]
Replies
Boosts
Views
Activity
Oct ’24
Reply to URL Schemes for Direct Access to Software Update Settings on iOS Devices (18.0.1)
Read this page carefully: Supported URL Schemes. Unfortunately, that page doesn’t lead to any documented API for what you are hoping to accomplish.
Replies
Boosts
Views
Activity
Oct ’24
Reply to UIApplication.shared.open
Read this page carefully: Supported URL Schemes. Unfortunately, that page doesn’t lead to any documented API for what you are hoping to accomplish.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Swift Exception Handling in Apple OSes
When I say exceptions in Swift, I mean, divide by zero, force unwrapping of an optional containing nil, out of index access in an array, etc. Those are programmer errors which of course ideally (!) should never occur in shipping code. They are treated as unrecoverable by the Swift runtime. You should make sure to distinguish these from error conditions that can occur due to run time conditions rather than errors not caught at development time. Swift’s error mechanism is designed to handle the latter but not the former. Consider: if your code tries to execute one of those serious programmer errors, then clearly the app is already off the rails in some way, so any recovery logic you want to attempt may be unhelpful at that point. The app should be considered unstable and broken. In Android, there is the setDefaultUncaughtExceptionHandler method to register for all kinds of exceptions in any thread in Kotlin. I'm looking for something similar in Swift There is no equivalent in Swift. Currently, I'm reading about ExceptionHandling framework That’s for Objective-C. The exception mechanisms of Objective-C and Swift are totally separate.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Swift Exception Handling in Apple OSes
Here it is: Implementing Your Own Crash Reporter. To jump quickly to the section on signals, search for “gaping pitfalls.”
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Can I Implement an Exit Button in an iOS App?
Having an app abruptly vanish and dump back to the home screen is also known as “crashing.” Why do you want that user experience in your app? The user can always go directly to the home screen or task switch to another app using the standard interactions for doing so. Here’s an old but apparently still valid document on the subject: How do I programmatically quit my iOS application?
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to disable automatic modification of struct to enum in my code
Is your project configured (by someone) to run a linter as a build step? If so, is that linter performing auto corrections? (Yikes!) And if so, is that linter triggering on your structs that contain no instance properties? (I’m familiar with SwiftLint which has a rule that suggests changing struct to enum when there are only static properties, but it doesn’t trigger on your Padding struct. Maybe a different linter does something similar but goes wrong in your case.)
Replies
Boosts
Views
Activity
Nov ’24
Reply to Is having a button to exit the app on iOS still ground to exclusion ?
Here’s one recent thread on the topic that includes a link you may find useful. We have a client that want us to add such button Gotta wonder what their next example of unfamiliarity with this platform will be.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to iOS 18.1 Deeplink to Wallpaper settings
This is a popular topic lately. See the  Recommended reply and link in this thread.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Adding New Emoji
Emoji are governed by the Unicode Consortium, not Apple. Start here: Guidelines for Submitting Unicode® Emoji Proposals https://unicode.org/emoji/proposals.html
Replies
Boosts
Views
Activity
Nov ’24
Reply to Radio Access Technology Constants
When posting code examples, please use the Code Block formatting style, like this: func getCellularConnectionType() -> String { return "This is readable now." }
Replies
Boosts
Views
Activity
Nov ’24
Reply to Restroom Symbol In SF Symbols?
There are a few with “toilet” in the name, available starting in iOS versions 16.0 and 16.1. They look like what they sound like. There don’t seem to be any for the pants-wearing person and skirt-wearing person icons commonly found on restroom doors. To request something new, probably just file a regular suggestion via Feedback Assistant.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24