SwipeIt
Getting Started
Run the following two commands to install Xcode's command line tools and bundler, if you don't have that yet.
[sudo] gem install bundler
xcode-select --install
The following commands will clone the repo and install all the required dependencies.
git clone https://github.com/ivanbruel/SwipeIt.git
cd SwipeIt
bundle install
bundle exec pod install
Now you can open SwipeIt.xcworkspace
and Run the SwipeIt
target onto your simulator or iOS device.
You can also run the tests by calling:
bundle exec fastlane ios test
Code style
This project will follow the GitHub Swift Styleguide in every way possible.
In order to enforce this, the project will also have a Swiftlint build phase to run the linter everytime the app is built.
Variable naming conventions will be ignored whenever a RxSwift-based variable is created (as the naming convention of the library is to start it with rx_ (e.g. rx_contentOffset
).
Project Structure
The project follows this folder structure:
SwipeIt
├── App
│ └── AppDelegate
├── Enums
├── Extensions
├── Externals
├── Globals
├── Helpers
├── Models
├── Networking
├── Protocols
├── Resources
│ ├── LaunchScreen.storyboard
│ ├── Localizable.strings
│ └── Info.plist
├── Structs
├── ViewControllers
│ ├── Onboarding
│ │ └── Onboarding.storyboard
│ └── Main
│ └── Main.storyboard
├── ViewModels
└── Views
In order to enforce it to the filesystem we're using Synx to keep the folder structures clean and mirroring the project structure.
Dependencies
Model
- ObjectMapper: Simple JSON Object mapping written in Swift
- DateTools: Dates and times made easy in Objective-C
Functional Reactive Programming
- RxSwift: Reactive Programming in Swift
- NSObject+Rx: Handy RxSwift extensions on NSObject, including rx_disposeBag
- Cell+Rx: Handy RxSwift extensions on UITableViewCell and UICollectionViewCell, including rx_reusableDisposeBag
- RxOptional: RxSwift extensions for Swift optionals and "Occupiable" types
- RxDataSources: Table and Collection View Data Sources for RxSwift
- RxTimer: RxTimer adds RxSwift Timer bindings.
- RxResult: Result bindings for RxSwift.
- RxColor: RxSwift bindings for common UIColor setters
Networking
- Moya: Network abstraction layer written in Swift
- Moya-ObjectMapper: ObjectMapper bindings for Moya and RxSwift
- Result: This is a Swift µframework providing Result
- RxAlamofire: RxSwift wrapper around the elegant HTTP networking in Swift Alamofire
- Kingfisher: A lightweight and pure Swift implemented library for downloading and caching image from the web.
UI
- GPUImage2: GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
- ZLSwipeableViewSwift: A simple view for building card like interface inspired by Tinder and Potluck.
- TTTAttributedLabel: A drop-in replacement for UILabel that supports attributes, data detectors, links, and more
- MarkdownKit: A simple and customizable Markdown Parser for Swift
Utilities
- KeychainSwift: Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS
- Kanna: Kanna is an XML/HTML parser for macOS / iOS / tvOS.
- Device: Light weight tool for detecting the current device and screen size written in swift
- AsyncSwift: Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch
- SnapKit: SnapKit is a DSL to make Auto Layout easy on both iOS and OS X
Environment
- SwiftLint: A tool to enforce Swift style and conventions.
- SwiftGen: A collection of Swift tools to generate Swift code (enums for your assets, storyboards, Localizable.strings, …)
- Fabric: Fabric is a mobile platform with modular kits you can mix and match to build the best apps
- Crashlytics: The most powerful, yet lightest weight crash reporting solution
- Synx: A command-line tool that reorganizes your Xcode project folder to match your Xcode groups
- Fastlane: The easiest way to automate building and releasing your iOS and Android apps
Testing
- Quick: The Swift (and Objective-C) testing framework.
- Nimble: A Matcher Framework for Swift and Objective-C
Continuous Integration
We are using Travis alongside Fastlane to perform continuous integration both by unit testing and deploying to Fabric or iTunes Connect later on.
Environment variables
To make sure Fabric and iTunes can deploy, make sure you have them set to something similar to the following environment variables. The values are only examples!.
Note: For ENV variables to work in Xcode you to set $ defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO
and launch Xcode from the terminal. Apple Developer Forums
Signing
SWIPEIT_SIGNING_IDENTITY_DIST
: iPhone Distribution: Company Name (ID)SWIPEIT_CERTIFICATE_KEY
: The Certificate key used in MatchSWIPEIT_CERTIFICATE_USER
: The username for the git being where Match is saving the Certificates.SWIPEIT_CERTIFICATE_TOKEN
: The access token for the git being where Match is saving the Certificates.SWIPEIT_CERTIFICATE_GIT
: The address or the git being where Match is saving the Certificates. (e.g. https://gitlab.com/username/Certificates)
Fabric deployment
SWIPEIT_FABRIC_CLIENT_ID
: API Key from Fabric OrganizationSWIPEIT_FABRIC_SECRET
: Build Secret from Fabric Organization
iTunes deployment
SWIPEIT_TEAM_ID
: Team ID from iTunes MembershipSWIPEIT_ITUNES_TEAM_ID
: Team ID from iTunes Connect. ($ pilot list
to check the number)SWIPEIT_TEAM_NAME
: Your Company NameSWIPEIT_APPLE_ID
: Your Apple ID (e.g. [email protected])SWIPEIT_ITUNES_PASSWORD
: The password for your Apple ID
Misc
SWIPEIT_SLACK_URL
: https://hooks.slack.com/services/...
Deployment
Although all the deployment is done through Travis, you can do it manually through Fastlane:
Deployment to Fabric
bundle exec fastlane fabric
Deployment to iTunes Connect
bundle exec fastlane itc
Yet another Reddit app
This application is being developed as a side project in an effort to benchmark MVVM vs. MVC architectures, you can read more about it in Medium and in our MVVM vs. MVC README
Contributing
Should anyone want to contribute to this long-term benchmark, feel free to do pull requests, open up issues and even join me on Twitter to discuss the architecture.