Skip to content

Commit

Permalink
Merge branch 'Swift3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron McTavish committed Oct 18, 2016
2 parents 7c2842b + 5ff6d1b commit 1f6a761
Show file tree
Hide file tree
Showing 24 changed files with 601 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage:
ignore:
- Example/.*
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Description

> Describe the issue you are seeing.
### Steps to Reproduce

1.
2.
3.

### Expected Result

### Actual Result

### Version Information

The current version I am using is:

- Xcode:
- iOS:
- BaseViewControllerSwift:

### Other Information

> Add logs, screenshots, etc. that will help in debugging the issue.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Summary

> Provide a general description of what is this Pull Request about and any
context that makes easier to review the changes.

> If it addresses a Github Issue please mention the number (e.g. `#34`) to keep
track of the different parts of the topic.
42 changes: 37 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -9,19 +15,33 @@ build/
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
xcuserdata/

## Other
*.moved-aside
DerivedData
*.xcuserstate

## Obj-C/Swift specific
*.hmap
*.ipa
*.xcuserstate
*.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/
.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:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

Expand All @@ -31,3 +51,15 @@ DerivedData
# 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0
25 changes: 25 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
disabled_rules: # rule identifiers to exclude from running
- function_body_length
- line_length
- nesting
- operator_whitespace
- trailing_whitespace
- type_body_length
- variable_name
excluded: # paths to ignore during linting. overridden by `included`.
- Pods
- 'Wayfindr EustonTests'
# parameterized rules can be customized from this configuration file
line_length: 110
# parameterized rules are first parameterized as a warning level, then error level.
type_body_length:
- 300 # warning
- 400 # error
# parameterized rules are first parameterized as a warning level, then error level.
variable_name_max_length:
- 40 # warning
- 60 # error
# parameterized rules are first parameterized as a warning level, then error level.
variable_name_min_length:
- 3 # warning
- 2 # error
31 changes: 5 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
osx_image: xcode8
language: objective-c
osx_image: xcode7.2

env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- WORKSPACE=BaseViewControllerSwift.xcworkspace
- IOS_FRAMEWORK_SCHEME="BaseViewControllerSwift iOS"
- IOS_SDK=iphonesimulator9.2
- OSX_SDK=macosx10.11
- TVOS_SDK=appletvsimulator9.1
- WATCHOS_SDK=watchsimulator2.1
- EXAMPLE_SCHEME="iOS Example"
matrix:
- DESTINATION="OS=8.3,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO"
- DESTINATION="OS=9.2,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES"
script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks

# Build Framework in Debug and Run Tests if specified
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=YES test | xcpretty -c;
else
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
fi

# Build Example in Debug if specified
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
fi
# Test using Fastlane
script:
- ./fastlane/travis.sh

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
7 changes: 4 additions & 3 deletions BaseViewControllerSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Pod::Spec.new do |s|
s.name = 'BaseViewControllerSwift'
s.version = '1.0.0'
s.version = '2.0.0'
s.license = 'MIT'
s.summary = 'An organizational tool for writing custom view controllers using UIKit.'
s.homepage = 'https://github.com/ustwo/baseviewcontroller-swift'
s.authors = { 'Shagun Madhikarmi' => '[email protected]',
'Aaron McTavish' => '[email protected]',
'Martin Stolz' => '[email protected]' }
'Aaron McTavish' => '[email protected]' }
s.source = { :git => 'https://github.com/ustwo/baseviewcontroller-swift.git', :tag => s.version }

s.ios.deployment_target = '8.3'

s.source_files = 'Sources/*.swift'

s.frameworks = 'Foundation', 'UIKit'

s.requires_arc = true
end
34 changes: 33 additions & 1 deletion BaseViewControllerSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
005153461C3D148D00C8533E /* Frameworks */,
005153471C3D148D00C8533E /* Headers */,
005153481C3D148D00C8533E /* Resources */,
006F491D1DB5052000C8F4FC /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -157,14 +158,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = BaseViewControllerSwift;
TargetAttributes = {
005153491C3D148D00C8533E = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
005153531C3D148D00C8533E = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -203,6 +206,22 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
006F491D1DB5052000C8F4FC /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
005153451C3D148D00C8533E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -245,8 +264,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -274,6 +295,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -293,8 +315,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -314,6 +338,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -325,6 +351,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -336,13 +363,15 @@
PRODUCT_NAME = BaseViewControllerSwift;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
005153601C3D148D00C8533E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -353,6 +382,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.baseviewcontrollerswift.BaseViewControllerSwift;
PRODUCT_NAME = BaseViewControllerSwift;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -365,6 +395,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.baseviewcontrollerswift.BaseViewControllerSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -376,6 +407,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.baseviewcontrollerswift.BaseViewControllerSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
All notable changes to this project will be documented in this file.
BaseViewControllerSwift adheres to [Semantic Versioning](http://semver.org/).

#### 2.x Releases
- `2.0.x` Releases - [2.0.0](#200)

#### 1.x Releases
- `1.0.x` Releases - [1.0.0](#100)

---

## [2.0.0](https://github.com/ustwo/baseview-swift/releases/tag/2.0.0)

#### Breaking
- Migrated to Swift 3.

## [1.0.0](https://github.com/ustwo/baseview-swift/releases/tag/1.0.0)
Released on 2 February 2016.

Expand Down
7 changes: 3 additions & 4 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - UIApplicationDelegate

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
var profile = Profile()
profile.name = "Jane"

let viewController = ProfileViewController(profile: profile)
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.translucent = false
navigationController.navigationBar.isTranslucent = false

window = UIWindow(frame: UIScreen.mainScreen().bounds)
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = navigationController
window?.makeKeyAndVisible()

Expand All @@ -37,4 +37,3 @@ class AppDelegate: UIResponder, UIApplicationDelegate {


}

Loading

0 comments on commit 1f6a761

Please sign in to comment.