Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加一个分类 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions ZZYQRCodeSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
D977954620639EEF003DA167 /* CIContext+XCode8Workaround.m in Sources */ = {isa = PBXBuildFile; fileRef = D977954520639EEF003DA167 /* CIContext+XCode8Workaround.m */; };
F8C4F6331ED499C600239E48 /* ScanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C4F6321ED499C600239E48 /* ScanViewController.swift */; };
F8C4F63A1ED4B2F700239E48 /* AVCaptureSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C4F6371ED4B2F700239E48 /* AVCaptureSessionManager.swift */; };
F8C4F63B1ED4B2F700239E48 /* UIImage+ZZYQRCodeImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C4F6381ED4B2F700239E48 /* UIImage+ZZYQRCodeImage.swift */; };
Expand Down Expand Up @@ -39,6 +40,9 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
D977954320639EEF003DA167 /* ZZYQRCodeSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ZZYQRCodeSwift-Bridging-Header.h"; sourceTree = "<group>"; };
D977954420639EEF003DA167 /* CIContext+XCode8Workaround.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CIContext+XCode8Workaround.h"; sourceTree = "<group>"; };
D977954520639EEF003DA167 /* CIContext+XCode8Workaround.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "CIContext+XCode8Workaround.m"; sourceTree = "<group>"; };
F8C4F6321ED499C600239E48 /* ScanViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScanViewController.swift; sourceTree = "<group>"; };
F8C4F6371ED4B2F700239E48 /* AVCaptureSessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVCaptureSessionManager.swift; sourceTree = "<group>"; };
F8C4F6381ED4B2F700239E48 /* UIImage+ZZYQRCodeImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+ZZYQRCodeImage.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -90,6 +94,9 @@
F8C4F6371ED4B2F700239E48 /* AVCaptureSessionManager.swift */,
F8C4F6381ED4B2F700239E48 /* UIImage+ZZYQRCodeImage.swift */,
F8C4F6391ED4B2F700239E48 /* ZZYQRCode.bundle */,
D977954420639EEF003DA167 /* CIContext+XCode8Workaround.h */,
D977954520639EEF003DA167 /* CIContext+XCode8Workaround.m */,
D977954320639EEF003DA167 /* ZZYQRCodeSwift-Bridging-Header.h */,
);
path = ZZYQRCodeSwift;
sourceTree = "<group>";
Expand Down Expand Up @@ -216,7 +223,8 @@
TargetAttributes = {
F8D7EC191ED309B7004BD6EB = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = W9WCZW4LDP;
DevelopmentTeam = TX4MVA7QT3;
LastSwiftMigration = 0920;
ProvisioningStyle = Automatic;
};
F8D7EC2D1ED309B7004BD6EB = {
Expand Down Expand Up @@ -290,6 +298,7 @@
F8C4F63B1ED4B2F700239E48 /* UIImage+ZZYQRCodeImage.swift in Sources */,
F8D7EC4E1ED430BF004BD6EB /* CreateViewController.swift in Sources */,
F8D7EC201ED309B7004BD6EB /* ViewController.swift in Sources */,
D977954620639EEF003DA167 /* CIContext+XCode8Workaround.m in Sources */,
F8D7EC1E1ED309B7004BD6EB /* AppDelegate.swift in Sources */,
F8C4F6331ED499C600239E48 /* ScanViewController.swift in Sources */,
);
Expand Down Expand Up @@ -445,12 +454,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = W9WCZW4LDP;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = TX4MVA7QT3;
INFOPLIST_FILE = ZZYQRCodeSwift/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ZZYQRCodeSwift/ZZYQRCodeSwift/ZZYQRCodeSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
Expand All @@ -459,12 +471,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = W9WCZW4LDP;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = TX4MVA7QT3;
INFOPLIST_FILE = ZZYQRCodeSwift/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ZZYQRCodeSwift/ZZYQRCodeSwift/ZZYQRCodeSwift-Bridging-Header.h";
SWIFT_VERSION = 4.0;
};
name = Release;
Expand Down
Binary file added ZZYQRCodeSwift/ZZYQRCodeSwift/.DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions ZZYQRCodeSwift/ZZYQRCodeSwift/CIContext+XCode8Workaround.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// CIContext+XCode8Workaround.h
// ZZYQRCodeSwift
//
// Created by oyq on 2018/3/22.
// Copyright © 2018年 zzy. All rights reserved.
//

#import <CoreImage/CoreImage.h>

@interface CIContext (XCode8Workaround)

+ (nonnull CIContext *)fixed_contextWithOptions:(nullable NSDictionary<NSString *, id> *)options;

@end
17 changes: 17 additions & 0 deletions ZZYQRCodeSwift/ZZYQRCodeSwift/CIContext+XCode8Workaround.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CIContext+XCode8Workaround.m
// ZZYQRCodeSwift
//
// Created by oyq on 2018/3/22.
// Copyright © 2018年 zzy. All rights reserved.
//

#import "CIContext+XCode8Workaround.h"

@implementation CIContext (XCode8Workaround)

+ (CIContext *)fixed_contextWithOptions:(NSDictionary<NSString *, id> *)options {
return [CIContext contextWithOptions:options];
}

@end
2 changes: 1 addition & 1 deletion ZZYQRCodeSwift/ZZYQRCodeSwift/UIImage+ZZYQRCodeImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extension UIImage {
let height = extent.height * scale
let cs = CGColorSpaceCreateDeviceGray()

let context = CIContext(options: nil);
let context = CIContext.fixed_context(options: nil)
let bitmapImage = context.createCGImage(image, from: extent)
let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.none.rawValue)
guard let bitmapRef = CGContext(data: nil,
Expand Down
10 changes: 10 additions & 0 deletions ZZYQRCodeSwift/ZZYQRCodeSwift/ZZYQRCodeSwift-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#ifndef ZZYQRCodeSwift_Bridging_Header_h
#define ZZYQRCodeSwift_Bridging_Header_h

#import "CIContext+XCode8Workaround.h"

#endif /* ZZYQRCodeSwift_Bridging_Header_h */