iOS client for Toshi
Swift Objective-C Other
Clone or download
designatednerd Spring Cleaning: Update to new SwiftLint standards (#873)
* update swiftlint file to new code standards

* prefer `isEmpty` to checking `count` against zero

* disable cyclomatic complexity check on giant web controller method

* fatalErrors should always have a message

* refine swiftlint rules

* convert a bunch of implicitly unwrapped optionals to lazy vars

* delete unused class

* disable implicitly unwrapped optional warnings in tests

* get rid of implicitly unwrapped optionals where possible

* couple more missing messages on fatal errors

* reduce cyclomatic complexity by extracting a few things to methods

* disable cyclomatic complexity inspection where there's not a great way to extract stuff

* rm unused var

* last of the implicitly unwrapped optionals

* break up ginormous switch statement

* break out parameter parsing

* whitespaaaace

* clearer swiftlint on exceptions

* whitespaaace
Latest commit 622208d May 21, 2018
Permalink
Failed to load latest commit information.
.circleci Cleanup CircleCI Configuration (#884) May 7, 2018
Bash Add auto-generated `Localized` with Marathon and Stencil (#787) Mar 20, 2018
Carthage/Build/iOS Carthage update (#898) May 11, 2018
GitHub Update cover with new name (#343) Jun 30, 2017
Pods Xcode 9.3 / Swift 4.1 / CocoaPods 1.5 / Carthage 0.29 (#824) Apr 16, 2018
RevealServer.framework [IOS-266]: Passphrase Sign In (#487) Sep 27, 2017
Tests Spring Cleaning: Update to new SwiftLint standards (#873) May 21, 2018
Tests_UI Spring Cleaning: Update to new SwiftLint standards (#873) May 21, 2018
Toshi.xcodeproj Spring Cleaning: Update to new SwiftLint standards (#873) May 21, 2018
Toshi.xcworkspace Robot test sign in screen 🤖 (#801) Apr 16, 2018
Toshi Spring Cleaning: Update to new SwiftLint standards (#873) May 21, 2018
danger/shared Add SwiftLint to Danger (#774) Mar 15, 2018
.gitignore Fixed CircleCi. Added missing shared target schemes. (#578) Nov 14, 2017
.ruby-version Update ruby version to match ruby version on 9.3 image (#835) Apr 17, 2018
.swiftlint.yml Spring Cleaning: Update to new SwiftLint standards (#873) May 21, 2018
Cartfile Carthage update (#898) May 11, 2018
Cartfile.resolved Carthage update (#898) May 11, 2018
Dangerfile Add Danger configuration. (#391) Jul 28, 2017
Gemfile Add SwiftLint to Danger (#774) Mar 15, 2018
Gemfile.lock Add SwiftLint to Danger (#774) Mar 15, 2018
LICENSE Update license (#851) Apr 25, 2018
Podfile Xcode 9.3 / Swift 4.1 / CocoaPods 1.5 / Carthage 0.29 (#824) Apr 16, 2018
Podfile.lock Xcode 9.3 / Swift 4.1 / CocoaPods 1.5 / Carthage 0.29 (#824) Apr 16, 2018
README.md Update license (#851) Apr 25, 2018
Toshi.entitlements Update apple team, bundle id and entitlements (#465) Sep 2, 2017
installation-guide.md Edit swift lint (#420) Aug 14, 2017

README.md

Token iOS Cover

Running the project

  • Open Toshi.xcworkspace and run

Code formatting

We use SwiftLint and Danger to keep our code consistent and our PR's mergeable.

Check our SwiftLint installation guide to setup SwiftLint.

Code Generation

We're using Marathon and Stencil.

You should install Marathon using the Swift Package Manager (NOTE: If you installed it with Swift 4.0-4.0.3, you will need to reinstall it with 4.1), since installation with Homebrew isn't working correctly. Please use following steps, based on Marathon's SPM instructions, at the command line:

  1. cd into any directory where you would like to check out the Marathon source code. It does not need to be a sub-directory of Toshi (and probably shouldn't be so the Marathon source doesn't get checked in to git).
  2. git clone https://github.com/JohnSundell/Marathon.git - This will check out the source code into the current working directory.
  3. If the swift-4.1 branch of Marathon still hasn't been merged, please also run: git fetch origin swift-4.1 then git checkout swift-4.1 before proceeding to step 4 to use the appropriate branch which will build with Swift 4.1. If the linked PR has been merged, you may skip this step.
  4. cd Marathon - This will put you inside Marathon's main source code folder.
  5. swift build -c release -Xswiftc -static-stdlib - This will build Marathon for release as a static library.
  6. cp -f .build/release/Marathon /usr/local/bin/marathon - This will copy the static library into /usr/local/bin/ so that it can be called from anywhere in the filesystem.

Once this final step is complete, feel free to delete the folder where you checked Marathon out and built it, since you will be relying on the copied compiled binary instead of anything in that folder.

Additionally, there's some weirdness going on with Stencil's test dependencies, so using a Marathonfile results in weird installation issues. In order to actually get Marathon to work for this project, please follow the following steps, IN THIS ORDER:

  1. Remove your macOS user's ~/.marathon folder - this will remove all caches. [NOTE: This folder may not exist if you've never run Marathon before]
  2. run marathon add https://github.com/johnsundell/Files.git
  3. run marathon add https://github.com/johnsundell/shellout.git
  4. run marathon add https://github.com/kylef/Stencil.git
  5. DO NOT use marathon update until the issue with Stencil's dependencies is resolved.

Once you've got Marathon set up, here's what you need to change to cause generated code to update when you build the Debug target:

Changes to File or Folder Cause Marathon To Regenerate File
Resources/Base.lproj/Localizable.strings LocalizedStrings.swift
Resources/Base.lproj/Localizable.stringsdict LocalizedPluralStrings.swift
Resources/Assets.xcassets [recursive] AssetCatalog.swift

If you are making changes in any of these places and do NOT have Marathon installed, you will not be able to use the new assets or strings you're using with our fancy generated helpers. Please install Marathon using the steps above if you want to make changes.


Copyright © 2017-2018 Toshi Holdings Pte. Ltd. <https://www.toshi.org/>

"Toshi" is a registered trade mark. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor.

This program is free software: you can redistribute it and/or modify it under the terms of the version 3 of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.