diff --git a/MiniScanner.xcodeproj/project.pbxproj b/MiniScanner.xcodeproj/project.pbxproj index 6094079327d386e69bad4d871dfcf2cec440e68e..af6ec5a7dc13c00c9b9063e51d39feba281281b9 100644 --- a/MiniScanner.xcodeproj/project.pbxproj +++ b/MiniScanner.xcodeproj/project.pbxproj @@ -141,8 +141,6 @@ 53CD5F5A2C1505500010424B /* UITextView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD5F592C1505500010424B /* UITextView+Extensions.swift */; }; 53CD5F5C2C1505A20010424B /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD5F5B2C1505A20010424B /* Globals.swift */; }; 53CD5F5E2C1505EC0010424B /* UIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD5F5D2C1505EC0010424B /* UIWindow.swift */; }; - 53CD5F612C15A6210010424B /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53CD5F5F2C15A6210010424B /* SettingViewController.swift */; }; - 53CD5F622C15A6210010424B /* SettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 53CD5F602C15A6210010424B /* SettingViewController.xib */; }; 53D9D1C22C1AF521004D1C1C /* StickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53D9D1BE2C1AF521004D1C1C /* StickerView.swift */; }; 53D9D1C42C1AF521004D1C1C /* UIView+Constraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53D9D1C02C1AF521004D1C1C /* UIView+Constraints.swift */; }; 53D9D1C52C1AF521004D1C1C /* MyExtention.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53D9D1C12C1AF521004D1C1C /* MyExtention.swift */; }; @@ -214,9 +212,6 @@ EC0CF218254D8DF200888722 /* Documents.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EC0CF217254D8DF200888722 /* Documents.storyboard */; }; EC0CF21D254D8F3900888722 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0CF21C254D8F3900888722 /* String+Extensions.swift */; }; EC702522254DF13200BE1958 /* PencilKitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC702521254DF13200BE1958 /* PencilKitViewController.swift */; }; - EC70252A254E066400BE1958 /* SettingsViewController+Safari.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC702526254E066400BE1958 /* SettingsViewController+Safari.swift */; }; - EC70252B254E066400BE1958 /* SettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC702527254E066400BE1958 /* SettingsTableViewCell.swift */; }; - EC70252C254E066400BE1958 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC702528254E066400BE1958 /* SettingsViewController.swift */; }; EC702537254E1DE000BE1958 /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC702536254E1DE000BE1958 /* UIViewController+Extensions.swift */; }; EC702540254E1E7500BE1958 /* WalkthroughViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC70253C254E1E7400BE1958 /* WalkthroughViewController.swift */; }; EC702541254E1E7500BE1958 /* ClassicWalkthroughViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = EC70253D254E1E7400BE1958 /* ClassicWalkthroughViewController.xib */; }; @@ -394,8 +389,6 @@ 53CD5F592C1505500010424B /* UITextView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+Extensions.swift"; sourceTree = "<group>"; }; 53CD5F5B2C1505A20010424B /* Globals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = "<group>"; }; 53CD5F5D2C1505EC0010424B /* UIWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIWindow.swift; sourceTree = "<group>"; }; - 53CD5F5F2C15A6210010424B /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = "<group>"; }; - 53CD5F602C15A6210010424B /* SettingViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingViewController.xib; sourceTree = "<group>"; }; 53D9D1BE2C1AF521004D1C1C /* StickerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StickerView.swift; sourceTree = "<group>"; }; 53D9D1C02C1AF521004D1C1C /* UIView+Constraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = "<group>"; }; 53D9D1C12C1AF521004D1C1C /* MyExtention.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyExtention.swift; sourceTree = "<group>"; }; @@ -472,9 +465,6 @@ EC0CF217254D8DF200888722 /* Documents.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Documents.storyboard; sourceTree = "<group>"; }; EC0CF21C254D8F3900888722 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = "<group>"; }; EC702521254DF13200BE1958 /* PencilKitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PencilKitViewController.swift; sourceTree = "<group>"; }; - EC702526254E066400BE1958 /* SettingsViewController+Safari.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SettingsViewController+Safari.swift"; sourceTree = "<group>"; }; - EC702527254E066400BE1958 /* SettingsTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewCell.swift; sourceTree = "<group>"; }; - EC702528254E066400BE1958 /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; }; EC702536254E1DE000BE1958 /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extensions.swift"; sourceTree = "<group>"; }; EC70253C254E1E7400BE1958 /* WalkthroughViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalkthroughViewController.swift; sourceTree = "<group>"; }; EC70253D254E1E7400BE1958 /* ClassicWalkthroughViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ClassicWalkthroughViewController.xib; sourceTree = "<group>"; }; @@ -1207,18 +1197,6 @@ path = MiniScanner; sourceTree = "<group>"; }; - EC70252F254E066E00BE1958 /* Settings */ = { - isa = PBXGroup; - children = ( - EC702527254E066400BE1958 /* SettingsTableViewCell.swift */, - EC702528254E066400BE1958 /* SettingsViewController.swift */, - EC702526254E066400BE1958 /* SettingsViewController+Safari.swift */, - 53CD5F5F2C15A6210010424B /* SettingViewController.swift */, - 53CD5F602C15A6210010424B /* SettingViewController.xib */, - ); - path = Settings; - sourceTree = "<group>"; - }; EC702548254E1F9F00BE1958 /* Managers */ = { isa = PBXGroup; children = ( @@ -1318,7 +1296,6 @@ ECE9BBB2254E331700D45E43 /* Walktrough */, EC8A9B06254DC2EE00F9AF99 /* Documents */, EC8A9B2C254DE94900F9AF99 /* DocumentPreview */, - EC70252F254E066E00BE1958 /* Settings */, ); path = Modules; sourceTree = "<group>"; @@ -1438,7 +1415,6 @@ 535984102C145083003EB6ED /* Poppins-Medium.ttf in Resources */, 53014FAE2C11A8E80071CE39 /* rotate@2x.png in Resources */, 53014FB32C11A8E80071CE39 /* flash@3x.png in Resources */, - 53CD5F622C15A6210010424B /* SettingViewController.xib in Resources */, 672C46442C47B1F300497EF0 /* Localizable.xcstrings in Resources */, 539EF14E2C2AA43B0041AE1F /* ara.traineddata in Resources */, 53F21F9E2C1377B900172BFC /* Tajawal-ExtraLight.ttf in Resources */, @@ -1524,7 +1500,6 @@ 672C46662C47C74C00497EF0 /* Inject.swift in Sources */, 535983F22C144E87003EB6ED /* Keys.swift in Sources */, 539996962C27130000671340 /* ConstraintOffsetTarget.swift in Sources */, - EC70252C254E066400BE1958 /* SettingsViewController.swift in Sources */, EC0CF21D254D8F3900888722 /* String+Extensions.swift in Sources */, 539996812C27130000671340 /* LayoutConstraintItem.swift in Sources */, EC702540254E1E7500BE1958 /* WalkthroughViewController.swift in Sources */, @@ -1532,7 +1507,6 @@ EC0CF215254D8DE900888722 /* DocumentsTableViewController.swift in Sources */, 53CD5F542C15022E0010424B /* KNAlertViewController.swift in Sources */, 53014F9D2C11A8E80071CE39 /* Array+Utils.swift in Sources */, - 53CD5F612C15A6210010424B /* SettingViewController.swift in Sources */, 53014FAA2C11A8E80071CE39 /* Quadrilateral.swift in Sources */, 539996832C27130000671340 /* ConstraintMakerPriortizable.swift in Sources */, 678BD71D2C4D057200833DA5 /* UIImage+Images.swift in Sources */, @@ -1619,7 +1593,6 @@ 678BD7152C4CF1EB00833DA5 /* SettingsView.swift in Sources */, 53E3A2092C19D17100C9B95E /* PreviewImageViewController.swift in Sources */, 53E7D3362C1B00880025A1D3 /* FSPageViewTransformer.swift in Sources */, - EC70252A254E066400BE1958 /* SettingsViewController+Safari.swift in Sources */, 539996982C27130000671340 /* ConstraintMaker.swift in Sources */, 5399964F2C26E86700671340 /* SelectableRoundView.m in Sources */, 53E7D3372C1B00880025A1D3 /* FSPagerViewCell.swift in Sources */, @@ -1669,7 +1642,6 @@ 539996942C27130000671340 /* Typealiases.swift in Sources */, 5399964D2C26E86700671340 /* CDImageRectangleDetector.m in Sources */, 5399964E2C26E86700671340 /* CDZoomView.m in Sources */, - EC70252B254E066400BE1958 /* SettingsTableViewCell.swift in Sources */, 535983ED2C142B49003EB6ED /* UIFont+Extensions.swift in Sources */, 539996582C27124B00671340 /* ImageStickerContainerView.swift in Sources */, 5399968B2C27130000671340 /* ConstraintPriority.swift in Sources */, diff --git a/MiniScanner/Modules/Settings/SettingViewController.swift b/MiniScanner/Modules/Settings/SettingViewController.swift deleted file mode 100644 index 0f07b63db138ae6330dc9778a7acddd8dbb6c5f7..0000000000000000000000000000000000000000 --- a/MiniScanner/Modules/Settings/SettingViewController.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SettingViewController.swift -// MiniScanner -// -// Created by George Makhoul on 09/06/2024. -// Copyright © 2024 AppsNectar. All rights reserved. -// - -import UIKit - -class SettingViewController: UIViewController { - - @IBOutlet weak var tableView: UITableView! - - override func viewDidLoad() { - super.viewDidLoad() - } -} diff --git a/MiniScanner/Modules/Settings/SettingViewController.xib b/MiniScanner/Modules/Settings/SettingViewController.xib deleted file mode 100644 index 7184c71cb6dad8e1fb42675a52e143ed10c834af..0000000000000000000000000000000000000000 --- a/MiniScanner/Modules/Settings/SettingViewController.xib +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> - <device id="retina6_12" orientation="portrait" appearance="light"/> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> - <capability name="Safe area layout guides" minToolsVersion="9.0"/> - <capability name="System colors in document resources" minToolsVersion="11.0"/> - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SettingViewController" customModule="MiniScanner" customModuleProvider="target"> - <connections> - <outlet property="tableView" destination="DbZ-SH-Oyu" id="IRH-zW-oGa"/> - <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> - </connections> - </placeholder> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> - <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="DbZ-SH-Oyu"> - <rect key="frame" x="0.0" y="59" width="393" height="759"/> - <color key="backgroundColor" systemColor="systemBackgroundColor"/> - </tableView> - </subviews> - <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> - <color key="backgroundColor" systemColor="systemBackgroundColor"/> - <constraints> - <constraint firstItem="DbZ-SH-Oyu" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Ogh-rC-sV8"/> - <constraint firstItem="DbZ-SH-Oyu" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="gnE-NX-Vux"/> - <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="DbZ-SH-Oyu" secondAttribute="trailing" id="gyH-Zf-es7"/> - <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="DbZ-SH-Oyu" secondAttribute="bottom" id="n1F-n8-wln"/> - </constraints> - <point key="canvasLocation" x="140" y="20"/> - </view> - </objects> - <resources> - <systemColor name="systemBackgroundColor"> - <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - </systemColor> - </resources> -</document> diff --git a/MiniScanner/Modules/Settings/SettingsTableViewCell.swift b/MiniScanner/Modules/Settings/SettingsTableViewCell.swift deleted file mode 100644 index 433ab56c7a7f2c227dcccfc5f2a88eaeff50b039..0000000000000000000000000000000000000000 --- a/MiniScanner/Modules/Settings/SettingsTableViewCell.swift +++ /dev/null @@ -1,47 +0,0 @@ -import UIKit - -enum SettingsType: String { - case url, switcher, segment, none -} - -struct SettingsViewModel { - let imageName: String - let title: String - - var isSwitchOn = false - var isSwitcherOn: ((Bool) -> Void)? = nil - - var urlString: String? = nil - var type = SettingsType.none -} - -final class SettingsTableViewCell: UITableViewCell { - - static let ReuseIdentifier = String(describing: SettingsTableViewCell.self) - - @IBOutlet private weak var imgView: UIImageView! - @IBOutlet private weak var nameLabel: UILabel! - @IBOutlet private weak var settingsSwitch: UISwitch! - - private var isSwitcherOn: ((Bool) -> Void)? - - func configure(with viewModel: SettingsViewModel) { - imgView.image = UIImage(systemName: viewModel.imageName) - nameLabel.text = viewModel.title - isSwitcherOn = viewModel.isSwitcherOn - settingsSwitch.isOn = viewModel.isSwitchOn - - switch viewModel.type { - case .segment: - settingsSwitch.isHidden = false - case .switcher: - settingsSwitch.isHidden = true - case .url, .none: - settingsSwitch.isHidden = true - } - } - - @IBAction private func didTapSwitching(_ sender: UISwitch) { - isSwitcherOn?(sender.isOn) - } -} diff --git a/MiniScanner/Modules/Settings/SettingsViewController+Safari.swift b/MiniScanner/Modules/Settings/SettingsViewController+Safari.swift deleted file mode 100644 index d955355c95488b2d15b184c54aeda3b2a092f8e6..0000000000000000000000000000000000000000 --- a/MiniScanner/Modules/Settings/SettingsViewController+Safari.swift +++ /dev/null @@ -1,15 +0,0 @@ -import UIKit -import SafariServices - -extension SettingsViewController { - /// Shows SFSafariViewController - /// entersReaderIfAvailable - A value that specifies whether Safari should enter Reader mode, if it is available. - func presentSafariController(with urlString: String) { - guard let url = URL(string: urlString) else { return } - let config = SFSafariViewController.Configuration() - config.entersReaderIfAvailable = true - - let vc = SFSafariViewController(url: url, configuration: config) - present(vc, animated: true) - } -} diff --git a/MiniScanner/Modules/Settings/SettingsViewController.swift b/MiniScanner/Modules/Settings/SettingsViewController.swift deleted file mode 100644 index 8282ed33170fd5a9394edab5c93d6ef4e4cc5c05..0000000000000000000000000000000000000000 --- a/MiniScanner/Modules/Settings/SettingsViewController.swift +++ /dev/null @@ -1,31 +0,0 @@ -import UIKit - -class SettingsViewController: UIViewController { - // MARK: - Outlets - @IBOutlet weak var tableView: UITableView! - - // MARK: - Properties - - // MARK: - LifeCycle - override func viewDidLoad() { - super.viewDidLoad() - setupUI() - } - - private func setupUI() { - tableView.delegate = self - tableView.dataSource = self - tableView.reloadData() - } -} - -// MARK: - UITableViewDelegate -extension SettingsViewController: UITableViewDelegate, UITableViewDataSource { - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - 2 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - UITableViewCell() - } -}