Technical Design of QuickFileCompare

From Acacia Support Wiki
Jump to navigation Jump to search

SwiftUI

This app is based as much as possible on SwiftUI. This is a great improvement to Apple software development and probably saves 95% of the code required to produce the user interface for an App.

Comparing Files

The foundation library provide simple difference and apply functions that in theory should make an App like this a no-brainer to develop, but the devil is in the detail.

Based on VCS?

Given the built in functions and existing software version tracking systems, the design began based on developing a simple version control system. File A is checked in, then checked out again and replaced with file B. The differences are then extracted and a side-by-side comparison. Simple ... or maybe not!

The difference method can be applied to sets of objects such as [String] or [Character] which results in a list of remove and insert operations that will generate File B when applied to to File A.

It took many iterations to settle on using [String] as the basis of the comparisons. The next step is converting the text in File A into an appropriate array of String values for comparison.