• Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 8 years ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Boilerplate for new iOS projects using Swift 5. Provides a handful of functionalities.

Build Status Maintainability Test Coverage License

iOS Base Template

iOS base is a boilerplate project created by Rootstrap for new projects using Swift 5. The main objective is helping any new projects jump start into feature development by providing a handful of functionalities.

Features

This template comes with:

Main

  • Complete API service class to easily communicate with REST services.
  • Examples for account creation and Facebook integration.
  • Useful classes to manage User and Session data.
  • Secure way to store keys of your third party integrations.
  • Generic implementation of navigation between view controllers.
  • Handy helpers and extensions to make your coding experience faster and easier.

Extensions

This App Template also contains other branches with specific features that may be of use to you:

To use them simply download the branch and locally rebase against master/develop from your initial iOS base clone. Important: See steps below on how to install this features.

How to use

  1. Clone repo.
  2. Install desired extensions from their branches.
  3. Run ./init from the recently created folder.
  4. Initialize a new git repo and add your remote url.
  5. Done!

To manage user and session persistence after the original sign in/up we store that information in the native UserDefaults. The parameters that we save are due to the usage of Devise Token Auth for authentication on the server side. Suffice to say that this can be modified to be on par with the server authentication of your choice.

Pods

Main

  • Alamofire for easy and elegant connection with an API.
  • IQKeyboardManagerSwift for auto-scrolling to current input in long views. Note: this pod is not fully working on iOS 11. Here is the issue we encountered and the meantime solution.
  • R.swift for strongly typed and autocompleted assets, segues and more.
  • Firebase for tools to help you build, grow and monetize your app.

Utilities

We have developed other libraries that can be helpful and you could integrate with the dependency manager of your choice.

  • PagedLists: Custom UITableView and UICollectionView classes to easily handle pagination.
  • RSFontSizes: allows you to manage different font sizes for every device screen size in a flexible manner.
  • RSFormView: a library that helps you to build fully customizable forms for data entry in a few minutes.
  • SwiftGradients: Useful extensions for UIViews and CALayer classes to add beautiful color gradients.

Testing

Optional

Mandatory configuration

Firebase

In order for the project to run, you have to follow these steps:

  1. Register your app with Firebase.
  2. Download Firebase configuration file GoogleService-Info.plist from your account.
  3. Add the downloaded file to the /Resources folder.
  4. Done :)

See the Firebase documentation for more information.

Optional configuration

Facebook

  1. In info.plist on the URL types array, find fbXXXXXXXXXXX and replace it for the string "fb" + the ID of your app. i.e: fb435272928934.
  2. Change the FacebookAppID value for the same AppID that you replace above.
  3. Change the FacebookDisplayName value for the name of the app on Facebook.
  4. Done :)

Code Quality Standards

In order to meet the required code quality standards, this project runs SwiftLint during the build phase and reports warnings/errors directly through XCode. The current SwiftLint rule configuration is based on Rootstrap's Swift style guides and is synced with the CodeCliemate's configuration file.

NOTE: Make sure you have SwiftLint version 0.35.0 or greater installed to avoid known false-positives with some of the rules.

Security recommendations

Secrets management

We strongly recommend that all private keys be added to a secrets.xcconfig file that will remain locally and not be committed to your project repo.

Adding new secrets

  1. Add the new environment variable in your system:
    • Optional: For local development, you can run export KEY=value in the terminal. Or you could start with a pre-filled secrets.dev.xcconfig file.
    • In your CI/CD platform, simply add the environment variable with its value to the respective settings section.
  2. Add the new key name to the keys.env file. This could be any other file you use as source for the script mentioned in the next step.
  3. Configure your CI/CD to run:
    • chmod u+x setup-env.sh
    • ./setup-env.sh
  4. Add the key to the Info.plist of your app's target. Example: FacebookKey = ${FACEBOOK_KEY}
  5. Add a new case to the Secret.Key enum. The rawValue must match the key in the Info.plist file
  6. Use it wisely :)

Note: The setup-env script will fill in the secrets.xcconfig for Staging and Release builds. Use secrets.dev.xcconfig for the Debug Build Configuration.

Secure storage

We recommend using AWS S3 for storing .xcconfig files containing all secrets, as well as any other sensitive files. Alternatively when not using Fastlane Match (eg might not be compatible with some CICD systems), AWS S3 can also be used for storing Certificates, Private Keys and Profiles required for app signing. The CICD code examples (described below) make use of the AWS CLI to download any files relevant for our project from a predefined bucket and folder

Another alternative for managing sensitive files whithin the repo using Git-Secret can be found in the feature/git-secret branch

CI/CD configuration with Bitrise (updated on Dec 12th 2021)

We are going to start using a tool called Bitrise to configure de CI/CD pipelines for mobiles apps.

