diff --git a/KIF Test Bundle Swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift b/KIF Test Bundle Swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift index 4ae7848..3a764cf 100755 --- a/KIF Test Bundle Swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +++ b/KIF Test Bundle Swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift @@ -10,7 +10,6 @@ import UIKit import KIF class ___FILEBASENAMEASIDENTIFIER___: KIFTestCase { - func testAreAnyTestsWritten() { XCTFail("You should write some KIF tests.") } diff --git a/README.md b/README.md index 73dc0c7..3910d92 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This repo contains Objective-C and Swift templates to start up a new Vokal proje For people outside of Vokal: you'll need to make some adjustments after creating your project from these templates. In particular, you'll need to remove our private podspec repo from the `Podfile`, and update the certificate repo in `fastlane/Matchfile`. If you have issues beyond that, feel free to [drop us a note](mailto:ios@vokal.io). ## Maintaining these templates -Apple doesn't have documentation on managing templates like this, but [there is a third-party guide for Xcode 4](http://www.learn-cocos2d.com/store/xcode4-template-documentation/) that's still mostly correct for Xcode 10. +Apple doesn't have documentation on managing templates like this, but [there is a third-party guide for Xcode 4](https://web.archive.org/web/20180423060655/http://www.learn-cocos2d.com/store/xcode4-template-documentation) that's still mostly correct for Xcode 10. If you're updating the templates, you'll note that there are Vokal-fied versions of several templates in this project - this is to facilitate making sure that certain stock files which would otherwise be created are not created. These were forked from the Xcode 7 templates, but as of Xcode 10, the base template had not changed significantly from the one included in 7. @@ -105,3 +105,4 @@ Adjust the run scripts in this target as necessary. For example, if your project * 2.x: works with Swift 3 in Xcode 8 * 3.x: works with Swift 4 in Xcode 9 * 4.x: works with Swift 4.2 in Xcode 10 +* 5.x: works with Swift 5.0 in Xcode 10.2 diff --git a/Vokal-Cocoa Touch Application Base.xctemplate/.travis.yml b/Vokal-Cocoa Touch Application Base.xctemplate/.travis.yml index 503588e..a6be31e 100755 --- a/Vokal-Cocoa Touch Application Base.xctemplate/.travis.yml +++ b/Vokal-Cocoa Touch Application Base.xctemplate/.travis.yml @@ -1,5 +1,5 @@ language: swift -osx_image: xcode10 +osx_image: xcode10.2 before_install: - echo -e "machine github.com\n login ${CI_USER_TOKEN}" >> ~/.netrc before_script: diff --git a/Vokal-Cocoa Touch Application Base.xctemplate/Gemfile b/Vokal-Cocoa Touch Application Base.xctemplate/Gemfile index 86f26bf..1e42674 100755 --- a/Vokal-Cocoa Touch Application Base.xctemplate/Gemfile +++ b/Vokal-Cocoa Touch Application Base.xctemplate/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -gem 'cocoapods', '~>1.5' +gem 'cocoapods', '~>1.6.1' gem 'fastlane' gem 'slather' diff --git a/Vokal-Cocoa Touch Application Base.xctemplate/Scripts/DevsJustWantToHaveFun.sh b/Vokal-Cocoa Touch Application Base.xctemplate/Scripts/DevsJustWantToHaveFun.sh index 5f0249c..050e8c8 100755 --- a/Vokal-Cocoa Touch Application Base.xctemplate/Scripts/DevsJustWantToHaveFun.sh +++ b/Vokal-Cocoa Touch Application Base.xctemplate/Scripts/DevsJustWantToHaveFun.sh @@ -28,8 +28,8 @@ FONT_DIR="${RESOURCES_DIR}/Fonts" # Prefix to use for extensions/categories, ex: VOK. PREFIX="FIXME" -# Change this to "swift" if you want your files to output in swift. -LANGUAGE="objc" +# Change this to "objc" if you want your files to output in Objective-C. +LANGUAGE="swift" # Make sure everything is set up before trying to run if [ "${PREFIX}" = "FIXME" ]; then @@ -42,4 +42,5 @@ fi --output-dir "${OUTPUT_DIR}" \ --font-dir "${FONT_DIR}" \ --prefix "${PREFIX}" \ - --"${LANGUAGE}" + --"${LANGUAGE}" \ + --noibdesignables diff --git a/Vokal-Cocoa Touch Application Base.xctemplate/TemplateInfo.plist b/Vokal-Cocoa Touch Application Base.xctemplate/TemplateInfo.plist index f43ecc3..66b1d00 100755 --- a/Vokal-Cocoa Touch Application Base.xctemplate/TemplateInfo.plist +++ b/Vokal-Cocoa Touch Application Base.xctemplate/TemplateInfo.plist @@ -144,7 +144,6 @@ target '___PACKAGENAME___' do End - target '___PACKAGENAME___Tests' do # Put pods used for both test targets here pod 'VOKMockUrlProtocol' @@ -154,7 +153,6 @@ target '___PACKAGENAME___' do pod 'KIF' end end - end post_install do | installer | @@ -168,8 +166,7 @@ post_install do | installer | config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf' end end -end - +end Group Non-iOS Resources @@ -426,7 +423,7 @@ end CODE_SIGN_IDENTITY[sdk=iphoneos*] iPhone Developer SWIFT_VERSION - 4.2 + 5.0 Targets diff --git a/Vokal-Swift.xctemplate/.swiftlint.yml b/Vokal-Swift.xctemplate/.swiftlint.yml index 613dd2b..df107ec 100755 --- a/Vokal-Swift.xctemplate/.swiftlint.yml +++ b/Vokal-Swift.xctemplate/.swiftlint.yml @@ -12,11 +12,14 @@ disabled_rules: - type_name - unused_optional_binding - variable_name + - weak_delegate opt_in_rules: - force_unwrapping - implicitly_unwrapped_optional - unneeded_parentheses_in_closure_argument + - vertical_whitespace_closing_braces + - vertical_whitespace_opening_braces force_unwrapping: severity: error diff --git a/Vokal-Swift.xctemplate/ReuseIdentifiable.swift b/Vokal-Swift.xctemplate/ReuseIdentifiable.swift deleted file mode 100644 index 8169516..0000000 --- a/Vokal-Swift.xctemplate/ReuseIdentifiable.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// ___FILENAME___ -// ___PACKAGENAME___ -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// ___COPYRIGHT___ -// - -import UIKit - -/** - * Mix-in protocol for cells and views that make use of a reuse identifier. The default implementation - * of defaultReuseIdentifier returns the class name. Add this protocol to a class to use that - * default functionality. - */ -protocol ReuseIdentifiable: class { - static var defaultReuseIdentifier: String { get } -} - -extension ReuseIdentifiable where Self: UIView { - static var defaultReuseIdentifier: String { - return String(describing: self) - } -} - -/// Provide a default reuse identifier for table view cells -extension UITableViewCell: ReuseIdentifiable { - // Mix-in -} - -/// Provide a default reuse identifier for table view headers and footers -extension UITableViewHeaderFooterView: ReuseIdentifiable { - // Mix-in -} - -/// Provide a default reuse identifier for collection view cells -extension UICollectionReusableView: ReuseIdentifiable { - // Mix-in -} - -// Include this if using MapKit -/// Provide a default reuse identifier for map annotation views -//extension MKAnnotationView: ReuseIdentifiable { -// // Mix-in -//} diff --git a/Vokal-Swift.xctemplate/Scripts/R.swift.sh b/Vokal-Swift.xctemplate/Scripts/R.swift.sh index 7e37f9f..ffbafbb 100755 --- a/Vokal-Swift.xctemplate/Scripts/R.swift.sh +++ b/Vokal-Swift.xctemplate/Scripts/R.swift.sh @@ -5,4 +5,4 @@ if [[ "${CI}" == 'true' && "${TRAVIS}" == 'true' ]]; then exit 0 fi -"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT" +"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift" diff --git a/Vokal-Swift.xctemplate/TemplateInfo.plist b/Vokal-Swift.xctemplate/TemplateInfo.plist index ea95777..b61f218 100755 --- a/Vokal-Swift.xctemplate/TemplateInfo.plist +++ b/Vokal-Swift.xctemplate/TemplateInfo.plist @@ -73,6 +73,14 @@ /bin/bash ShellScript "${SRCROOT}/___PACKAGENAME___/Scripts/R.swift.sh" + InputFiles + + $TEMP_DIR/rswift-lastrun + + OutputFiles + + $SRCROOT/R.generated.swift + Class @@ -89,13 +97,13 @@ Nodes - Extensions/ReuseIdentifiable.swift main.swift ../R.generated.swift AppDelegate.swift TestingAppDelegate.swift View Controllers/ViewController.swift Protocols/CommonInitializedView.swift + Extensions/.gitkeep Controls/Base/BaseControl.swift Controls/Base/BaseButton.swift Controls/Base/BaseTextField.swift @@ -116,14 +124,14 @@ ../Podfile:swiftbasics use_frameworks! - pod 'R.swift', '~> 5.0.0.alpha.2' + pod 'R.swift' pod 'SwiftLint' - Extensions/ReuseIdentifiable.swift + Extensions/.gitkeep Group Extensions Path - ReuseIdentifiable.swift + .gitkeep View Controllers/ViewController.swift diff --git a/Vokal-Swift.xctemplate/ViewController.swift b/Vokal-Swift.xctemplate/ViewController.swift index aa8a3c6..1900aa5 100755 --- a/Vokal-Swift.xctemplate/ViewController.swift +++ b/Vokal-Swift.xctemplate/ViewController.swift @@ -9,5 +9,4 @@ import UIKit class ViewController: UIViewController { - } diff --git a/Vokal-iOS Test Bundle Base-swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift b/Vokal-iOS Test Bundle Base-swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift index d030e08..91eb8ba 100755 --- a/Vokal-iOS Test Bundle Base-swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +++ b/Vokal-iOS Test Bundle Base-swift.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift @@ -9,7 +9,6 @@ import XCTest class ___FILEBASENAMEASIDENTIFIER___: XCTestCase { - func testAreAnyTestsWritten() { XCTFail("You should write some unit tests.") }