Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Swift 2.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Combs committed Sep 28, 2016
1 parent 548e2fe commit 8baede5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions QRIO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@
TargetAttributes = {
838FB5641D26A45E0065A950 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
838FB56E1D26A45E0065A950 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -327,6 +329,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -345,6 +348,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.nodes.QRIO;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -355,6 +359,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.nodes.QRIOTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -365,6 +370,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.nodes.QRIOTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand Down
6 changes: 4 additions & 2 deletions QRIO/QRIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public extension UIImage {

let qrImage = resultImage.imageByApplyingTransform(CGAffineTransformMakeScale(scaleX, scaleY))
let context = CIContext(options: nil)
let tempImage: CGImageRef = context.createCGImage(qrImage, fromRect: qrImage.extent)
return UIImage(CGImage: tempImage)
if let tempImage: CGImageRef = context.createCGImage(qrImage, fromRect: qrImage.extent) {
return UIImage(CGImage: tempImage)
}
return nil
}
}

0 comments on commit 8baede5

Please sign in to comment.