iOS Newsletter
Hey!
The aftermath of the last iPhone / watchOS release looks like a lot of boxes with the drawers already full. What do you do with your boxes? Do you keep them, throw them away or list them up for sale?
Enjoy our newsletter while you think about it ;)
Swift
Swift Java Interoperability Tools and Libraries
Listing this thing here mostly for pleasing every colleague who spammed our Slack channel :)
This repository was introduced on the keynote of the Swift Server Conference, with the aim to create an “environment for collaboration and joint exploration of the Swift/Java interoperability story”. It is believed that it’s used by Apple to bridge the gap between existing Java backends (WebObjects) and the newer Swift work.
You better increase URLCache size
Marco Eidinger stumbled on an interesting find recently - apparently Apple’s URLSession
has some heuristics to determine if a response can be considered good for caching or not. This can lead to potential issues in some cases, but if you need the TLDR - just do what the title says.
How to Visualize a Dependency Graph of Swift Dependencies
Complexity on successful projects grows often and quickly. With that, external dependencies are being introduced, build times are going up and up and in general it gets harder for newcomers to cope up with the codebase. Extracting features into separate packages helps us to deal with the build times and code reuse, but it creates another problem - a web of dependencies that is hard to keep a mental picture of. One way of dealing with this problem is to have a diagram of the dependencies and use it as a reference when you need to refactor something. This article explains how to do that.
macOS
How to build a Safari extension with SwiftUI
macOS is a platform that often gets overlooked when planning an app in favor of mobile, but it can offer a lot to the end user. Safari, being the vendor browser, can be a great choice to integrate your business features. Here’s an article to get you started with the basics of creating a Safari extension.
iOS
Preventing app removal on iOS
Did you know that a removal of an app can be prevented? It was a surprise to many of us, but you learn every day. Read on to discover how to do it, but beware - there are some rules for your app to classify for this.
Testing
Using the #expect macro for Swift Testing
Antoine van der Lee wrote another article on the new SwiftTesting
framework. The #expect
macro is at the core of the framework and learning how to use it is essential. The author even came with a trick to migrate your XCTestAssertEqual
s to the #expect
macro using a simple replacement.
Tips
Quick Swift/UIKit tip…💡
Seb Vidal came up with this awesome piece of advice on using @dynamicMemberLookup
when wrapping a class but you need the wrapper to expose the methods and properties of the wrapped class.
Talk
So You Think You Know Swift?
Nick Lockwood gave a fantastic talk at Swift Server Conference this year. If you haven’t watched it yet - we highly recommend it as it’s now on YouTube. The talk takes a deeper look at some of the common APIs in Swift to reveal lesser known features, as well as exposing underlying mechanisms such as copy-on-write or existential containers, and how they can affect both the behavior and the performance of your code.