This application is a command-line application that is used for sorting a list of names in a text file alphabetically and in ascending order based on length.
To download, select the green 'Clone or download' button and click 'Download ZIP'. Once the file has finished downloading, unzip the downloaded file in a convenient, accessible location.
First, ensure that Swift 5 is installed by running the command in the terminal: swift --version.
- Navigate in the terminal to your working copy (the directory that contains the Xcode project).
- Build the application first by running the command:
swift build. - Run the command
swift run TextSorterfollowed by the absolute path of the text file that contains the list of names to be sorted.
To sort the names in a text file called "Unsorted.txt": $ swift run TextSorter /Users/username/Desktop/Unsorted.txt.
To run all tests, navigate in the terminal to your working copy. Run the command in the terminal: swift test.