Enums are often used to model states. If we want to move to the next state (in order of declaration) we have to do the switch dance:
CaseSequencable: Put your enums in order
UserDefaultsPeristable: Save and Load a struct in UserDefaults
The user’s defaults database is a key-value store that let’s you persist data across app launches. It is meant to be used to store user preferences. Using the
Codeableprotocol and a
JSONEncoderyou can very easily convert Swift types to JSON data in order to store them.
How To Upload Data To A Server: Multipart/Form-Data HTTP Requests in Swift
So you are making your first face beautifier© app and it’s about time to upload some images to a server. The backend person asks you to do it via a type of HTTP POST request known as
multipart/form-data. Soon you come to realise that
URLSessiondoes not provide you with an out of the box
DataTaskfor this specific task, despite the fact that this is a very standard way of uploading data.
AVAudioSourceNode, AVAudioSinkNode: Low-Level Audio In Swift
Jekyll: Testing Swift Code Blocks
Podfast: a Podcast Discovery App
I can clearly recall my mother’s disappointment once she realised she couldn’t listen to the radio through her new iPhone. Which made total sense to me.
How to Set Up Xcode Build Configurations
Build configurations are useful for a handful of reasons. If you are developing an app that’s currently in production, chances are you are switching from your production API endpoints to some kind of test environment endpoints for development. Of course you can do the “comment/uncomment URL constants” dance everytime you need to switch environments, but other than being a tedious and error-prone process there are cases where build configurations are unavoidable.