ExpressibleByStringInterpolation is a protocol which makes it possible to compose strings with expressions evaluated at runtime. Interpolated strings are created with adding a \(some code) to a string. Those expressions are evaluated and a final string is created. This protocol, among other things, enables customizing strings what are created by those expressions. At the end …
Reading Fastfiles with document based SwiftUI app on macOS
WWDC'20 brought an addition to SwiftUI apps which enables to create document based applications in SwiftUI. Along with DocumentGroup API two new protocols were added: FileDocument and ReferenceFileDocument. The first one is meant for value types and the latter one for class type document types. For seeing how much effort it takes to create a …
Continue reading "Reading Fastfiles with document based SwiftUI app on macOS"
Signal Path 2.4 for macOS, iOS and iPadOS
Signal Path version 2.4 is out. This time it is a smaller release concentrating on optimizing file accesses when playing audio or just scrolling through the file.
Building a memory cache for a file reader in Swift
In the previous blog post Reading data from a file with DispatchIO I built a small FileReader which enabled reading data from a file for random byte ranges. Signal Path uses a similar file reader but in addition it also caches read data in some interactions where there are a lot of read requests active, for …
Continue reading "Building a memory cache for a file reader in Swift"
Measurement, Unit, Dimension, and MeasurementFormatter on iOS
I was looking at formatters provided by Foundation framework and this time I would like to put some attention on MeasurementFormatter. Like the name says, it is used for creating localized strings of some sort of measurements. Measurements are represented by a generic struct Measurement where the generic UnitType describes the unit represented by it. …
Continue reading "Measurement, Unit, Dimension, and MeasurementFormatter on iOS"
Importing items from network to a Core Data store
Many apps use Core Data for persistence and also need to import data from a server. Imported items typically have a unique identifier which can be used for identifying them. The count of imported items can be high therefore it is preferred to batch insert the items instead of adding them one by one. Core …
Continue reading "Importing items from network to a Core Data store"
Most visited blog posts in 2020
I have been writing a new blog post at least every second week and therefore in 2020 I have published total of 27 blog posts. It is time to take a look back on the 2020 and see which blog posts were the most popular ones. I am just looking at the total count of …
CoreGraphics based image resizer for multiplatform apps in Swift
Just a couple of weeks ago I wrote about resizing images on iOS: Resizing UIImages with aspect fill onĀ iOS. As I am currently building a macOS, iOS, watchOS app I realized that I need a multiplatform image resizer. As this app deals with full size photos then I need to resize those photos for avoiding …
Continue reading "CoreGraphics based image resizer for multiplatform apps in Swift"
Publishing API documentation in GitHub with Jazzy
Jazzy is an excellent tool for generating API documentation for Swift and Objective-C projects. Let's take a look how to generate and publish API documentation in GitHub with Jazzy. Installing Jazzy Installation: sudo gem install jazzy Jazzy config file for a Swift package Configuration options can be passed into Jazzy directly with the command or …
Continue reading "Publishing API documentation in GitHub with Jazzy"
Animating a custom wave shape in SwiftUI
Wave shape with red button on top of it