Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Exclusive Pre-Launch Offer: Get 20% Off atgoing-indie.com

How to test optionals in Swift with XCTest

Optionals types in Swift either have a value or not, and there are several ways to test optionals using the XCTest framework. APIs like XCTUnwrap are designed to unwrap an optional and throw an error if unwrapping failed. However, it can easily lead to writing many unwraps before evaluating the actual outcome you want to … 

 

How to use the rethrows keyword in Swift

Rethrows in Swift allows forwarding a thrown error by a given function parameter. It’s used a lot in methods like map, filter, and forEach and helps the compiler to determine whether or not a try prefix is needed. In my experience, you don’t have to write rethrowing methods that often. However, once you know how … 

 

Closures in Swift explained with Code Examples

Closures in Swift can be challenging to understand with types like trailing closures, capturing lists, and shorthand syntaxes. They’re used throughout the standard library and are part of the basics you need to know when writing Swift code. Xcode will help us most of the time with the right syntax using autocompletion but it’s good … 

 

What is a Computed Property in Swift?

Computed properties are part of a family of property types in Swift. Stored properties are the most common which save and return a stored value whereas computed ones are a bit different. A computed property, it’s all in the name, computes its property upon request. It can be a valuable addition to any of your …