A Network Extension on macOS allows you to create content filters, DNS proxies, and more. They integrate nicely into the system settings and are often used for applications like firewalls and VPN services. While Apple provides several sample applications like this for filtering network traffic, they don’t have an excellent explanation for testing and debugging …
extensions
Custom Operators in Swift with practical code examples
Custom operators in Swift can make your code easier to read and simpler to maintain. Code can be written less lines of code while keeping it clear what is happening. Custom operators are also known as advanced operators and allow you to combine two instances with a self-chosen infix, prefix, postfix, or assignment operator. When …
Core Data and App extensions: Sharing a single database
Core Data got better and better over the years with improved APIs that make it easier to work with. The Apple framework allows you to save your application’s permanent data for offline use, to provide undo functionality or to simply cache data for better performance. After implementing the basics into your app like using a …
Typed notifications using custom extensions
The Swift API contains a lot of notifications sent out by the system like NSManagedObjectContextObjectsDidChange in Core Data or the AppDelegate events like UIApplicationDidBecomeActive. Some of these notifications contain rich data in their user info dictionary. Reading the user info data using typed notifications can clean up your code, especially if you use these notifications …