Navigation Menu

Skip to content

Commit

Permalink
Fixed for swift 3 / xcode 8
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalLeaves committed Oct 9, 2016
1 parent 90d5efe commit c17f3a4
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 125 deletions.
14 changes: 13 additions & 1 deletion CommonCryptoInSwift.xcodeproj/project.pbxproj
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
661F5F5E1DAA963C004AB36C /* Data+HexDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 661F5F5D1DAA963C004AB36C /* Data+HexDescription.swift */; };
66C8957C1B77DF47009A2EF1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66C8957B1B77DF47009A2EF1 /* AppDelegate.swift */; };
66C8957E1B77DF47009A2EF1 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66C8957D1B77DF47009A2EF1 /* ViewController.swift */; };
66C895811B77DF47009A2EF1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 66C8957F1B77DF47009A2EF1 /* Main.storyboard */; };
Expand All @@ -16,6 +17,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
661F5F5D1DAA963C004AB36C /* Data+HexDescription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Data+HexDescription.swift"; sourceTree = "<group>"; };
66C895781B77DF47009A2EF1 /* CommonCryptoInSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CommonCryptoInSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
66C8957B1B77DF47009A2EF1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
66C8957D1B77DF47009A2EF1 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -57,6 +59,7 @@
66C8957A1B77DF47009A2EF1 /* CommonCryptoInSwift */ = {
isa = PBXGroup;
children = (
661F5F5D1DAA963C004AB36C /* Data+HexDescription.swift */,
66C8957B1B77DF47009A2EF1 /* AppDelegate.swift */,
66C8957D1B77DF47009A2EF1 /* ViewController.swift */,
66C8957F1B77DF47009A2EF1 /* Main.storyboard */,
Expand Down Expand Up @@ -96,11 +99,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Ignacio Nieto Carvajal";
TargetAttributes = {
66C895771B77DF47009A2EF1 = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -142,6 +146,7 @@
files = (
66C8957E1B77DF47009A2EF1 /* ViewController.swift in Sources */,
66C8957C1B77DF47009A2EF1 /* AppDelegate.swift in Sources */,
661F5F5E1DAA963C004AB36C /* Data+HexDescription.swift in Sources */,
66F3B6381B77E02300047D32 /* SymmetricCryptor.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -181,8 +186,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 @@ -225,8 +232,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 @@ -245,6 +254,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -260,6 +270,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "CommonCryptoInSwift/CommonCryptoInSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -273,6 +284,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.Ignacio-Nieto-Carvajal.CommonCryptoInSwift";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "CommonCryptoInSwift/CommonCryptoInSwift-Bridging-Header.h";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Binary file not shown.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 6 additions & 6 deletions CommonCryptoInSwift/AppDelegate.swift
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
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
15 changes: 15 additions & 0 deletions CommonCryptoInSwift/Data+HexDescription.swift
@@ -0,0 +1,15 @@
//
// Data+HexDescription.swift
// CryptoLoadExternalCertificate
//
// Created by Ignacio Nieto Carvajal on 6/10/16.
// Copyright © 2016 Ignacio Nieto Carvajal. All rights reserved.
//

import Foundation

extension Data {
var hexDescription: String {
return self.map { String(format: "%02hhx", $0) }.joined()
}
}

0 comments on commit c17f3a4

Please sign in to comment.