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. Welcome view on macOS
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 even...
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 to define the visual appearance. Quite often we can find...
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...
Animating a custom wave shape in SwiftUI
Sep 27, 2020, 10:19 AM
Wave shape with red button on top of it
Adding SwiftLint to a project in Xcode
Sep 13, 2020, 7:00 AM
SwiftLint is a tool for validating the style and conventions in Swift files. It is easy to integrate to a project. Minimum set up consists of installing SwiftLint and adding a build phase to your app target in Xcode. SwiftLint comes with a...
Creating a pre-push git hook in Swift script
Aug 30, 2020, 7:00 AM
Git hooks are scripts written in any scripting language and are triggered when important actions occur. Hooks are stored in the repository’s .git/hooks folder. The script needs to have an appropriate filename without a path extension and...
Sharing data from CoreData storage with a Widget on iOS
Aug 16, 2020, 7:00 AM
WWDC’20 introduced WidgetKit which is a new framework for building widgets on iOS, iPadOS, and macOS. Widgets provide a quick way for displaying content from your app either on the home screen on iOS or on the notification center on macOS....
@StateObject and MVVM in SwiftUI
Aug 2, 2020, 7:00 AM
A while ago I wrote about using MVVM in a SwiftUI project. During the WWDC’20 Apple announced @StateObject property wrapper which is a nice addition in the context of MVVM. @StateObject makes sure that only one instance is created per a...
Creating and publishing a Swift package
Jul 19, 2020, 7:00 AM
In the previous post we looked into how to separate code with local Swift packages within a project. This time let's create a Swift package, publish it on GitHub, and add it to a separate project. We'll create a package which extends...
Separating code with Swift packages in Xcode
Jul 5, 2020, 7:00 AM
Xcode 12 comes with Swift toolchain 5.3 which brings resource and localisation support to Swift packages. Nice thing is that Swift package support only depends on the toolchain's version and does not have additional OS requirements. At the...
Picker and segmented control in SwiftUI on iOS
Jun 21, 2020, 7:00 AM
Picker is used for presenting a selection consisting of multiple options. UISegmentedControl which is known from UIKit is just a different picker style in SwiftUI. Let's take a quick look on how to create a form with two items: picker with...