RSSAmplifier

Blog

supersonicbyte

swifty bytes

supersonicbyte.comRSS feed ↗7 posts

Latest posts

Swift interoperability with C (Part 1)

Intro The C programming language is the backbone of modern computing. With its assembly-close nature offering speed and effectiveness it's still the main choice when writing system software since it's beginning is the '70s. Most operating systems are written in C. For any new programming language, it's crucial to have a way to communicate and integrate with existing C code. Swift comes with…

SKTestSession testing failures

With iOS 17, Apple shipped a new API allows us to simulate errors when unit testing StoreKit. The API exposes a method called setSimulatedError (_ error: API.Failure?, forAPI api: API ) which is intended to be used on a instance of a SKTestSession . For example, we would use the API to simulate a NetworkError for the purchase API. try await session . setSimulatedError ( . generic ( . networkError…

Attaching debugger to system apps

Recently, I was writing some UI code, and a question struck my mind: How did Apple do it? I needed a way to find out what Apple was doing to achieve some of their UI in system apps. Luckily, it turns out we can debug the view hierarchy of system apps on the simulator. In order to do so, we must first turn off System Integrity Protection (SIP) . SIP brings enormous efforts to protect your system…

Running code when App is Ready

Every now and then, you find yourself in a situation where you need to run specific code when certain conditions are met. My recent encounter with this involved the following flow: • A VoIP notification wakes up my app • I need to handle internal call logic and start a call The problem was that the second part of this flow couldn't start until the UI was ready. In my case, I had to ensure that the…

Shortcuts URL Scheme Guide

Many products have great features that aren't utilized as much as they should be. When it comes to iOS, Shortcuts are definitely one of them. To me, Shortcuts provide a meeting place for all the apps the system provides, enabling us to make different apps cooperate. We can run them and connect the outputs of one app to the inputs of others. The possibilities are infinite. This post will focus on…

Introducing Publishmon

Recently, I made the decision to rewrite my personal site/blog using Publish . Publish is a popular choice for iOS developers and Swift enthusiasts, and I quite enjoyed the learning curve. However, one thing bothered me: I hated the fact that I had to manually regenerate files and run publish run in the terminal to restart the HTTP server. I remembered when I was writing some Node.js code that…

Xcdatamodeld No File Inspector

Recently I worked on a project that uses Core Data. The underlying model changed and I needed to update an entity. This involved changing an attribute from String? to [String]? . In order to make the migration I added a new version of the model. When I tried to set the current active model in the xcdatamodeld file, the file inspector was blank and there wasn’t a way to do it through the UI (Xcode…