From a3777c040afaa711a7fc337bda16e8ee5dda860b Mon Sep 17 00:00:00 2001 From: Haik Aslanyan Date: Thu, 16 Apr 2020 14:29:23 +0400 Subject: [PATCH] updated example project --- Example/Example.xcodeproj/project.pbxproj | 10 +++++----- Example/Example/Base.lproj/Main.storyboard | 10 ++++------ Example/Example/Info.plist | 2 ++ Example/Example/ViewController.swift | 9 ++++++++- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 3930770..ad33abc 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 22C936CC2447221100128DE6 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 22C936CC2447221100128DE6 /* Round Code.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Round Code.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 22C936CF2447221100128DE6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22C936D12447221100128DE6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 22C936D32447221100128DE6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -51,7 +51,7 @@ 22C936CD2447221100128DE6 /* Products */ = { isa = PBXGroup; children = ( - 22C936CC2447221100128DE6 /* Example.app */, + 22C936CC2447221100128DE6 /* Round Code.app */, ); name = Products; sourceTree = ""; @@ -97,7 +97,7 @@ 22C936E42447225600128DE6 /* RoundCode */, ); productName = Example; - productReference = 22C936CC2447221100128DE6 /* Example.app */; + productReference = 22C936CC2447221100128DE6 /* Round Code.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -306,7 +306,7 @@ "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.roundcode.example; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = "Round Code"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -325,7 +325,7 @@ "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.roundcode.example; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = "Round Code"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Example/Example/Base.lproj/Main.storyboard b/Example/Example/Base.lproj/Main.storyboard index 6a3a1c7..b28ce36 100644 --- a/Example/Example/Base.lproj/Main.storyboard +++ b/Example/Example/Base.lproj/Main.storyboard @@ -7,10 +7,10 @@ - + - + @@ -23,11 +23,9 @@ - - @@ -62,7 +60,7 @@ - + @@ -85,7 +83,7 @@ - + diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist index 6718651..d638a2e 100644 --- a/Example/Example/Info.plist +++ b/Example/Example/Info.plist @@ -22,6 +22,8 @@ NSAppleMusicUsageDescription To scan roundcodes + NSPhotoLibraryAddUsageDescription + To save RoundCode images NSCameraUsageDescription To scan roundcodes UIApplicationSceneManifest diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index 7f97ee2..b7e08d0 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -36,6 +36,11 @@ class ViewController: UIViewController { extension ViewController { + override func viewDidLoad() { + super.viewDidLoad() + image.isTransparent = true + } + @IBAction func scan(_ sender: Any) { let vc = RCCameraViewController() vc.delegate = self @@ -44,10 +49,12 @@ extension ViewController { @IBAction func share(_ sender: Any) { image.size = 1000 - image.contentInsets = UIEdgeInsets(top: 100, left: 100, bottom: 100, right: 100) + image.isTransparent = false + image.contentInsets = UIEdgeInsets(top: 50, left: 50, bottom: 50, right: 50) let uiImage = try? coder.encode(image) image.size = 300 image.contentInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8) + image.isTransparent = true let vc = UIActivityViewController.init(activityItems: [uiImage!], applicationActivities: nil) present(vc, animated: true) }