Skip to content

Commit

Permalink
Merge pull request #1 from NextFaze/feature/swift3
Browse files Browse the repository at this point in the history
Feature/swift3
  • Loading branch information
ricsantos authored Nov 24, 2016
2 parents 0f4c88d + 072dbf6 commit 65bfa36
Show file tree
Hide file tree
Showing 24 changed files with 970 additions and 388 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3
3.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * https://github.com/supermarin/xcpretty#usage

language: objective-c # still specify this even though we are using swift - appears to tell travis which Xcode version to use
osx_image: xcode7.3
osx_image: xcode8
#cache: cocoapods
podfile: Example/Podfile
before_install:
Expand All @@ -15,7 +15,7 @@ script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks
- xcodebuild build test -workspace Example/FazeKit.xcworkspace -scheme FazeKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- xcodebuild build test -workspace Example/FazeKit.xcworkspace -scheme FazeKit-Example -sdk iphonesimulator10.0 -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
notifications:
slack:
Expand Down
34 changes: 26 additions & 8 deletions Example/FazeKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* UIViewAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */; };
78B6DD4BAF21BA4B263F3EF4 /* Pods_FazeKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DB0AD919FBE4556CA363D8B /* Pods_FazeKit_Tests.framework */; };
C2E94BAE1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */; };
C20FAFE21DD42EAA009E5C3F /* MulticastTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */; };
C2B9A0321DD29F9100AF4E04 /* DateAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */; };
C2B9A0381DD2DAE500AF4E04 /* CollectionAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */; };
C2E94BAE1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -43,7 +46,10 @@
607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewAdditionsTests.swift; sourceTree = "<group>"; };
739B56FA57C1D0E13427B629 /* Pods-FazeKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FazeKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-FazeKit_Tests/Pods-FazeKit_Tests.release.xcconfig"; sourceTree = "<group>"; };
AE54F13DF076B827802B2E27 /* Pods-FazeKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FazeKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FazeKit_Example/Pods-FazeKit_Example.debug.xcconfig"; sourceTree = "<group>"; };
C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSProcessInfoAdditionsTests.swift; sourceTree = "<group>"; };
C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MulticastTests.swift; sourceTree = "<group>"; };
C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAdditionsTests.swift; sourceTree = "<group>"; };
C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionAdditionsTests.swift; sourceTree = "<group>"; };
C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProcessInfoAdditionsTests.swift; sourceTree = "<group>"; };
C5F04A4E1B4661BFB20EEE1D /* Pods_FazeKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FazeKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E2A7D960882894C1CF4EB4D0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
FAD6E5E790BC646CAF8A952D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
Expand Down Expand Up @@ -123,7 +129,10 @@
607FACE81AFB9204008FA782 /* Tests */ = {
isa = PBXGroup;
children = (
C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */,
C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */,
C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */,
C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */,
C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */,
607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */,
607FACE91AFB9204008FA782 /* Supporting Files */,
);
Expand Down Expand Up @@ -215,10 +224,12 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = B89H5L73N6;
LastSwiftMigration = 0800;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = B89H5L73N6;
LastSwiftMigration = 0800;
TestTargetID = 607FACCF1AFB9204008FA782;
};
Expand Down Expand Up @@ -369,8 +380,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C2E94BAE1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift in Sources */,
C2E94BAE1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift in Sources */,
607FACEC1AFB9204008FA782 /* UIViewAdditionsTests.swift in Sources */,
C2B9A0321DD29F9100AF4E04 /* DateAdditionsTests.swift in Sources */,
C20FAFE21DD42EAA009E5C3F /* MulticastTests.swift in Sources */,
C2B9A0381DD2DAE500AF4E04 /* CollectionAdditionsTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -483,13 +497,14 @@
baseConfigurationReference = AE54F13DF076B827802B2E27 /* Pods-FazeKit_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = B89H5L73N6;
INFOPLIST_FILE = FazeKit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.nextfaze.FazeKit-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -498,20 +513,22 @@
baseConfigurationReference = 17B25E2129639E7E62C9740F /* Pods-FazeKit_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = B89H5L73N6;
INFOPLIST_FILE = FazeKit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.nextfaze.FazeKit-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Release;
};
607FACF31AFB9204008FA782 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1E3B0E69CF2CF2930A6BA13A /* Pods-FazeKit_Tests.debug.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = B89H5L73N6;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -524,14 +541,15 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
607FACF41AFB9204008FA782 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 739B56FA57C1D0E13427B629 /* Pods-FazeKit_Tests.release.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = B89H5L73N6;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -540,7 +558,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
16 changes: 8 additions & 8 deletions Example/FazeKit/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)

self.window?.rootViewController = UINavigationController(rootViewController: MenuViewController())
self.window?.backgroundColor = UIColor.blackColor()
self.window?.backgroundColor = UIColor.black
self.window?.makeKeyAndVisible()

return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// 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 throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// 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.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
51 changes: 47 additions & 4 deletions Example/FazeKit/MenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,62 @@
import UIKit
import FazeKit

class MenuViewController: UIViewController {

class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
enum MenuItem {
case jailbreak
}

let items: [MenuItem] = [.jailbreak]

let tableView = UITableView()
static let cellReuseIdentifier = "MenuTableViewCell"

override func viewDidLoad() {
super.viewDidLoad()

self.title = "FazeKit"
self.view.backgroundColor = UIColor.whiteColor()
self.view.backgroundColor = UIColor.white

self.tableView.dataSource = self
self.tableView.delegate = self
self.tableView.tableFooterView = UIView()
self.view.addSubview(self.tableView)
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

self.tableView.frame = self.view.bounds
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
print("WARNING: Memory warning.")
}

// MARK: UITableViewDataSource

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: MenuViewController.cellReuseIdentifier) ?? UITableViewCell(style: UITableViewCellStyle.value1, reuseIdentifier: MenuViewController.cellReuseIdentifier)

let item = self.items[indexPath.row]
switch item {
case .jailbreak:
cell.textLabel?.text = "Jailbroken"
cell.detailTextLabel?.text = UIDevice.isJailbroken() ? "Yes" : "No"
}

return cell
}

// MARK: UITableViewDelegate

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
}
}

Loading

0 comments on commit 65bfa36

Please sign in to comment.