- Supported OS Versions
- Supported Devices
- Development Tools
- Codesigning
- Dependency Management
- Coding Conventions
- Apple Guidelines
- .gitignore
- Test-Driven Development
- Automated Builds
- Crash Logs
- Best Practices
- Distributing To AppStore
- Useful Links
- iOS 13.*
- iPadOS 13.*
- iOS 12.*
- iOS 11.* (limited support for legacy projects)
- watchOS 5.0+
- tvOS 12.0+
- List of supported devices for iOS 13
- List of supported devices for iPadOS 13
- List of supported devices for iOS 12
- Swift 5.1
- Xcode 11.*
- Homebrew for package management (not MacPorts)
- If you need to manage Ruby environment, prefer rbenv to rvm. System Ruby is OK for iOS development needs, though.
- Never revoke certificates yourself, ask Team Leader to do that if needed.
- Use manual code-signing option in Xcode along with Fastlane to specify pair of code-signing certificate and provisioning profile.
- Follow Provisioning Portal Naming Conventions (profiles, certificates and devices)
- Use match from Fastlane for generating development and distribution certificates as well as provisioning profiles. When generating certificates, specify not empty password, other way you won't be able to open certificate by tools like Knuff.
- Use a single match repo with certificates for one developer account instead of creating repo for each app developed on an account.
Use CocoaPods to add third-party components (frameworks, libraries) to your project. Use frameworks, not static libraries, for dependencies. This is done by calling use_frameworks!
method in Podfile
.
Pods
directory is considered a build artefact, and therefore should be added to .gitignore
.
Podfile.lock
file should be committed to repository, along with .xcworkspace file.
Strictly follow these guidelines:
- AppStore Review Guidelines
- iOS Human Interface Guidelines
- watchOS Human Interface Guidelines
- tvOS Human Interface Guidelines
https://www.gitignore.io/api/swift
Use XCTest for unit tests
Matcher Frameworks:
Dependency injection:
- Use fastlane for app building and submission
- Make schemes shared and commit them to repository
- Before submitting build, all unit tests must pass. If even 1 test is failing, build should also fail
- Stable builds are made in the end of each development cycle (Iteration, Sprint, Milestone etc)
- Access should be given to developers, testers, managers and client team
- Apple's Testflight is preferred service for delivering beta builds
- There should be several types of builds, each of them having specific environment, for example Staging build should work with Staging server, Production build should work with Production server.
- There should be 4 CI jobs per app - one, that automatically runs tests on each pushed commit in every branch, one that compiles staging build when pushed to staging branch, one that makes production build on push to master branch, and one CI job, that refreshes DSYMS for Firebase Crashlytics. The last job should be run daily, all other events should be triggered by push event from git.
Use Firebase Crashlytics for crash logs. Install Fabric/Crashlytics/Firebase and follow the instructions. Fabric and Crashlytics frameworks must be installed via CocoaPods
.
To provide Firebase Crashlytics symbolicated crash logs there should be a dedicated CI job, that runs daily, and uploads DSYMs from iTunesConnect to Firebase. Code to do that can be found on internal swift-snippets repo.
- TRON + Codable for network requests and parsing. If you need more flexible JSON parser, use SwiftyJSON.
- DTTableViewManager and DTCollectionViewManager for working with UITableView and UICollectionView.
- AlamofireImage for working with images
- CoreData for app local database (TBD: links to useful articles, about background context for example)
- EasyMapping for JSON parsing and CoreData - Objective-C
- Use Knuff for testing push notifications.
- Do not store push certificates in repository.
- Use development certificate for debug builds and production certificate for release builds.
- Create app user interface in Interface Builder, using XIBs or Storyboards. Custom UIView creation in a source code files is undesirable. Use tools and frameworks to make your views small and reusable
- Avoid big Storyboards. Split Storyboards into smaller ones. More than 7-8 ViewControllers in one Storyboard are unacceptable. Use Storyboard references in Xcode to refactor large storyboards into small ones.
- Do not let UIViewController subclasses grow to more than 400 lines of code. Always try to keep them simple and short, preferably under 100 lines of code.
- Make sure, that your app works with correct server and API version
- Update your changelog with relevant changes
- Create a tag in repository, that represents your Release
- iOS Dev Weekly - worth to subscribe.
- Erica Sadun blog - Interesting in-depth articles on various Swift topics.
- Swift weekly brief- Weekly updates on Swift development.
- Swift by Sundell - Good educational resource