Skip to content

Commit d29f3fa

Browse files
author
Aarif Sumra
committed
Initial Commit
0 parents  commit d29f3fa

File tree

127 files changed

+6883
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+6883
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ios-template
2+
3+
An iOS project template to kickstart your project with CleanArchitecture with MVVM+Coordinator.
4+
5+
### Prerequisites:
6+
* [Cookiecutter](https://cookiecutter.readthedocs.io/en/latest/installation.html)
7+
8+
Install cookiecutter by runing below terminal command.
9+
10+
```
11+
brew install cookiecutter
12+
```
13+
14+
The project is using cocoapods for managing external libraries and a Gemfile for managing the cocoapods version.
15+
16+
## Usage
17+
18+
The project template uses Cookiecutter to create your project from it. Run below command to create your project from this template:
19+
20+
```
21+
cookiecutter gh:monstar-lab-oss/ios-template
22+
```
23+
24+
Give your desire app name then your company name. Thats it, you should be able to see your app directory created based on this template!

cookiecutter.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"app_name": "AwesomeApp",
3+
"company_name": "Monstar-Lab Inc.",
4+
"bundle_identifier": "com.monstar-lab.ios.template",
5+
"lead_dev_name": "Your Name",
6+
"domain_model": "ToDo"
7+
}

hooks/post_gen_project.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Initialize Git
6+
git init
7+
8+
# Install required gems
9+
bundle install --path vendor/bundle
10+
11+
# Install pods
12+
bundle exec pod install
13+

hooks/pre_gen_project.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import re
2+
import sys
3+
4+
5+
APPNAME_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
6+
7+
app_name = '{{ cookiecutter.app_name }}'
8+
9+
if not re.match(APPNAME_REGEX, app_name):
10+
print('ERROR: %s is not a valid App Name! \n Please enter alpha-numeric app name...' % app_name)
11+
sys.exit(1)

{{cookiecutter.app_name}}/.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
### Swift ###
2+
# Xcode
3+
#
4+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
5+
6+
## Build generated
7+
build/
8+
DerivedData/
9+
10+
## Various settings
11+
*.pbxuser
12+
!default.pbxuser
13+
*.mode1v3
14+
!default.mode1v3
15+
*.mode2v3
16+
!default.mode2v3
17+
*.perspectivev3
18+
!default.perspectivev3
19+
xcuserdata/
20+
21+
## Other
22+
*.moved-aside
23+
*.xccheckout
24+
*.xcscmblueprint
25+
26+
## Obj-C/Swift specific
27+
*.hmap
28+
*.ipa
29+
*.dSYM.zip
30+
*.dSYM
31+
32+
## Playgrounds
33+
timeline.xctimeline
34+
playground.xcworkspace
35+
36+
# Swift Package Manager
37+
#
38+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
39+
# Packages/
40+
# Package.pins
41+
.build/
42+
43+
# CocoaPods
44+
#
45+
# We recommend against adding the Pods directory to your .gitignore. However
46+
# you should judge for yourself, the pros and cons are mentioned at:
47+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
48+
#
49+
Pods/
50+
51+
# Carthage
52+
#
53+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
54+
Carthage/Checkouts
55+
Carthage/Build
56+
57+
# fastlane
58+
#
59+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
60+
# screenshots whenever they are needed.
61+
# For more information about the recommended setup visit:
62+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
63+
64+
fastlane/report.xml
65+
fastlane/Preview.html
66+
fastlane/screenshots
67+
fastlane/README.md
68+
fastlane/test_output
69+
*.ipa
70+
*.app.dSYM.zip
71+
72+
# Bundler
73+
.bundle
74+
vendor/bundle
75+
*.coverage.txt
76+
swiftlint-report.json
77+
78+
79+
# R.Swift
80+
#
81+
# Add the *.generated.swift pattern to your .gitignore file to prevent unnecessary conflicts.
82+
*.generated.swift
83+
84+
.DS_Store
85+
86+
node_modules/
87+
contents.xcworkspacedata
88+
IDEWorkspaceChecks.plist
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
opt_in_rules: # some rules are only opt-in
2+
- colon
3+
- comma
4+
- control_statement
5+
- empty_count
6+
- empty_string
7+
- fatal_error_message
8+
- first_where
9+
- modifier_order
10+
- overridden_super_call
11+
- private_action
12+
- private_outlet
13+
- todo
14+
- toggle_bool
15+
- unused_private_declaration
16+
17+
excluded: # paths to ignore during linting. Takes precedence over `included`.
18+
- Pods/
19+
- Carthage/
20+
- {{cookiecutter.app_name}}/Resources
21+
22+
file_length:
23+
warning: 400
24+
error: 600
25+
26+
line_length:
27+
warning: 180
28+
error: 250
29+
30+
type_body_length:
31+
- 300 # warning
32+
- 400 # error
33+
34+
large_tuple: # warn user when using 3 values in tuple, give error if there are 4
35+
- 3
36+
- 4
37+
38+
nesting:
39+
type_level: 3
40+
statement_level: 7
41+
42+
type_name:
43+
min_length: 3 # only warning
44+
max_length: # warning and error
45+
warning: 40
46+
error: 45
47+
48+
identifier_name:
49+
min_length: # only min_length
50+
error: 2 # only error
51+
excluded: # excluded via string array
52+
- id
53+
- vc
54+
55+
function_parameter_count:
56+
warning: 8
57+
error: 15
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// Domain.h
3+
// Domain
4+
//
5+
// Created by {{cookiecutter.lead_dev_name}} on {% now 'local' %}.
6+
// Copyright © {% now 'local', '%Y' %} {{cookiecutter.company_name}} All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
//! Project version number for Domain.
12+
FOUNDATION_EXPORT double DomainVersionNumber;
13+
14+
//! Project version string for Domain.
15+
FOUNDATION_EXPORT const unsigned char DomainVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <Domain/PublicHeader.h>
18+
19+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// {{cookiecutter.domain_model}}.swift
3+
// Domain
4+
//
5+
// Created by {{cookiecutter.lead_dev_name}} on {% now 'local' %}.
6+
// Copyright © {% now 'local', '%Y' %} {{cookiecutter.company_name}} All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
public struct {{cookiecutter.domain_model}}: Codable {
12+
// Required
13+
public let id: Int
14+
public let title: String
15+
// Optionals
16+
public private(set) var status: String?
17+
18+
public init(id: Int, title: String, status: String? = nil) {
19+
self.id = id
20+
self.title = title
21+
self.status = status
22+
}
23+
}
24+
25+
extension {{cookiecutter.domain_model}}: Hashable {
26+
public static func == (lhs: {{cookiecutter.domain_model}}, rhs: {{cookiecutter.domain_model}}) -> Bool {
27+
return lhs.id == rhs.id // For now id comparision is enough
28+
}
29+
30+
public func hash(into hasher: inout Hasher) {
31+
hasher.combine(id)
32+
}
33+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
</dict>
22+
</plist>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// UseCaseProvider.swift
3+
// Domain
4+
//
5+
// Created by {{cookiecutter.lead_dev_name}} on {% now 'local' %}.
6+
// Copyright © {% now 'local', '%Y' %} {{cookiecutter.company_name}} All rights reserved.
7+
//
8+
9+
public protocol UseCaseProvider {
10+
func make{{cookiecutter.domain_model}}sUseCase() -> {{cookiecutter.domain_model}}sUseCase
11+
}

0 commit comments

Comments
 (0)