Hi there 👋

Welcome to how RsyncUI is built

Development of RsyncUI

RsyncUI which is a pure SwiftUI and Swift based application, is by no means an advanced or complicated application. There are many developers out there writing about SwiftUI, new features in SwiftUI and how to use them. This web is not a site to show how to use SwiftUI and new features about SwiftUI. This web is about how I use SwiftUI in developing RsyncUI. JSON files vs SwiftData A SwiftData version of RsyncUI is also developed but not released....

February 28, 2024 · 4 min · 675 words · Thomas Evensen

Navigation

The main navigation, when RsyncUI starts, is by a NavigationSplitView: A view that presents views in two or three columns, where selections in leading columns control presentations in subsequent columns. NavigationSplitView RsyncUI utilizes two columns. Left column for main functions and the right column for details about each main function. The NavigationLink selects the details part depended upon the value of selectedview. The left column is built in the order of the enum values....

February 27, 2024 · 3 min · 432 words · Thomas Evensen

Asynchronous execution

Concurrency and asynchronous execution are key components of Swift. The latest version of Swift makes it even easier to write asynchronous code using Swift´s async and await keywords. The concurrency model of Swift is complex, and it requires, at least for me, time and study to understand the basics. Apart from GUI updates, which SwiftUI takes care of, there is no concurrency in RsyncUI. But there is asynchronous execution, but only one at a time....

February 26, 2024 · 2 min · 273 words · Thomas Evensen

Dataflow in RsyncUI

The flow and handling of data are slightly different in RsyncUI using JSON file vs SwiftData. From Apple Developement Documentations quote Apple: “Combining Core Data’s proven persistence technology and Swift’s modern concurrency features, SwiftData enables you to add persistence to your app quickly, with minimal code and no external dependencies.”. Sorting and filter data is also somewhat different using JSON or SwiftData as storage. There are three files saved to storage: tasks, log records and user settings....

February 26, 2024 · 6 min · 1208 words · Thomas Evensen

Combine

Combine, a declarative library by Apple, is utilized in several parts of RsyncUI. Before the new @Observable macro was introduced Combine was also a requiered part of the property wrapper @StateObject in combination with ObservableObject. The new macro @Observable is not depended upon Combine and the following are examples of utilizing Combine in RsyncUI: read json configuration file for tasks, only the JSON version of RsyncUI write json configuration file for tasks, only the JSON version of RsyncUI observing signals within the process object, debouncing input from user, filter strings and other values which are validated before saving Debounce Combine is used for debounc user input in filter search....

February 25, 2024 · 2 min · 245 words · Thomas Evensen

Application logging

Included in Swift 5 there is a unified logging feature OSLog. There are several methods for logging and investigate what the application is up to. By using OSLog there is no need for print statements to follow execution. All logging is by utilizing OSLog displayed as part of Xcode. The Process objects are where all the real work is done. OSLog is included in all objects which perform work and it is very easy to check which commands RsyncUI are executing....

February 20, 2024 · 1 min · 142 words · Thomas Evensen

ContentUnavailableView

In macOS 14 and SwiftUI there is a new view ContentUnavailableView to notify the user when there is nothing to show. There are several options for informing and within RsyncUI the view is utlized in combination with filter search. One example is search for records in snapshot: if logrecords.count == 0, selectedconfig != nil, selectedconfig?.task == SharedReference.shared.snapshot, snapshotdata.snapshotlist == false { ContentUnavailableView { Label("There are no snapshot records by this search string in Date or Tag", systemImage: "doc....

February 20, 2024 · 1 min · 93 words · Thomas Evensen

Execution

There are several ways to execute tasks: two double clicks on a task, first is an estimate run and second is the real run select task(s) and either estimate first or execute without estimation for all tasks, estimate first and then execute The following is a brief overview of estimate first and then execute. The difference between an estimation run and a real run is; estimation run is a --dryn-run and there is no logging....

February 20, 2024 · 4 min · 759 words · Thomas Evensen

How to compile RsyncUI

RsyncUI is only depended upon the Swift language and SwiftUI and Foundation frameworks. There are two ways to compile, either in Xcode or utilize make from command line in RsyncUI catalog. To use make require Xcode command line utilities to be installed. Execute the following command and follow the instructions. xcode-select --install Remove signing credentials or replace To compile you have to either remove signing or replace signing credentials. To remove or replace select Target RsyncUI and tab “Signing and Capabilities”....

February 20, 2024 · 1 min · 210 words · Thomas Evensen

Network-attached storage (NAS)

I have been using a server at home as a backup and sharing files for a long time. I have also been very fascinated about ZFS as a filesystem and have commenced using it as part of OpenSolaris many years ago. To make a long story short, the size and cost of my servers have decreased over the years. Last year, 2023, I sold my dedicated server HW and cabinet. On that server, I connected two WD Red Sata SSD discs, 500 GB each, in a mirrored setup by ZFS....

February 20, 2024 · 2 min · 369 words · Thomas Evensen