This is a Mac OS GUI for Syncthing (an open-source, P2P, file syncing software on GitHub), made in Swift.
Interactions with the REST API are following the documentation.
I'm nowhere near experienced in Swift, and this project was intended as a way to learn Mac OS app development. Please excuse my use of the French language in the code, I didn't intend to share the code at first.
This project uses Swift 2.0 syntax. You'll need Xcode 7 to build it.
Open Syncthing GUI.xcworkspace
and build.
Do not use Syncthing GUI.xcodeproj
for building
This project uses Cocoapods to manage librairies, but everything is commited to the git repository, so building should be as easy as pressing "Build" in Xcode after a git pull
.
- Alamofire --- an HTTP networking library
- SwiftyJSON --- a JSON manipulation library
- Syncthing communication system
- Basic folder layout
- Settings panel
- Periodic refresh (1 sec when front window)
- The refresh button on the toolbar
- Path representation for Remote syncthing servers
- "Out of Sync" status (I just didn't implement it)
- File list view
- Periodic refresh in background
Here I'll write the main ideas behind the structure of the code:
- Syncthing objects are in the
SyncthingObject.swift
file. The documentation doesn't provide very accurate descriptions, so (almost) all objects are based on examples from the documentation. - The
RestApi.swift
file handles the REST interactions. It uses one main function that handlesGET
andPOST
requests to interact with Syncthing. They are called by functions that provide a callback function. - For ambiguous classes, variables and functions, I use the following syntax so that Xcode knows how to document the Quick Help :
/**
Description
-parameter parameter1: Description
-returns returnType: Description
*/
func name(parameter1: Type...) -> ReturnType { ... }
- The
CustomStringConvertible
class provides thevar description: String
variable for use with log commands likeNSLog
andprint
.
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).