diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..49bfdb19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,9 @@ +## Bug report + +Provide a brief summary of your issue **AND** if reporting a build issue include the version/build number. + +## Feature request + +Provide a brief summary of the new feature required. + +**Please note by far the quickest way to get a new feature is to file a Pull Request.** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..df7630f9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +https://github.com/nimbl3/ios-templates/issues/ + +## What happened + +Describe the big picture of your changes here to communicate to the team why we should accept this pull request. + +## Insight + +Describe in details how to test the changes; referenced documentation is welcome as well. + +## Proof Of Work + +Show us the implementation: screenshots, gif, etc. diff --git a/.gitignore b/.gitignore index d5340449..20073640 100644 --- a/.gitignore +++ b/.gitignore @@ -1,67 +1,33 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Cookie cutter +# to ignore any cookie cutter generated files and directories + +cookiecutter.json +{{ cookiecutter.* diff --git a/LICENSE b/LICENSE index fef9df3a..0d68d50b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Nimbl3 +Copyright (c) 2020 Nimble Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Nimble Templates/App.xctemplate/TemplateIcon.png b/Nimble Templates/App.xctemplate/TemplateIcon.png new file mode 100644 index 00000000..79d7ba45 Binary files /dev/null and b/Nimble Templates/App.xctemplate/TemplateIcon.png differ diff --git a/Nimble Templates/App.xctemplate/TemplateIcon@2x.png b/Nimble Templates/App.xctemplate/TemplateIcon@2x.png new file mode 100644 index 00000000..3762377b Binary files /dev/null and b/Nimble Templates/App.xctemplate/TemplateIcon@2x.png differ diff --git a/Nimble Templates/App.xctemplate/TemplateInfo.plist b/Nimble Templates/App.xctemplate/TemplateInfo.plist new file mode 100644 index 00000000..d9326851 --- /dev/null +++ b/Nimble Templates/App.xctemplate/TemplateInfo.plist @@ -0,0 +1,415 @@ + + + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + co.nimblehq.dt.unit.singleViewApplication + Ancestors + + co.nimble.dt.unit.cocoaTouchApplicationBase + + Concrete + + Description + This template provides a starting point for an application that uses a single view. + SortOrder + 1 + Project + + Configurations + + Dev Staging + + ONLY_ACTIVE_ARCH + YES + ENABLE_NS_ASSERTIONS + YES + GCC_PREPROCESSOR_DEFINITIONS + DEBUG=1 STAGING=1 $(inherited) + ENABLE_TESTABILITY + YES + SWIFT_ACTIVE_COMPILATION_CONDITIONS + + DEBUG + STAGING + + DEBUG_INFORMATION_FORMAT + dwarf + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___.staging + PRODUCT_NAME + $(TARGET_NAME) Staging + ENABLE_BITCODE + NO + + Staging + + ENABLE_NS_ASSERTIONS + NO + GCC_PREPROCESSOR_DEFINITIONS + STAGING=1 $(inherited) + GCC_OPTIMIZATION_LEVEL + 0 + SWIFT_COMPILATION_MODE + wholemodule + SWIFT_OPTIMIZATION_LEVEL + -Onone + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + SWIFT_ACTIVE_COMPILATION_CONDITIONS + STAGING + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___.staging + PRODUCT_NAME + $(TARGET_NAME) Staging + ENABLE_BITCODE + NO + + Dev UAT + + ONLY_ACTIVE_ARCH + YES + ENABLE_NS_ASSERTIONS + YES + GCC_PREPROCESSOR_DEFINITIONS + DEBUG=1 UAT=1 $(inherited) + ENABLE_TESTABILITY + YES + GCC_DYNAMIC_NO_PIC + NO + SWIFT_ACTIVE_COMPILATION_CONDITIONS + + DEBUG + UAT + + DEBUG_INFORMATION_FORMAT + dwarf + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___.uat + PRODUCT_NAME + $(TARGET_NAME) UAT + ENABLE_BITCODE + NO + + UAT + + ENABLE_NS_ASSERTIONS + YES + GCC_PREPROCESSOR_DEFINITIONS + UAT=1 $(inherited) + ENABLE_TESTABILITY + YES + SWIFT_ACTIVE_COMPILATION_CONDITIONS + UAT + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___.uat + PRODUCT_NAME + $(TARGET_NAME) UAT + ENABLE_BITCODE + NO + + Dev Production + + ONLY_ACTIVE_ARCH + YES + GCC_PREPROCESSOR_DEFINITIONS + DEBUG=1 PRODUCTION=1 $(inherited) + ENABLE_TESTABILITY + YES + GCC_DYNAMIC_NO_PIC + NO + SWIFT_ACTIVE_COMPILATION_CONDITIONS + + DEBUG + PRODUCTION + + DEBUG_INFORMATION_FORMAT + dwarf + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___ + PRODUCT_NAME + $(TARGET_NAME) + ENABLE_BITCODE + NO + + Production + + ENABLE_NS_ASSERTIONS + NO + GCC_PREPROCESSOR_DEFINITIONS + PRODUCTION=1 $(inherited) + GCC_OPTIMIZATION_LEVEL + 0 + SWIFT_COMPILATION_MODE + wholemodule + SWIFT_OPTIMIZATION_LEVEL + -Onone + SWIFT_ACTIVE_COMPILATION_CONDITIONS + PRODUCTION + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + PRODUCT_BUNDLE_IDENTIFIER + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___ + PRODUCT_NAME + $(TARGET_NAME) + ENABLE_BITCODE + YES + + + + Targets + + + Name + ___PACKAGENAME___ + SharedSettings + + SWIFT_VERSION + 5.0 + + + + Options + + + Default + Swift + Identifier + languageChoice + Units + + Objective-C + + Nodes + + ViewController.h:comments + ViewController.h:imports:importCocoa + ViewController.h:interface(___FILEBASENAME___ : UIViewController) + ViewController.m:comments + ViewController.m:imports:importHeader:ViewController.h + ViewController.m:extension + ViewController.m:implementation:methods:viewDidLoad(- (void\)viewDidLoad) + ViewController.m:implementation:methods:viewDidLoad:super + Info.plist:UIApplicationSceneManifest:UISceneStoryboardFile + + + Swift + + + RequiredOptions + + userInterface + Programmatically + + Nodes + + Application/AppDelegate/Application.AppDelegate.swift + Application/Constants/Constants.swift + Application/Entitlements/Entitlements.swift + Application/Localizations/Localizations.swift + Application/Resources/Resource.swift + Extensions/Extensions.swift + Models/Models.swift + Modules/Modules.swift + Protocols/Protocols.swift + Services/Services.swift + Utilities/Utilities.swift + Views/View.swift + Info.plist:UIApplicationSceneManifest:UISceneStoryboardFile + + Definitions + + Application/AppDelegate/Application.AppDelegate.swift + + Group + + Application + AppDelegate + + + Application/Constants/Constants.swift + + Group + + Application + Constants + + + Application/Entitlements/Entitlements.swift + + Group + + Application + Entitlements + + + Application/Localizations/Localizations.swift + + Group + + Application + Localizations + + + Application/Resources/Resource.swift + + Group + + Application + Resources + + + Extensions/Extensions.swift + + Group + Extensions + + Models/Models.swift + + Group + Models + + Modules/Modules.swift + + Group + Modules + + Protocols/Protocols.swift + + Group + Protocols + + Services/Services.swift + + Group + Services + + Utilities/Utilities.swift + + Group + Utilities + + Views/View.swift + + Group + Views + + + + + RequiredOptions + + userInterface + SwiftUI + appLifecycle + Cocoa + + Nodes + + Preview Content/Preview Assets.xcassets + SceneDelegate.swift:imports:importSwiftUI + SceneDelegate.swift:implementation:methods:sceneWillConnectToSession:body + SceneDelegate.swift:implementation:methods:sceneWillConnectToSession:body:windowScene + + Definitions + + SceneDelegate.swift:implementation:methods:sceneWillConnectToSession:body + +// Create the SwiftUI view that provides the window contents. +let contentView = ContentView() + + SceneDelegate.swift:implementation:methods:sceneWillConnectToSession:body:windowScene + +// Use a UIHostingController as window root view controller. +if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() +} + + *:imports:importSwiftUI + import SwiftUI + + Targets + + + SharedSettings + + ENABLE_PREVIEWS + YES + DEVELOPMENT_ASSET_PATHS + ___PACKAGENAMEPREVIEWCONTENT:quoteIfNeeded___ + + + + + + + + + Identifier + userInterface + Name + Interface: + Description + The type of user interface. + Values + + SwiftUI + Programmatically + + Default + Programmatically + Type + popup + + + Definitions + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + + TargetIndices + + Group + + Removable Resources + + Path + ___PACKAGENAME___.xcscheme + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___ Staging.xcscheme + + TargetIndices + + Group + + Removable Resources + + Path + ___PACKAGENAME___ Staging.xcscheme + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___ UAT.xcscheme + + TargetIndices + + Group + + Removable Resources + + Path + ___PACKAGENAME___ UAT.xcscheme + + + Nodes + + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___ Staging.xcscheme + ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___ UAT.xcscheme + + + diff --git a/Nimble Templates/App.xctemplate/___PACKAGENAME___ Staging.xcscheme b/Nimble Templates/App.xctemplate/___PACKAGENAME___ Staging.xcscheme new file mode 100644 index 00000000..40495703 --- /dev/null +++ b/Nimble Templates/App.xctemplate/___PACKAGENAME___ Staging.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Nimble Templates/App.xctemplate/___PACKAGENAME___ UAT.xcscheme b/Nimble Templates/App.xctemplate/___PACKAGENAME___ UAT.xcscheme new file mode 100644 index 00000000..fe172404 --- /dev/null +++ b/Nimble Templates/App.xctemplate/___PACKAGENAME___ UAT.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Nimble Templates/App.xctemplate/___PACKAGENAME___.xcscheme b/Nimble Templates/App.xctemplate/___PACKAGENAME___.xcscheme new file mode 100644 index 00000000..f1a6efab --- /dev/null +++ b/Nimble Templates/App.xctemplate/___PACKAGENAME___.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/AccentColor.colorset/Contents.json b/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/Contents.json b/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Nimble Templates/Cocoa Touch App Base.xctemplate/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nimble Templates/Cocoa Touch App Base.xctemplate/LaunchScreen.storyboard b/Nimble Templates/Cocoa Touch App Base.xctemplate/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Nimble Templates/Cocoa Touch App Base.xctemplate/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Nimble Templates/Cocoa Touch App Base.xctemplate/TemplateInfo.plist b/Nimble Templates/Cocoa Touch App Base.xctemplate/TemplateInfo.plist new file mode 100644 index 00000000..cf9dfc47 --- /dev/null +++ b/Nimble Templates/Cocoa Touch App Base.xctemplate/TemplateInfo.plist @@ -0,0 +1,282 @@ + + + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + co.nimble.dt.unit.cocoaTouchApplicationBase + Ancestors + + com.apple.dt.unit.applicationBase + com.apple.dt.unit.iosBase + com.apple.dt.unit.languageChoice.app.iOS + com.apple.dt.unit.appLifecycle.iOS + + Targets + + + TargetIdentifier + com.apple.dt.cocoaTouchApplicationTarget + SharedSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME + AccentColor + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + TARGETED_DEVICE_FAMILY + 1,2 + + + + Options + + + Identifier + hasUnitAndUITests + Name + Include Tests + NotPersisted + + SortOrder + 300 + Type + checkbox + Default + true + Units + + true + + Components + + + Identifier + com.apple.dt.unit.cocoaTouchApplicationUnitTestBundle + Name + UnitTests + + + Identifier + com.apple.dt.unit.cocoaTouchApplicationUITestBundle + Name + UITests + + + + + + + Identifier + languageChoice + Units + + Objective-C + + Nodes + + main.m:comments + main.m:imports:importCocoa + main.m:imports:importHeader:AppDelegate.h + main.m:main:UIApplicationMain + AppDelegate.h:comments + AppDelegate.h:imports:importCocoa + AppDelegate.h:interface(AppDelegate : UIResponder <UIApplicationDelegate>) + AppDelegate.h:interface:window + AppDelegate.m:comments + AppDelegate.m:imports:importHeader:AppDelegate.h + AppDelegate.m:extension + AppDelegate.m:implementation:synthesize + AppDelegate.m:implementation:methods:applicationdidFinishLaunchingWithOptions(- (BOOL\)application:(UIApplication *\)application didFinishLaunchingWithOptions:(NSDictionary *\)launchOptions) + AppDelegate.m:implementation:methods:applicationdidFinishLaunchingWithOptions:body + AppDelegate.m:implementation:methods:applicationdidFinishLaunchingWithOptions:return + AppDelegate.m:implementation:methods:applicationWillResignActive(- (void\)applicationWillResignActive:(UIApplication *\)application) + AppDelegate.m:implementation:methods:applicationWillResignActive:comments + AppDelegate.m:implementation:methods:applicationDidEnterBackground(- (void\)applicationDidEnterBackground:(UIApplication *\)application) + AppDelegate.m:implementation:methods:applicationDidEnterBackground:comments + AppDelegate.m:implementation:methods:applicationWillEnterForeground(- (void\)applicationWillEnterForeground:(UIApplication *\)application) + AppDelegate.m:implementation:methods:applicationWillEnterForeground:comments + AppDelegate.m:implementation:methods:applicationDidBecomeActive(- (void\)applicationDidBecomeActive:(UIApplication *\)application) + AppDelegate.m:implementation:methods:applicationDidBecomeActive:comments + + Definitions + + main.m:main + + Beginning + int main(int argc, char * argv[]) { + End + } + Indent + 1 + + main.m:main:UIApplicationMain + NSString * appDelegateClassName; +@autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); +} +return UIApplicationMain(argc, argv, nil, appDelegateClassName); + + AppDelegate.h:interface:window + @property (strong, nonatomic) UIWindow *window; + + AppDelegate.m:implementation:methods:applicationdidFinishLaunchingWithOptions:body + // Override point for customization after application launch. + AppDelegate.m:implementation:methods:applicationdidFinishLaunchingWithOptions:return + return YES; + *:implementation:methods:viewDidLoad:super + [super viewDidLoad]; +// Do any additional setup after loading the view. + + + Swift + + RequiredOptions + + appLifecycle + Cocoa + + Nodes + + AppDelegate.swift:comments + AppDelegate.swift:imports:importCocoa + AppDelegate.swift:UIApplicationMain + AppDelegate.swift:implementation(AppDelegate: UIResponder, UIApplicationDelegate) + AppDelegate.swift:implementation:properties:window + AppDelegate.swift:implementation:methods:applicationdidFinishLaunchingWithOptions(func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\) -> Bool) + AppDelegate.swift:implementation:methods:applicationdidFinishLaunchingWithOptions:body + AppDelegate.swift:implementation:methods:applicationdidFinishLaunchingWithOptions:return + AppDelegate.swift:implementation:methods:applicationWillResignActive(func applicationWillResignActive(_ application: UIApplication\)) + AppDelegate.swift:implementation:methods:applicationWillResignActive:comments + AppDelegate.swift:implementation:methods:applicationDidEnterBackground(func applicationDidEnterBackground(_ application: UIApplication\)) + AppDelegate.swift:implementation:methods:applicationDidEnterBackground:comments + AppDelegate.swift:implementation:methods:applicationWillEnterForeground(func applicationWillEnterForeground(_ application: UIApplication\)) + AppDelegate.swift:implementation:methods:applicationWillEnterForeground:comments + AppDelegate.swift:implementation:methods:applicationDidBecomeActive(func applicationDidBecomeActive(_ application: UIApplication\)) + AppDelegate.swift:implementation:methods:applicationDidBecomeActive:comments + + Definitions + + AppDelegate.swift:UIApplicationMain + @main + AppDelegate.swift:implementation:properties:window + var window: UIWindow? + AppDelegate.swift:implementation:methods:applicationdidFinishLaunchingWithOptions:body + // Override point for customization after application launch. + AppDelegate.swift:implementation:methods:applicationdidFinishLaunchingWithOptions:return + return true + *:implementation:methods:viewDidLoad:super + super.viewDidLoad() +// Do any additional setup after loading the view. + + + + + + Identifier + appLifecycle + Units + + Cocoa + + Nodes + + Info.plist:LaunchScreen + Base.lproj/LaunchScreen.storyboard + + + + + + Nodes + + Info.plist:iPhone + Info.plist:UIRequiredDeviceCapabilities:base + Info.plist:UISupportedInterfaceOrientations~iPhone + Info.plist:UISupportedInterfaceOrientations~iPad + Info.plist:UIApplicationSupportsIndirectInputEvents + Assets.xcassets + + Definitions + + Info.plist:iPhone + <key>LSRequiresIPhoneOS</key> +<true/> + + Info.plist:UIRequiredDeviceCapabilities + + Beginning + <key>UIRequiredDeviceCapabilities</key> +<array> + End + </array> + Indent + 1 + + Info.plist:UIRequiredDeviceCapabilities:base + <string>armv7</string> + Info.plist:statusBarTintForNavBar + <key>UIStatusBarTintParameters</key> +<dict> + <key>UINavigationBar</key> + <dict> + <key>Style</key> + <string>UIBarStyleDefault</string> + <key>Translucent</key> + <false/> + </dict> +</dict> + + Info.plist:UIApplicationSupportsIndirectInputEvents + <key>UIApplicationSupportsIndirectInputEvents</key> +<true/> + + Info.plist:LaunchScreen + <key>UILaunchStoryboardName</key> +<string>LaunchScreen</string> + + Assets.xcassets + + Path + Assets.xcassets + AssetGeneration + + + Type + appicon + Name + AppIcon + Platforms + + iOS + true + + + + SortOrder + 100 + + Base.lproj/LaunchScreen.storyboard + + Path + LaunchScreen.storyboard + SortOrder + 101 + + *:implementation:methods:applicationWillResignActive:comments + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. +// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + + *:implementation:methods:applicationDidEnterBackground:comments + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + + *:implementation:methods:applicationWillEnterForeground:comments + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + *:implementation:methods:applicationDidBecomeActive:comments + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + + + diff --git a/README.md b/README.md index 568f37ba..412017f0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,89 @@ # ios-template -Our optimized iOS template used in our projects +Our optimized iOS template used in our projects using Xcode Templates + +## Requirements + +Xcode 12.0 + +## Usage + +Add Nimble's templates by placing them in the folder `~/Library/Developer/Xcode/Templates/` by running this script + +```sh +$ bash install.sh +``` + +## Wiki + +1. [Standard File Organization](https://github.com/nimblehq/ios-templates/wiki/Standard-file-organization) +2. [Project Configurations](https://github.com/nimblehq/ios-templates/wiki/Project-configurations) + +## Known Issues + +### Configurations + +After creating project with this template, when we go to Project's Info tab, there are two default configurations: + +- `Debug` +- `Release` + +What you have to do is close and reopen project with Xcode. This time you can reveal all 6 custom configurations and 2 default configurations. + + + +Because you will not use the default configutations (`Debug` and `Release`) any more. So we should manually remove them. Open `Project` > Tab `Info` and remove unecessary configuration. + +- `Dev Staging` +- `Staging` +- `Dev UAT` +- `UAT` +- `Dev Production` +- `Production` + + + +One more thing there are some duplicated build settings stored in the file `project.pbxproj`. Some of them are automatically initialized and some are customized. For an instance, the build setting `PRODUCT_BUNDLE_IDENTIFIER` for `Dev Staging` is duplicated. + +| Default | Custom | +|---|---| +| | | + +What we should do is to remove all duplicated settings for all build configurations. + +The following list is the default initialized settings that you should remove: + +- `PRODUCT_BUNDLE_IDENTIFIER` +- `PRODUCT_NAME` + +> Note: +> +> - Check the `Debug`/`Release` build configurations are completely remove out of the file `project.pbxproj` + +### Schemes + +After you initialize the project with this template, you should do two following steps to fulfill the scheme's settings: + +- Firstly, fill blueprint identifiers with the associated targets' UUID. +- Secondly, remove the folder `Removable Resources`. + +Open files `*.xscheme` in `{{ProjectName}}.xcodeproj/xshareddata/xschemes/`. As you can see, the `BlueprintIdentifier` fields are left with empty value. + + + +Let's take a look into `project.pbxproj`, there are 3 targets defined with their UUID: + +- `{{ProjectName}}` +- `UnitTests` +- `UITests` + + + +So as to specify right the target for scheme to run: + +- Fill the target `UnitTests`'s UUID for the TestAction Unit Tests +- Fill the target `UITests`'s UUID for the TestAction UI Tests +- Fill the target `{{ProjectName}}`'s UUID for the others + +The last step is to remove the red named folder `Removable Resources`. + + diff --git a/images/project-config/default-build-configurations.png b/images/project-config/default-build-configurations.png new file mode 100644 index 00000000..e82d49ca Binary files /dev/null and b/images/project-config/default-build-configurations.png differ diff --git a/images/project-config/default-configurations.png b/images/project-config/default-configurations.png new file mode 100644 index 00000000..e273709e Binary files /dev/null and b/images/project-config/default-configurations.png differ diff --git a/images/project-config/default-custom-flags.png b/images/project-config/default-custom-flags.png new file mode 100644 index 00000000..5ec5daf3 Binary files /dev/null and b/images/project-config/default-custom-flags.png differ diff --git a/images/project-config/default-dsym.png b/images/project-config/default-dsym.png new file mode 100644 index 00000000..3dd4f86f Binary files /dev/null and b/images/project-config/default-dsym.png differ diff --git a/images/readme/configuration_custom-attributes.png b/images/readme/configuration_custom-attributes.png new file mode 100644 index 00000000..2a90fd9a Binary files /dev/null and b/images/readme/configuration_custom-attributes.png differ diff --git a/images/readme/configuration_default-attributes.png b/images/readme/configuration_default-attributes.png new file mode 100644 index 00000000..f86a300f Binary files /dev/null and b/images/readme/configuration_default-attributes.png differ diff --git a/images/readme/configuration_result.png b/images/readme/configuration_result.png new file mode 100644 index 00000000..89fa4b2f Binary files /dev/null and b/images/readme/configuration_result.png differ diff --git a/images/readme/configurations_remove-default-configurations.png b/images/readme/configurations_remove-default-configurations.png new file mode 100644 index 00000000..0bb83bd3 Binary files /dev/null and b/images/readme/configurations_remove-default-configurations.png differ diff --git a/images/readme/scheme_add-targets-uuid-to-blueprint-identifier.png b/images/readme/scheme_add-targets-uuid-to-blueprint-identifier.png new file mode 100644 index 00000000..13bc2727 Binary files /dev/null and b/images/readme/scheme_add-targets-uuid-to-blueprint-identifier.png differ diff --git a/images/readme/scheme_remove-folder.png b/images/readme/scheme_remove-folder.png new file mode 100644 index 00000000..551db025 Binary files /dev/null and b/images/readme/scheme_remove-folder.png differ diff --git a/images/readme/scheme_result.png b/images/readme/scheme_result.png new file mode 100644 index 00000000..a648cc24 Binary files /dev/null and b/images/readme/scheme_result.png differ diff --git a/images/readme/scheme_targets-auto-generated-uuid.png b/images/readme/scheme_targets-auto-generated-uuid.png new file mode 100644 index 00000000..aee27248 Binary files /dev/null and b/images/readme/scheme_targets-auto-generated-uuid.png differ diff --git a/install.sh b/install.sh new file mode 100644 index 00000000..3fe545f6 --- /dev/null +++ b/install.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Backup old templates in case you have your custom templates + +read -r -p "Do you want to backup your old templates? [Y|n] " response + +if [[ ! $response =~ (n|no|N) ]];then + currentDate=`date +%s` + cp -R ~/Library/Developer/Xcode/Templates ~/Library/Developer/Xcode/Templates-Backup-${currentDate} +fi + +rm -rf ~/Library/Developer/Xcode/Templates/File\ Templates +rm -rf ~/Library/Developer/Xcode/Templates/Project\ Templates + +# Create Folders +mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates +mkdir -p ~/Library/Developer/Xcode/Templates/Project\ Templates +mkdir -p ~/Library/Developer/Xcode/Templates/Project\ Templates/Nimble\ Templates +cp -R Nimble\ Templates/* ~/Library/Developer/Xcode/Templates/Project\ Templates/Nimble\ Templates \ No newline at end of file