updated example project

This commit is contained in:
Haik Aslanyan committed 2020-04-16 14:29:23 +04:00
1 parent 65c615304a
commit a3777c040a
4 files changed
+19 -12

No files matched your search

+5 -5
View File
@@ -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 = "<group>"; };
22C936D12447221100128DE6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
22C936D32447221100128DE6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -51,7 +51,7 @@
22C936CD2447221100128DE6 /* Products */ = {
isa = PBXGroup;
children = (
22C936CC2447221100128DE6 /* Example.app */,
22C936CC2447221100128DE6 /* Round Code.app */,
);
name = Products;
sourceTree = "<group>";
@@ -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";
};
+4 -6
View File
@@ -7,10 +7,10 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Round Code-->
<!--View Controller-->
<scene sceneID="a2g-4i-pyL">
<objects>
<viewController id="0zP-ee-W0J" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="0zP-ee-W0J" customClass="ViewController" customModule="RoundCode" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Rvj-Nv-Ukh">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -23,11 +23,9 @@
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Message" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="KyC-Sh-W2M">
<rect key="frame" x="5" y="503" width="404" height="27"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="27" id="BZz-IP-j2V"/>
</constraints>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no"/>
<connections>
@@ -62,7 +60,7 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="aXm-cj-1eD" firstAttribute="trailing" secondItem="zZa-y7-66Y" secondAttribute="trailing" constant="20" id="5cA-OR-hh7"/>
<constraint firstItem="akC-qR-hPk" firstAttribute="width" secondItem="IDN-sg-2ib" secondAttribute="width" id="603-Vl-61F"/>
@@ -85,7 +83,7 @@
</constraints>
<viewLayoutGuide key="safeArea" id="aXm-cj-1eD"/>
</view>
<navigationItem key="navigationItem" title="Round Code" id="XgG-ZM-i9d">
<navigationItem key="navigationItem" id="XgG-ZM-i9d">
<barButtonItem key="leftBarButtonItem" title="Share" id="so2-d3-VCF">
<connections>
<action selector="share:" destination="0zP-ee-W0J" id="uNU-bV-PaS"/>
+2
View File
@@ -22,6 +22,8 @@
<true/>
<key>NSAppleMusicUsageDescription</key>
<string>To scan roundcodes</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>To save RoundCode images</string>
<key>NSCameraUsageDescription</key>
<string>To scan roundcodes</string>
<key>UIApplicationSceneManifest</key>
+8 -1
View File
@@ -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)
}