Skip to content

chiahan1123/iOSSwiftBoilerplate

Repository files navigation

Build Status

iOSSwiftBoilerplate

Lightweight Boilerplate for iOS project in Swift.

Getting Started

  1. Download the project as a ZIP.
  2. This project is setup with Travis CI, you can choose to remove it or keep it.
    • To remove it, remove the following files/directory:
      • .travis.yml
      • iOSSwiftBoilerplate.xcodeproj/xcshareddata/
    • To keep it, make sure you rename all occurences of iOSSwiftBoilerplate to [your_project_name] in the following files:
      • travis.yml
      • iOSSwiftBoilerplate.xcodeproj/xcshareddata/xcschemes/TravisCI.xcscheme
  3. Rename iOSSwiftBoilerplate to [your_project_name].
    1. Before opening the workspace, rename all occurences of iOSSwiftBoilerplate to [your_project_name] in the following files:
      • iOSSwiftBoilerplate.xcodeproj/project.pbxproj
      • iOSSwiftBoilerplate.xcworkspace/contents.xcworkspacedata
    2. Rename all directories and files name:
      • iOSSwiftBoilerplate/ -> [your_project_name]/
      • iOSSwiftBoilerplate.xcodeproj/ -> [your_project_name].xcodeproj/
      • iOSSwiftBoilerplate.xcworkspace/ -> [your_project_name].xcworkspace/
      • iOSSwiftBoilerplateTests/ -> [your_project_name]Tests/
    3. Open the [your_project_name].xcworkspace file with Xcode, rename all occurences of iOSSwiftBoilerplate to [your_project_name] by using the "Find" -> "Find and Replace in Workspace...".
  4. Remove the Pods/ directory and do a pod install to reflect the new project name.
  5. Lastly, build/run the project and you have a clean workspace to start your project!

Note: If your project's scheme name is not changed, close Xcode and remove the [your_project_name].xcodeproj/xcuserdata/ and [your_project_name].xcworkspace/xcuserdata/ directories and reopen the [your_project_name].xcworkspace in Xcode.

Features Out-of-the-Box

  • CocoaPods is integrated to manage dependencies for your project.
  • SwiftLint is setup in the "Run Script". Make sure to follow the "Installation" -> "Using Homebrew" method.
    • You can customize the rules in .swiftlint.yml file. To view all the available rules swiftlint rules.
  • Quick and Nimble is included for more descriptive unit testing.
  • BuildTimeAnalyzer-for-Xcode is configured in the Debug build configuration. You can install this tool to profile the build time of your project. (Note: Make sure you create a scheme with Release build configuration when releasing.)

Project Structure

  • Resources: Global constants that are referenced throughout the project such as colors, dimensions, and configurations. Class specific constants should not be stored here to avoid huge constant file.
  • Helpers: Helper extensions for existing classes, helper/utility classes.
  • Models: Model classes.
  • Views: Custom views and its corresponding XIB files is applicable.
  • Controllers: View controller classes.
  • Support Files: Localization strings and other miscellaneous files (eg. BridgeHeader.h).

Third-Party Libraries

The following is a list of existing third-party libraries.

To add your own third-party library dependencies, simply add it in the Podfile.

TODOs

  • Add a script to easily change iOSSwiftBoilerplate name to any given name

About

Lightweight Boilerplate for iOS project in Swift.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published