Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Implementing Siri support using NSUserActivity, intents and shortcuts

Siri support can be added using an Intent and an IntentUI extension. This adds quite some overhead and is not always the easiest way in a big project, as you need shared logic between the main app and the extension. A much easier way to implement Siri support is by using NSUserActivity. Asking Siri to … 

 

Speeding up with Xcode Behaviors

Xcode behaviors can change the way how Xcode responds to certain events. Default behaviors help you already by showing for example the debug navigator when hitting a breakpoint, but they can speed you up a lot more. A list of behaviors which are not enabled by default. Starting point is the behaviors tab which can … 

 

Shortcuts essentials in Xcode to speed up your workflow

Making use of essential shortcuts in Xcode can speed up development and keep you in your flow. Xcode allows you to customise a lot, but most of the shortcuts are easy to adopt by default without custom settings. Run without building Sometimes during development, it can be useful to run the same build again, without … 

 

Measure the performance of code in Swift

It’s important in any type of programming language to know how to measure the performance of code as there are many different ways to write solutions and not every solution is as performant as the other. If a piece of code turns out to be slow in, for example, the results of the Time Profiler … 

 

Performance, functional programming and collections in Swift

Functional programming is often done in Swift and so easy that it could easily hit performance. Iterating over large collections and performing actions like filter or map is common and should be used wisely. Performance is often decreasing when these methods are combined, like a filter followed by first. A list of best practices. Prefer … 

 

SwiftLint valuable opt-in rules to improve your code

SwiftLint is a tool by Realm to enforce Swift style and conventions. It’s proven to be adopted by a lot of developer with over 10.000 stars on Github. 149 Rules are available for you to use from which a lot are enabled by default. In this post, we’re going over some valuable rules which are … 

 

Updating to Swift 4.2

Swift 4.2 is a major release and shipped with Xcode 10. It comes with a lot of code improvements for which the best way to start is to watch the WWDC 2018: What’s New in Swift session. Some of the improvements are easy to implement in your existing code. Replace strongSelf with self SE-0079 makes … 

 

Command-click on code options and possibilities in Xcode

Command-click no longer jumps to definition by default since Xcode 9 is introduced. It opens up a handy menu instead with a lot of options for quick editing, like: The old command-click behaviour can be restored in the settings or simply mimicked by using control + command + click Navigating through callers This option allows … 

 

Defer usage in Swift

Although the defer keyword was already introduced in Swift 2.0, it’s still quite uncommon to use it in projects. Its usage can be hard to understand, but using it can improve your code a lot in some places. The most common use case seen around is opening and closing a context within a scope How … 

 

CompactMap vs flatMap: The differences explained

CompactMap and flatMap, what are the differences and when do you use each? Swift 4.1 introduced this new method with the proposal 0187: Introduce Filtermap to gain more clarity in flatMap use cases. When to use compactMap Use this method to receive an array of nonoptional values when your transformation produces an optional value. See …