--> For iOS apps you can find how to do it in this link: https://www.notion.so/rootstrap/iOS-CI-CD-01e00409a0144f5b85212bf889c627dd

Automated Build and Deployment using Fastlane (DEPRECATED)

We use Fastlane to automate code signing, building and release to TestFlight.

See details in Fastlane folder.

Continuous Integration / Delivery (DEPRECATED)

We recommend GitHub Actions for integrating Fastlane into a CI/CD pipeline. You can find two workflows in the GitHub workflows folder:

  • ci.yml : triggered on any push and PR, runs unit tests, coverage report and static analysis with CodeClimate
  • release.yml : triggered on push to specific branches, builds, signs and submits to TestFlight

Alternatively you can merge branch feature/jenkins for some equivalent CICD boilerplate with Jenkins.

On both alternatives we assume usage of Fastlane match for managing signing Certificates and Profiles, and AWS S3 for storing other files containing third-party keys

License

iOS-Base is available under the MIT license. See the LICENSE file for more info.

NOTE: Remove the free LICENSE file for private projects or replace it with the corresponding license.

Credits

iOS Base is maintained by Rootstrap with the help of our contributors.

More Repositories

1

yaaf

Easing the form object pattern in Rails applications
Ruby
352
star
2

rails_api_base

API boilerplate project for Ruby on Rails 7
Ruby
346
star
3

active-storage-base64

Base64 support for ActiveStorage
Ruby
148
star
4

htmx-rails

The easiest way to work with HTMX in your Rails app
Ruby
112
star
5

node-ts-api-base

REST API boilerplate made with Express + NodeJS
TypeScript
106
star
6

rails-modular-monolith-with-ddd

Full Modular Monolith Rails application with Domain-Driven Design approach. Inspired by https://github.com/kgrzybek/modular-monolith-with-ddd
96
star
7

activeadmin-chat

ActiveAdmin chat plugin
Ruby
89
star
8

apple_auth

Complete Ruby gem for Sign in with Apple. Actively maintained by rootstrap.com
Ruby
88
star
9

swift-ui-base

SwiftUI base is a boilerplate project created by Rootstrap for new projects using SwiftUI. The main objective is helping any new projects jump start into feature development by providing a handful of functionalities.
Swift
86
star
10

RSFormView

A Cocoapods library designed to easily create forms with multiple data entry fields
Swift
86
star
11

exception_hunter

Crash reporting engine to hunt down bugs 🐞
Ruby
81
star
12

rails_hotwire_base

Rails + Hotwire base app
Ruby
76
star
13

PagedLists

Paginated UITableView and UICollectionViews for iOS.
Swift
71
star
14

react-native-use-styles

A classy approach to manage your react native styles.
JavaScript
65
star
15

tech-guides

Guidelines that document processes and standards followed by our entire organization
64
star
16

react-native-base

React Native-Redux Boilerplate
TypeScript
53
star
17

django-drip-campaigns

💧 Use Django admin to manage drip campaign emails using querysets on Django's User model.
Python
51
star
18

arqo

Easing the query object pattern in Rails applications
Ruby
50
star
19

i18n_linter

Rails i18n Linter Gem
Ruby
44
star
20

NeatTipView

A swift library to easily create and present tips for you user in your iOS app
Swift
43
star
21

ai-job-title-area-classification

Classification of job titles into categories, using different ML techniques
Python
43
star
22

react-native-use-animate

Animations in React native made simple
JavaScript
41
star
23

android-base

Rootstrap Android Base project
Kotlin
39
star
24

validate

An extension to the popular library validate.js that adds some useful custom validations out of the box. Also, a hub for all custom validations, that we have created, so you can easily add them to your own project.
JavaScript
31
star
25

mobx-session

mobx react session managment using localforage
JavaScript
29
star
26

active_outbox

A Transactional Outbox implementation for Rails and ActiveRecord
Ruby
27
star
27

RSFontSizes

RSFontSizes pod repository. Allows you to customize fonts and sizes in different screen sizes.
Swift
27
star
28

ai-job-title-level-classification

Python
24
star
29

rsgem

Rootstrap way ® to generate gems
Ruby
24
star
30

best_buy_ruby

Ruby library for the BestBuy API. https://www.bestbuy.com
Ruby
22
star
31

pull_requests_to_slack

Send Github pull request notifications to Slack
Ruby
21
star
32

SwiftGradients

Useful extensions for UIViews and CALayer classes to add beautiful color gradients.
Swift
18
star
33

redux-tools

Redux tools to speed up development.
JavaScript
16
star
34

airflow-examples

Python
14
star
35

chat-gpt-nodejs

NodeJS REST-API to interact with OpenAI
TypeScript
14
star
36

