Home

Blog






Swift Semantics


In this post, we’ll look at various ways to improve readability and writeability of Swift code by introducing extensions to Swift’s native types.





Uniquely identify the current device


In this post, we’ll look at how to uniquely identify the current device. We’ll look at different way of persisting the unique identifier to make it available even if the app is uninstalled.


Using the iOS keychain to persist data


In this post, we’ll look at how to read from and write to the keychain on iOS devices. We’ll look at a great library for this and how we can make it more abstract.


Url encode strings


In this post, we’ll discuss how to url encode strings. We’ll then create an extension that let’s us do this easier and with less code.


Case-sensitive String replace operations


In this post, we’ll discuss how to replace all occurences of a string within another string. We’ll then create an extension that allows for easier case-sensitive replacements.


Case-sensitive String contains checks


In this post, we’ll discuss how to check if a String contain another String. We’ll then create an extension that allows for easier case-insensitive checks.


Base64 encode and decode strings


In this post, we’ll discuss how to Base64 encode and decode strings in Swift. We’ll then create extensions that make this a lot easier and more readable.


Numeric string representations


In this post, we’ll create string representations of numeric types in Swift and extend these types with convenience functionality to make them easier to use.





Modify dates in Swift


In this post, we’ll extend Date with functions that let us add and remove seconds, minutes, hours and days to dates.




Bind view geometry data to bindable properties


SwiftUI is an amazing tool for building declarative user interfaces. However, it’s still young and lacks built-in ways to do many common things. In this post, we’ll look at a way to read geometry information from any view in a view hierarchy.


Building an Apple Watch app in SwiftUI


SwiftUI and Combine makes it amazingly easy to build apps for watchOS. However, if the app is part of a larger system, you may have to adjust your architecture. In this post, we’ll take a look at the work involved in building BookBeat’s SwiftUI/Combine-based app for Apple Watch.


Present delegating view controllers in SwiftUI


Presenting UIKit view controllers in SwiftUI is trivial, but things become more complicated when a controller communicates back through delegation. Since SwiftUI views are structs, they therefore can’t be delegates. In this post, we’ll look at one way to solve this.



SPM .gitignore excludes Xcode projects


When you create Swift Packages with swift package init, the generated .gitignore will exclude all Xcode projects by default. This will cause problems if you later add an Xcode project to your package.