Tab view in SwiftUI
Oct 10, 2021, 7:00 PM
TabView is a container view which enables navigating between multiple flows by selecting one of the items on the tab bar. Tapping on a tab item replaces the visible view with a view associated with the item. Tab view is set up by creating...
Structuring platform specific code in SwiftUI
Sep 26, 2021, 7:00 PM
Xcode provides a cross-platform app template in SwiftUI which can be built for macOS and iOS. This template includes a Shared folder which is meant for code used both on macOS and iOS. Many SwiftUI types and functions work both on macOS...
Sidebar layout on macOS in SwiftUI
Sep 12, 2021, 7:00 PM
A common UI layout on macOS has a sidebar and detail view side by side. The sidebar contains a list of items, where the selected item is displayed on the right and displays details of it. One would expect that creating such a view...
Adding async await to existing completion handler based code
Aug 29, 2021, 7:00 PM
Xcode 13 with Swift 5.5 toolchain brings async-await to the Swift language. The aim of this blog post is not to cover everything it brings, but instead concentrate on seeing how completion handler based code can be wrapped with async...
Flow layout with self-sizing items and fixed spacing in UIKit
Aug 15, 2021, 7:00 PM
One of the really common layouts I have needed to implement with collection view is a simple flow layout but with fixed spacings. Apple provides us UICollectionViewFlowLayout, but the sad part is that it has dynamic spacing between items....
Height fitting collection view
Aug 1, 2021, 7:00 PM
I have numerous times needed to show some sort of collection view which adjusts its height based on the content. Most of the time it has been a dynamic list within some more complex scrollable UI. Therefore, in this post, we’ll take...
Signal Path 2.6 for macOS, iOS and iPadOS
Jul 26, 2021, 5:57 AM
Signal Path version 2.6 is out. Signal Path now supports wav files in addition to the existing raw IQ data format. Audio recordings are now saved as wav files, and it means that audio recordings can be played with other music player apps....
Image converter with AsyncSequence
Jul 18, 2021, 7:00 PM
WWDC’21 brought us a new protocol named AsyncSequence. As the name stands, it represents a sequence of asynchronous elements. For trying out the new API we’ll build a tiny ThumbnailSequence which takes in a list of image names...
Requiring min code coverage in Swift packages with GitHub actions
Jul 4, 2021, 7:00 PM
I have written before about running tests and getting code coverage data for Swift packages in Running tests in Swift package with GitHub actions and Code coverage for Swift Packages with Fastlane. In this post, I am going to revisit the...
Signal Path 2.5 for macOS, iOS and iPadOS
Jun 29, 2021, 8:30 AM
Signal Path version 2.5 is out with a new welcome view on macOS and general improvements related to faster app launch time on all the platforms.
Exploring AttributedString and custom attributes
Jun 20, 2021, 7:00 PM
WWDC’21 brought new APIs for creating attributed strings. AttributedString is a new value type which provides a type-safe API for dealing with attributes, its also localizable, supports limited amount of Markdown syntax, and can be...
Subtitled button in SwiftUI
Jun 6, 2021, 7:00 PM
Buttons in SwiftUI are represented with a Button type. Buttons are easy to create and can be customized either with directly providing a styled label or using a ButtonStyle protocol… Read more Subtitled button in SwiftUI →
An overview of the time profiler in Instruments
May 23, 2021, 7:00 PM
Instruments is an application bundled with Xcode. It enables to measure application performance in variety of ways. Performance is extremely important as it keeps application responsive and in other things less CPU usage also means longer...
Measuring collections with Apple’s Swift Collections Benchmark
May 9, 2021, 7:00 PM
Apple's swift-collections package contains data structure implementations which have more specific use-cases and therefore not fitting into the Foundation. Along with collections Swift package Apple also released...
Running tests in Swift package with GitHub actions
Apr 25, 2021, 7:00 PM
Some time ago I published a tiny Swift package IndexedDataStore which tackles a problem of storing data blobs on disk. It could the image data or anything else. When working with Swift packages then it is extremely easy to build and run...
Code coverage for Swift Packages with Fastlane
Apr 11, 2021, 7:00 PM
Package.swift file in Swift packages describes the package contents including other dependencies, build targets and so on. Double-clicking a Package.swift file opens Xcode with that package and one can build and run tests. When adding...
Custom string interpolation in Swift
Mar 28, 2021, 7:00 PM
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...
Reading Fastfiles with document based SwiftUI app on macOS
Mar 14, 2021, 7:00 PM
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...
Adding prefixMap for expensive operations in Swift
Mar 1, 2021, 8:23 AM
Swift Foundation contains a lot of useful functions on collection types. In the context of this blog post we are interested in map(_:) and prefix(while:). Map is used for transforming collection elements and prefix(while:) for getting a...
Signal Path 2.4 for macOS, iOS and iPadOS
Feb 25, 2021, 6:52 AM
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
Feb 14, 2021, 6:00 PM
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...
Reading data from a file with DispatchIO
Jan 31, 2021, 6:00 PM
Signal Path is an app which works with large files, even in several gigabytes. The app reads ranges from the file and visualizes the data. Signal Path heavily relies on DispatchIO for having efficient access to data in a file. The aim of...
Signal Path 2.3 for macOS, iOS and iPadOS
Jan 25, 2021, 6:58 AM
Signal Path just got a new feature which was requested by users. Happy to announce that Signal Path 2.3 includes a audio replay feature. Now users can record audio and then replay the recording. Especially useful for people who would like...
Measurement, Unit, Dimension, and MeasurementFormatter on iOS
Jan 17, 2021, 6:00 PM
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...
Importing items from network to a Core Data store
Jan 4, 2021, 10:47 AM
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...
Most visited blog posts in 2020
Dec 31, 2020, 3:39 AM
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...
Opening hyperlinks in UILabel on iOS
Dec 19, 2020, 6:00 PM
UILabel supports displaying attributed strings with link attributes but what it does not support is allowing to tap on hyperlinks and opening those in Safari. An Alternative way is using an UITextView which does support opening hyperlinks...
CoreGraphics based image resizer for multiplatform apps in Swift
Dec 6, 2020, 6:00 AM
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...
Using an image picker in SwiftUI
Nov 22, 2020, 6:00 AM
A SwiftUI view showing buttons for taking a photo and opening photo album.
Observing a KVO compatible model in SwiftUI and MVVM
Nov 7, 2020, 6:00 PM
In model-view-view model (MVVM) architecture the view model observes the model and provides data for the view by transforming it when needed. When the user interacts with the view and changes the data in it then the view model's...
Resizing UIImages with aspect fill on iOS
Oct 24, 2020, 7:00 PM
Resizing images is an important topic when we need to display images which do not match with the intended display size. For example, rendering much large images in a small rectangle. UIImageView supports scaling images automatically but...
Publishing API documentation in GitHub with Jazzy
Oct 11, 2020, 7:00 AM
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...