dolphin-nft-marketplace-frontend

TypeScript
12
star
37

swift-lib-builder

Builder for Cocoapod, Carthage and Swift Package manager libraries in Swift.
Swift
11
star
38

FlowForms

Reactive and declarative Form management library for Kotlin projects
Kotlin
9
star
39

rs-code-review-metrics

Ruby
9
star
40

slack-gpt-base-bot-node

JavaScript
8
star
41

rails_hotwire_playground

Ruby
7
star
42

compress-s3-tinypng

Losslessly compresses and Optimizes PNG and JPG files. Uses TinyPNG API.
Python
6
star
43

gemini-nodejs

NodeJS REST-API to interact with Google Gemini
TypeScript
6
star
44

activeadmin-async_exporter

Async exporter for Active Admin using ActiveJob
Ruby
5
star
45

livy-base

Apache Livy is a service that enables easy interaction with a Spark cluster over a REST interface
Shell
5
star
46

rails_base

Configurable Rails backend generator
Ruby
5
star
47

flutter-base

Dart
5
star
48

web-a11y-demos

JavaScript
5
star
49

apple-sign-in-rails

App for testing apple sign in gem
Ruby
5
star
50

MRI-classifier

Jupyter Notebook
5
star
51

ctakes

cTAKES - instructions and example
Dockerfile
5
star
52

rs-gpt-review

TypeScript
5
star
53

blog

Repository for submitting and reviewing posts for Rootstrap blog
4
star
54

UnicodeEmoji

iOS Library that loads official Unicode Emoji repositories and make them accessible to your app.
Swift
3
star
55

ml-training

Machine Learning tutorials and examples
Jupyter Notebook
3
star
56

swift-unity-integration

Integration of Unity build into an iOS(Swift) project.
C#
3
star
57

biobert-test

Python
3
star
58

hotwire-workshop

Ruby
3
star
59

rubocop-rootstrap

To provide default configuration files for Rubocop and the ability to create custom cops
Ruby
3
star
60

node-ts-api-base-legacy

Base Project for NodeJs + TypeScript Backends
TypeScript
3
star
61

fastai-waste-classifier

Jupyter Notebook
3
star
62

htmx-rails_examples

Ruby
2
star
63

phoenix-target-api

Elixir
2
star
64

nest-target-api

Proof of concept of a nest api project. Trello: https://trello.com/b/4ZrvgNnq/nest-target-api
TypeScript
2
star
65

react-native-peeking-header

React native header that hides when scrolling down and shows when scrolling up.
JavaScript
2
star
66

react-ts-base

react-ts-base
TypeScript
2
star
67

create-rootstrap-react-native-app

TypeScript
2
star
68

yaaf-examples

Rails app with YAAF usage examples
Ruby
2
star
69

courier

A middleware gem for deep links that survive the install process
Ruby
2
star
70

typescript-workshop

2
star
71

django-base

Django boilerplate for rest-api backends
Python
2
star
72

rs-wordle

JavaScript
2
star
73

datasciene-ecommerce

A list of examples/experiments machine learning are provided
Jupyter Notebook
2
star
74

docker-workshop

Materials for internal Docker for Devs workshop
Shell
2
star
75

rails_base_extensions

Add features to your rails project in a simple way!
Ruby
2
star
76

android-base-compose

Kotlin
2
star
77

gangogh

Python
1
star
78

ios-bases-api

API for demo iOS projects.
Ruby
1
star
79

RSRoutingSwift

iOS Routing
Swift
1
star
80

medical-pipeline

Data pipeline for processing medical text records
Python
1
star
81

RSFormViewExample

A RSFormView example showcasing dark mode
Swift
1
star
82

blackmarket-remix-research

TypeScript
1
star
83

react-native-use-toast

React native hook for integrating an extensible/ultra-customizable toast 📬
1
star
84

vue-vs-react

Todo app example made in vuejs and in react
Vue
1
star
85

django-feature-flip

Minimal Django app for feature flipping
Python
1
star
86

coronavirus-analysis

HTML
1
star
87

RSSwiftNetworking

A Swift framework that provides a network communication layer API
Swift
1
star
88

sprinkler-iot

Elixir
1
star
89

rails_admin_s3_file

A rails admin plugin to direct upload assets to s3.
HTML
1
star
90

spinner-playground

Swift
1
star
91

neuro-backyardbrains

train a ML model using data from backyard brains device
Jupyter Notebook
1
star
92

openform-rbac-api

Ruby
1
star
93

rootstrap-ui

Rootstrap's UI Components & Styles
CSS
1
star
94

mmhuman3d-docker

Docker for mmhuman3d - open-mmlab exposing streamlit app
Python
1
star
95

cra-template-base

A template created to generate a new CRA based code base for React projects.
JavaScript
1
star