π¦
π
SwiftyPick
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects.
Purpose
The idea behind this project is not to be a pod
that users import into their own projects, but rather a collection of useful ideas, well-organized and documented, to cherry-pick as needed into another projects. Every new piece of functionality will have a proper document explaining it's usage under the Documentation
directory.
Installation
SwiftLint
brew install swiftlint
Configure the Git Hooks
git config core.hooksPath .githooks
CocoaPods
Run
pod install
on the root of the project
Open SwiftyPick.xcworkspace
with Xcode
π
Features Code
Extensions
- Add support for multiple Color Palettes: Easily handle multiple color palettes in your app.
- AutoLayout helper methods: Lightweight classes for declarative auto layout.
Features
- SwiftGen: Get autogenerated instances of colors, images, and localized strings.
Networking
// TODO //
Testing
- Xcode Test Plans: Configure different test plans in your project in order to test different configurations.
UI
// TODO //
Process
Danger
- Danger: Configure Danger and add a Github Action to run the script on every PR.
Documentation
- Jazzy: Configure Jazzy to get autogenerated
html
files for documentation.
Fastlane
- Fastlane: Configure Fastlane in your project and add a Github Action to run the tests on every PR to
main
. - Run Test Plans on Fastlane: Configure your fastfile to run different test plans.
Github
- Set up PR and Issue templates: How to add a Pull Request or Issue template to your project.
- Github Actions: How to add a Github Actions and make them run on Pull Requests.
SwiftLint
- SwiftLint: How to add and configure SwiftLint rules.
Scripts
- Sort Project files alphabetically: Keep the Xcode project files sorted alphabetically and avoid conflicts in the
.pbxproj
file.
TODOs
This is the list of things I want to add to the project in the near future:
- Logger: Object to log useful information to the console (and to report to analytics/crashlytics)
- NumberFormatter + Regional unit tests (ie: check the
,
or.
separator for decimals/thousands depending on the region) - CurrencyFormatter + Regional unit tests
- DateFormatter + Regional unit tests
- Lightweight
URLSession
networking layer - Dynamic Fonts (For accessibility)
- UITests layer using Page Object pattern
- Schemes (prod/dev)
- UserDefaults easy access / FeatureFlags using UserDefaults
- UIView extension with some basic animations
- UITableViewCell/UICollectionViewCell extension for
register
,dequeue
, andcellReuseIdentifier
- Firebase integration (Analytics/Crashlytics/AB Testing/Flags)
- Custom Operators from the
Advanced Swift
book - GraphQL support
- A tableview in the home, where each cell will be the entry point to each feature (ie: color palettes, networking call via http, networking via graphQL, UI components, animations, formatters, etc)
- Settings view: dark mode, color palette, app icon, local feature flags, display backend calls for debug, change accessibility features, etc
Contributing
Check out the Contribution guide