Category: Swift playgrounds
-
Launch an Alert from a Closure Safely
Your app can get into problems when you launch UI from others threads, such as closures. For example, you might have an app that going to ask for permissions for things like photos, notifications, or location data. The system usually handles those, but you might want to be even more exclusive on what to use,…
-
Tip: Deep Dive into Any? Dictionaries
In many factory methods, you’ll find parameters with type Any? like this: userInfo parameters in iOS and context in watchOS use these. You can place anything there, but most often, you’ll use a dictionary of type [String:Any]. This is a great way of moving multiple values from one method to another without making a class…