Post

Replies

Boosts

Views

Activity

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.
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 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?
Nov ’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.
Nov ’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.
Oct ’24