diff --git a/MiniScanner.xcodeproj/project.pbxproj b/MiniScanner.xcodeproj/project.pbxproj index 18eb0a60f81005b6bb1fbb78f0804ed34b032cac..f1f3419d5721af93fc5710bf5299c87380d8a9ad 100644 --- a/MiniScanner.xcodeproj/project.pbxproj +++ b/MiniScanner.xcodeproj/project.pbxproj @@ -1177,7 +1177,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 5L95SU3SLS; + DEVELOPMENT_TEAM = Z7STA3KGEU; INFOPLIST_FILE = "MiniScanner/Supporting Files/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = BeezScanner123; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; @@ -1187,7 +1187,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1; - PRODUCT_BUNDLE_IDENTIFIER = com.be.beinScanner1234512sdf; + PRODUCT_BUNDLE_IDENTIFIER = com.be.beinScanner1234512sdf1; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -1206,7 +1206,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 5L95SU3SLS; + DEVELOPMENT_TEAM = Z7STA3KGEU; INFOPLIST_FILE = "MiniScanner/Supporting Files/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = BeezScanner123; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; @@ -1216,7 +1216,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1; - PRODUCT_BUNDLE_IDENTIFIER = com.be.beinScanner1234512sdf; + PRODUCT_BUNDLE_IDENTIFIER = com.be.beinScanner1234512sdf1; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; diff --git a/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate b/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate index b2ebd399960c4c4d533a4b210850774cc9704bd1..340fe90c952c0f2dcb05b5ab6008b78d29789935 100644 Binary files a/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate and b/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.swift b/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.swift index 3b490e47bd10103abdcdab96f8bf66463a759283..0a76b7a4ea2a9b83438c2521ddbf88be6015c320 100644 --- a/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.swift +++ b/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.swift @@ -49,8 +49,8 @@ class CustomTabBarView: UIView { } private func setupUI() { - editImageIcon.image = UIImage(named: "edit") - editImageLabel.set(text: "Edit", color: .white, font: .medium(18)) + editImageIcon.image = UIImage(named: "preview") + editImageLabel.set(text: "Preview", color: .white, font: .medium(18)) editImageView.layer.cornerRadius = 10 editImageView.backgroundColor = .buttonsBlue badgeView.layer.cornerRadius = 10 diff --git a/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.xib b/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.xib index c5ffe6e1d571d932393ba38d7a4270e703402a7f..c02e194c65476755b8c1501e14cdf1de519188a9 100644 --- a/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.xib +++ b/MiniScanner/Modules/Documents/CustomViews/CustomTabBarView/CustomTabBarView.xib @@ -67,23 +67,23 @@ <state key="normal" image="Gallery"/> </button> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hyG-kY-g3z"> - <rect key="frame" x="30" y="34" width="110" height="57"/> + <rect key="frame" x="30" y="34" width="140" height="57"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hON-Oh-Gde"> - <rect key="frame" x="10" y="18" width="49" height="21"/> + <rect key="frame" x="10" y="18" width="79" height="21"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="SLq-rj-Jpq"> - <rect key="frame" x="69" y="15" width="27" height="27"/> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="preview" translatesAutoresizingMaskIntoConstraints="NO" id="SLq-rj-Jpq"> + <rect key="frame" x="99" y="15" width="27" height="27"/> <constraints> <constraint firstAttribute="height" constant="27" id="CsA-IZ-F4E"/> <constraint firstAttribute="width" constant="27" id="m46-v1-cjn"/> </constraints> </imageView> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TTm-IQ-mun"> - <rect key="frame" x="0.0" y="0.0" width="110" height="57"/> + <rect key="frame" x="0.0" y="0.0" width="140" height="57"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <connections> <action selector="editImageTapped:" destination="-1" eventType="touchUpInside" id="EMA-Ic-ERU"/> @@ -92,7 +92,7 @@ </subviews> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> - <constraint firstAttribute="width" constant="110" id="5hr-e5-OqC"/> + <constraint firstAttribute="width" constant="140" id="5hr-e5-OqC"/> <constraint firstItem="TTm-IQ-mun" firstAttribute="top" secondItem="hyG-kY-g3z" secondAttribute="top" id="IYk-6f-4tz"/> <constraint firstItem="SLq-rj-Jpq" firstAttribute="centerY" secondItem="hyG-kY-g3z" secondAttribute="centerY" id="Jan-FL-WZM"/> <constraint firstItem="SLq-rj-Jpq" firstAttribute="leading" secondItem="hON-Oh-Gde" secondAttribute="trailing" constant="10" id="PaA-pR-q5N"/> @@ -189,6 +189,7 @@ <resources> <image name="Files" width="46" height="47"/> <image name="Gallery" width="35" height="34"/> + <image name="preview" width="35" height="35"/> <image name="scanButton" width="77" height="75"/> <image name="share" width="40" height="42"/> <image name="tabBar" width="431" height="94"/> diff --git a/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift b/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift index a6feec94b9f18dbd759cb9adc6bd6361e8c4ed72..88022e935259921bbc259cace82e06b698a8fe3d 100644 --- a/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift +++ b/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift @@ -11,6 +11,7 @@ import FSPagerView protocol BannerViewDelegate { func updateSelectedIndex(index: Int) + func delete(index: Int) } class BannerView: UIView { @@ -134,7 +135,6 @@ extension BannerView: FSPagerViewDataSource,FSPagerViewDelegate { extension BannerView: FSPagerViewCellDelegate { func delete(at: Int) { - scanSession?.remove(index: at) - pagerView.reloadData() + delegate?.delete(index: at) } } diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index 05b09ec0662173eebaf5c7765244e95b394e6d09..03b6ffef12dab3794522305d4b23c0a42299c77c 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -153,6 +153,36 @@ public class EditViewController: UIViewController { // MARK: - BannerViewDelegate extension EditViewController: BannerViewDelegate { + func delete(index: Int) { + let alertController = UIAlertController(title: "Alert", message: "Are you sure you want to delete this image?", preferredStyle: .alert) + + let okAction = UIAlertAction(title: "Yes", style: .default) { (action) in + self.scanSession?.remove(index: index) + if index != 0 { + self.selectedIndex = index - 1 + } + self.banner.scanSession = self.scanSession + self.banner.pagerView.reloadData() + if self.scanSession?.scannedItems.count != 0 { + self.updatePageLabel() + } else { + self.dismiss(animated: true) { + self.navigationController?.popViewController(animated: true) + return + } + } + self.dismiss(animated: true) + } + + let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + self.dismiss(animated: true) + } + + alertController.addAction(okAction) + alertController.addAction(cancelAction) + self.present(alertController, animated: true, completion: nil) + } + func updateSelectedIndex(index: Int) { selectedIndex = index updatePageLabel() diff --git a/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Contents.json b/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..8c6701797df77d67cc5822b4ec37cbc264617a2c --- /dev/null +++ b/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Type=Preview.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Type=Preview.svg b/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Type=Preview.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a346449f38e4d5b7075c005f460b73e8a4caa9c --- /dev/null +++ b/MiniScanner/Supporting Files/Assets.xcassets/preview.imageset/Type=Preview.svg @@ -0,0 +1,16 @@ +<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg"> +<g clip-path="url(#clip0_290_1243)"> +<g clip-path="url(#clip1_290_1243)"> +<path d="M34.8654 16.8943C31.7019 10.5 25.1058 6.05774 17.5 6.05774C9.89423 6.05774 3.29807 10.5 0.134612 16.8943C-0.0673112 17.2981 -0.0673112 17.7693 0.134612 18.1058C3.29807 24.5 9.89423 28.9424 17.5 28.9424C25.1058 28.9424 31.7019 24.5 34.8654 18.1058C35.0673 17.702 35.0673 17.2981 34.8654 16.8943ZM17.5 24.9039C13.3942 24.9039 10.0962 21.6058 10.0962 17.5C10.0962 13.3943 13.3942 10.0962 17.5 10.0962C21.6058 10.0962 24.9038 13.3943 24.9038 17.5C24.9038 21.6058 21.6058 24.9039 17.5 24.9039Z" fill="white"/> +<path d="M17.5 12.7885C14.875 12.7885 12.7885 14.875 12.7885 17.5C12.7885 20.125 14.875 22.2115 17.5 22.2115C20.125 22.2115 22.2115 20.125 22.2115 17.5C22.2115 14.875 20.125 12.7885 17.5 12.7885Z" fill="white"/> +</g> +</g> +<defs> +<clipPath id="clip0_290_1243"> +<rect width="35" height="35" fill="white" transform="matrix(-1 0 0 1 35 0)"/> +</clipPath> +<clipPath id="clip1_290_1243"> +<rect width="35" height="35" fill="white"/> +</clipPath> +</defs> +</svg>