diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f79e8ff2b99bef92d674ac1841d176e6ab128f7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,148 @@ +# Created by https://www.toptal.com/developers/gitignore/api/xcode,swift,cocoapods,swiftpackagemanager,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swift,cocoapods,swiftpackagemanager,macos + +### CocoaPods ### +## CocoaPods GitIgnore Template + +# CocoaPods - Only use to conserve bandwidth / Save time on Pushing +# - Also handy if you have a large number of dependant pods +# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE +Pods/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### SwiftPackageManager ### +Packages +xcuserdata +*.xcodeproj + + +### Xcode ### + +## Xcode 8 and earlier + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcodeproj/project.xcworkspace/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/xcode,swift,cocoapods,swiftpackagemanager,macos \ No newline at end of file diff --git a/MiniScanner.xcodeproj/project.pbxproj b/MiniScanner.xcodeproj/project.pbxproj index 67bac262ec35cd6d3cf8929a5672b8ee2bbeaf8a..af6ec5a7dc13c00c9b9063e51d39feba281281b9 100644 --- a/MiniScanner.xcodeproj/project.pbxproj +++ b/MiniScanner.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 53014F8D2C11A8E80071CE39 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53014F4C2C11A8E80071CE39 /* Localizable.strings */; }; 53014F8E2C11A8E80071CE39 /* ImageScannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53014F4F2C11A8E80071CE39 /* ImageScannerController.swift */; }; 53014F8F2C11A8E80071CE39 /* RectangleFeaturesFunnel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53014F532C11A8E80071CE39 /* RectangleFeaturesFunnel.swift */; }; 53014F902C11A8E80071CE39 /* CaptureSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53014F542C11A8E80071CE39 /* CaptureSessionManager.swift */; }; @@ -142,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 */; }; @@ -171,6 +168,41 @@ 53F21F9F2C1377B900172BFC /* Tajawal-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 53F21F982C1377B900172BFC /* Tajawal-Regular.ttf */; }; 53F21FA02C1377B900172BFC /* Tajawal-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 53F21F992C1377B900172BFC /* Tajawal-Medium.ttf */; }; 53F21FA12C1377B900172BFC /* Tajawal-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 53F21F9A2C1377B900172BFC /* Tajawal-Black.ttf */; }; + 672C46442C47B1F300497EF0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 672C46432C47B1F300497EF0 /* Localizable.xcstrings */; }; + 672C464A2C47BD8800497EF0 /* String+StringKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46492C47BD8800497EF0 /* String+StringKeys.swift */; }; + 672C46622C47C74300497EF0 /* DependencyInjector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46612C47C74300497EF0 /* DependencyInjector.swift */; }; + 672C46642C47C74800497EF0 /* Provide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46632C47C74800497EF0 /* Provide.swift */; }; + 672C46662C47C74C00497EF0 /* Inject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46652C47C74C00497EF0 /* Inject.swift */; }; + 672C46682C47C75100497EF0 /* Clear.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46672C47C75100497EF0 /* Clear.swift */; }; + 672C468F2C47CB2000497EF0 /* UserDefaultsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C468E2C47CB2000497EF0 /* UserDefaultsManager.swift */; }; + 672C46912C47CB5D00497EF0 /* UserDefaultsKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46902C47CB5D00497EF0 /* UserDefaultsKeys.swift */; }; + 672C46B32C47E8D700497EF0 /* DependencyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46A52C47E8D700497EF0 /* DependencyManager.swift */; }; + 672C46C52C47E98A00497EF0 /* SettingsRepositoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46B72C47E98900497EF0 /* SettingsRepositoryProtocol.swift */; }; + 672C46C62C47E98A00497EF0 /* ChangeLanguageUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46B92C47E98900497EF0 /* ChangeLanguageUseCase.swift */; }; + 672C46C72C47E98A00497EF0 /* GetLanguagesUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46BA2C47E98900497EF0 /* GetLanguagesUseCase.swift */; }; + 672C46C82C47E98A00497EF0 /* SettingsDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46BE2C47E98A00497EF0 /* SettingsDataSource.swift */; }; + 672C46C92C47E98A00497EF0 /* SupportedLanguage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46C02C47E98A00497EF0 /* SupportedLanguage.swift */; }; + 672C46CA2C47E98A00497EF0 /* SettingsRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46C22C47E98A00497EF0 /* SettingsRepository.swift */; }; + 672C46CC2C47E9AB00497EF0 /* GetLanguageUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46CB2C47E9AB00497EF0 /* GetLanguageUseCase.swift */; }; + 672C46CF2C47EA6D00497EF0 /* GetColorSchemeUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46CE2C47EA6D00497EF0 /* GetColorSchemeUseCase.swift */; }; + 672C46D12C47EA7400497EF0 /* ChangeColorSchemeUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46D02C47EA7400497EF0 /* ChangeColorSchemeUseCase.swift */; }; + 672C46D32C47EA8F00497EF0 /* SupportedColorScheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46D22C47EA8F00497EF0 /* SupportedColorScheme.swift */; }; + 672C46D52C47F8D000497EF0 /* HandleAppStartUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46D42C47F8D000497EF0 /* HandleAppStartUseCase.swift */; }; + 672C46D72C48006200497EF0 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 672C46D62C48006200497EF0 /* Colors.xcassets */; }; + 672C46DA2C48018400497EF0 /* Color+Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46D92C48018400497EF0 /* Color+Colors.swift */; }; + 672C46DC2C48018D00497EF0 /* UIColors+Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 672C46DB2C48018D00497EF0 /* UIColors+Colors.swift */; }; + 67807F8C2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67807F8B2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift */; }; + 67807F952C49306C00D1F168 /* MainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67807F942C49306C00D1F168 /* MainCoordinator.swift */; }; + 67807F992C49320100D1F168 /* MainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67807F982C49320100D1F168 /* MainViewModel.swift */; }; + 67807F9B2C49325A00D1F168 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67807F9A2C49325A00D1F168 /* MainView.swift */; }; + 67807FA02C4934BD00D1F168 /* View+LayoutChanges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67807F9F2C4934BD00D1F168 /* View+LayoutChanges.swift */; }; + 678BD70D2C4CF18300833DA5 /* CustomMenuPickerItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD70C2C4CF18300833DA5 /* CustomMenuPickerItem.swift */; }; + 678BD70F2C4CF1A000833DA5 /* CustomMenuPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD70E2C4CF1A000833DA5 /* CustomMenuPicker.swift */; }; + 678BD7152C4CF1EB00833DA5 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD7102C4CF1EB00833DA5 /* SettingsView.swift */; }; + 678BD7162C4CF1EB00833DA5 /* SettingsViewCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD7112C4CF1EB00833DA5 /* SettingsViewCoordinator.swift */; }; + 678BD7172C4CF1EB00833DA5 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD7122C4CF1EB00833DA5 /* SettingsViewModel.swift */; }; + 678BD71D2C4D057200833DA5 /* UIImage+Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD71C2C4D057200833DA5 /* UIImage+Images.swift */; }; + 678BD71F2C4D07B100833DA5 /* Image+Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678BD71E2C4D07B100833DA5 /* Image+Images.swift */; }; B827E5196CC419E773B843E1 /* Pods_MiniScanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9A37DC9F9A8E3AF632DFB98 /* Pods_MiniScanner.framework */; }; EC0CF1FE254D8BBF00888722 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0CF1FD254D8BBF00888722 /* AppDelegate.swift */; }; EC0CF200254D8BBF00888722 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0CF1FF254D8BBF00888722 /* SceneDelegate.swift */; }; @@ -180,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 */; }; @@ -221,11 +250,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 53014F4D2C11A8E80071CE39 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; }; - 53014F4E2C11A8E80071CE39 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; }; 53014F4F2C11A8E80071CE39 /* ImageScannerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageScannerController.swift; sourceTree = "<group>"; }; - 53014F502C11A8E80071CE39 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; }; - 53014F512C11A8E80071CE39 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; }; 53014F532C11A8E80071CE39 /* RectangleFeaturesFunnel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RectangleFeaturesFunnel.swift; sourceTree = "<group>"; }; 53014F542C11A8E80071CE39 /* CaptureSessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureSessionManager.swift; sourceTree = "<group>"; }; 53014F552C11A8E80071CE39 /* ShutterButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShutterButton.swift; sourceTree = "<group>"; }; @@ -234,7 +259,6 @@ 53014F582C11A8E80071CE39 /* DeviceOrientationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceOrientationHelper.swift; sourceTree = "<group>"; }; 53014F592C11A8E80071CE39 /* FocusRectangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FocusRectangleView.swift; sourceTree = "<group>"; }; 53014F5A2C11A8E80071CE39 /* ScannerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = "<group>"; }; - 53014F5B2C11A8E80071CE39 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; }; 53014F5D2C11A8E80071CE39 /* AVCaptureVideoOrientation+Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AVCaptureVideoOrientation+Utils.swift"; sourceTree = "<group>"; }; 53014F5E2C11A8E80071CE39 /* URL+Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "URL+Utils.swift"; sourceTree = "<group>"; }; 53014F5F2C11A8E80071CE39 /* CGPoint+Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CGPoint+Utils.swift"; sourceTree = "<group>"; }; @@ -256,8 +280,6 @@ 53014F722C11A8E80071CE39 /* CIRectangleDetector.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CIRectangleDetector.swift; sourceTree = "<group>"; }; 53014F732C11A8E80071CE39 /* QuadrilateralView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuadrilateralView.swift; sourceTree = "<group>"; }; 53014F742C11A8E80071CE39 /* Quadrilateral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Quadrilateral.swift; sourceTree = "<group>"; }; - 53014F752C11A8E80071CE39 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; }; - 53014F762C11A8E80071CE39 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = "<group>"; }; 53014F782C11A8E80071CE39 /* flash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flash.png; sourceTree = "<group>"; }; 53014F792C11A8E80071CE39 /* rotate@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rotate@3x.png"; sourceTree = "<group>"; }; 53014F7A2C11A8E80071CE39 /* rotate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rotate.png; sourceTree = "<group>"; }; @@ -367,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>"; }; @@ -398,6 +418,41 @@ 53F21F982C1377B900172BFC /* Tajawal-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Tajawal-Regular.ttf"; sourceTree = "<group>"; }; 53F21F992C1377B900172BFC /* Tajawal-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Tajawal-Medium.ttf"; sourceTree = "<group>"; }; 53F21F9A2C1377B900172BFC /* Tajawal-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Tajawal-Black.ttf"; sourceTree = "<group>"; }; + 672C46432C47B1F300497EF0 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; }; + 672C46492C47BD8800497EF0 /* String+StringKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+StringKeys.swift"; sourceTree = "<group>"; }; + 672C46612C47C74300497EF0 /* DependencyInjector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyInjector.swift; sourceTree = "<group>"; }; + 672C46632C47C74800497EF0 /* Provide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Provide.swift; sourceTree = "<group>"; }; + 672C46652C47C74C00497EF0 /* Inject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Inject.swift; sourceTree = "<group>"; }; + 672C46672C47C75100497EF0 /* Clear.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Clear.swift; sourceTree = "<group>"; }; + 672C468E2C47CB2000497EF0 /* UserDefaultsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsManager.swift; sourceTree = "<group>"; }; + 672C46902C47CB5D00497EF0 /* UserDefaultsKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsKeys.swift; sourceTree = "<group>"; }; + 672C46A52C47E8D700497EF0 /* DependencyManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DependencyManager.swift; sourceTree = "<group>"; }; + 672C46B72C47E98900497EF0 /* SettingsRepositoryProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsRepositoryProtocol.swift; sourceTree = "<group>"; }; + 672C46B92C47E98900497EF0 /* ChangeLanguageUseCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChangeLanguageUseCase.swift; sourceTree = "<group>"; }; + 672C46BA2C47E98900497EF0 /* GetLanguagesUseCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetLanguagesUseCase.swift; sourceTree = "<group>"; }; + 672C46BE2C47E98A00497EF0 /* SettingsDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsDataSource.swift; sourceTree = "<group>"; }; + 672C46C02C47E98A00497EF0 /* SupportedLanguage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SupportedLanguage.swift; sourceTree = "<group>"; }; + 672C46C22C47E98A00497EF0 /* SettingsRepository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsRepository.swift; sourceTree = "<group>"; }; + 672C46CB2C47E9AB00497EF0 /* GetLanguageUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetLanguageUseCase.swift; sourceTree = "<group>"; }; + 672C46CE2C47EA6D00497EF0 /* GetColorSchemeUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetColorSchemeUseCase.swift; sourceTree = "<group>"; }; + 672C46D02C47EA7400497EF0 /* ChangeColorSchemeUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeColorSchemeUseCase.swift; sourceTree = "<group>"; }; + 672C46D22C47EA8F00497EF0 /* SupportedColorScheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportedColorScheme.swift; sourceTree = "<group>"; }; + 672C46D42C47F8D000497EF0 /* HandleAppStartUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandleAppStartUseCase.swift; sourceTree = "<group>"; }; + 672C46D62C48006200497EF0 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; }; + 672C46D92C48018400497EF0 /* Color+Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Colors.swift"; sourceTree = "<group>"; }; + 672C46DB2C48018D00497EF0 /* UIColors+Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColors+Colors.swift"; sourceTree = "<group>"; }; + 67807F8B2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandleAppLanguageUseCase.swift; sourceTree = "<group>"; }; + 67807F942C49306C00D1F168 /* MainCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinator.swift; sourceTree = "<group>"; }; + 67807F982C49320100D1F168 /* MainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewModel.swift; sourceTree = "<group>"; }; + 67807F9A2C49325A00D1F168 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; }; + 67807F9F2C4934BD00D1F168 /* View+LayoutChanges.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+LayoutChanges.swift"; sourceTree = "<group>"; }; + 678BD70C2C4CF18300833DA5 /* CustomMenuPickerItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomMenuPickerItem.swift; sourceTree = "<group>"; }; + 678BD70E2C4CF1A000833DA5 /* CustomMenuPicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomMenuPicker.swift; sourceTree = "<group>"; }; + 678BD7102C4CF1EB00833DA5 /* SettingsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; }; + 678BD7112C4CF1EB00833DA5 /* SettingsViewCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewCoordinator.swift; sourceTree = "<group>"; }; + 678BD7122C4CF1EB00833DA5 /* SettingsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = "<group>"; }; + 678BD71C2C4D057200833DA5 /* UIImage+Images.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Images.swift"; sourceTree = "<group>"; }; + 678BD71E2C4D07B100833DA5 /* Image+Images.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Image+Images.swift"; sourceTree = "<group>"; }; E8AF4FB39674DF589D719DCF /* Pods-MiniScanner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MiniScanner.release.xcconfig"; path = "Target Support Files/Pods-MiniScanner/Pods-MiniScanner.release.xcconfig"; sourceTree = "<group>"; }; E9A37DC9F9A8E3AF632DFB98 /* Pods_MiniScanner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MiniScanner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EC0CF1FA254D8BBF00888722 /* MiniScanner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MiniScanner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -410,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>"; }; @@ -458,7 +510,6 @@ 53014F4B2C11A8E80071CE39 /* CustomWeScan */ = { isa = PBXGroup; children = ( - 53014F4C2C11A8E80071CE39 /* Localizable.strings */, 53014F4F2C11A8E80071CE39 /* ImageScannerController.swift */, 53014F522C11A8E80071CE39 /* Scan */, 53014F5C2C11A8E80071CE39 /* Extensions */, @@ -919,6 +970,191 @@ path = Fonts; sourceTree = "<group>"; }; + 672C46422C47B1E400497EF0 /* Localization */ = { + isa = PBXGroup; + children = ( + 672C46432C47B1F300497EF0 /* Localizable.xcstrings */, + ); + path = Localization; + sourceTree = "<group>"; + }; + 672C46602C47C70F00497EF0 /* DependencyInjection */ = { + isa = PBXGroup; + children = ( + 672C46612C47C74300497EF0 /* DependencyInjector.swift */, + 672C46632C47C74800497EF0 /* Provide.swift */, + 672C46652C47C74C00497EF0 /* Inject.swift */, + 672C46672C47C75100497EF0 /* Clear.swift */, + ); + path = DependencyInjection; + sourceTree = "<group>"; + }; + 672C468D2C47CB0D00497EF0 /* UserDefaults */ = { + isa = PBXGroup; + children = ( + 672C468E2C47CB2000497EF0 /* UserDefaultsManager.swift */, + 672C46902C47CB5D00497EF0 /* UserDefaultsKeys.swift */, + ); + path = UserDefaults; + sourceTree = "<group>"; + }; + 672C46A62C47E8D700497EF0 /* DI */ = { + isa = PBXGroup; + children = ( + 672C46A52C47E8D700497EF0 /* DependencyManager.swift */, + ); + path = DI; + sourceTree = "<group>"; + }; + 672C46AE2C47E8D700497EF0 /* Common */ = { + isa = PBXGroup; + children = ( + 672C46A62C47E8D700497EF0 /* DI */, + 672C46C42C47E98A00497EF0 /* Data */, + 672C46BD2C47E98900497EF0 /* Domain */, + 67807F972C49313C00D1F168 /* Presentation */, + ); + path = Common; + sourceTree = "<group>"; + }; + 672C46AF2C47E8D700497EF0 /* Features */ = { + isa = PBXGroup; + children = ( + 678BD7142C4CF1EB00833DA5 /* Settings */, + 672C46AE2C47E8D700497EF0 /* Common */, + ); + path = Features; + sourceTree = "<group>"; + }; + 672C46B82C47E98900497EF0 /* Repositories */ = { + isa = PBXGroup; + children = ( + 672C46B72C47E98900497EF0 /* SettingsRepositoryProtocol.swift */, + ); + path = Repositories; + sourceTree = "<group>"; + }; + 672C46BB2C47E98900497EF0 /* Language */ = { + isa = PBXGroup; + children = ( + 672C46B92C47E98900497EF0 /* ChangeLanguageUseCase.swift */, + 672C46BA2C47E98900497EF0 /* GetLanguagesUseCase.swift */, + 672C46CB2C47E9AB00497EF0 /* GetLanguageUseCase.swift */, + 67807F8B2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift */, + ); + path = Language; + sourceTree = "<group>"; + }; + 672C46BC2C47E98900497EF0 /* UseCases */ = { + isa = PBXGroup; + children = ( + 672C46CD2C47EA2A00497EF0 /* ColorScheme */, + 672C46BB2C47E98900497EF0 /* Language */, + 672C46D42C47F8D000497EF0 /* HandleAppStartUseCase.swift */, + ); + path = UseCases; + sourceTree = "<group>"; + }; + 672C46BD2C47E98900497EF0 /* Domain */ = { + isa = PBXGroup; + children = ( + 672C46B82C47E98900497EF0 /* Repositories */, + 672C46BC2C47E98900497EF0 /* UseCases */, + ); + path = Domain; + sourceTree = "<group>"; + }; + 672C46BF2C47E98A00497EF0 /* DataSources */ = { + isa = PBXGroup; + children = ( + 672C46BE2C47E98A00497EF0 /* SettingsDataSource.swift */, + ); + path = DataSources; + sourceTree = "<group>"; + }; + 672C46C12C47E98A00497EF0 /* Model */ = { + isa = PBXGroup; + children = ( + 678BD70C2C4CF18300833DA5 /* CustomMenuPickerItem.swift */, + 672C46C02C47E98A00497EF0 /* SupportedLanguage.swift */, + 672C46D22C47EA8F00497EF0 /* SupportedColorScheme.swift */, + ); + path = Model; + sourceTree = "<group>"; + }; + 672C46C32C47E98A00497EF0 /* Repositories */ = { + isa = PBXGroup; + children = ( + 672C46C22C47E98A00497EF0 /* SettingsRepository.swift */, + ); + path = Repositories; + sourceTree = "<group>"; + }; + 672C46C42C47E98A00497EF0 /* Data */ = { + isa = PBXGroup; + children = ( + 672C46C12C47E98A00497EF0 /* Model */, + 672C46BF2C47E98A00497EF0 /* DataSources */, + 672C46C32C47E98A00497EF0 /* Repositories */, + ); + path = Data; + sourceTree = "<group>"; + }; + 672C46CD2C47EA2A00497EF0 /* ColorScheme */ = { + isa = PBXGroup; + children = ( + 672C46CE2C47EA6D00497EF0 /* GetColorSchemeUseCase.swift */, + 672C46D02C47EA7400497EF0 /* ChangeColorSchemeUseCase.swift */, + ); + path = ColorScheme; + sourceTree = "<group>"; + }; + 672C46D82C48017C00497EF0 /* Style */ = { + isa = PBXGroup; + children = ( + 672C46D92C48018400497EF0 /* Color+Colors.swift */, + 672C46DB2C48018D00497EF0 /* UIColors+Colors.swift */, + ); + path = Style; + sourceTree = "<group>"; + }; + 67807F972C49313C00D1F168 /* Presentation */ = { + isa = PBXGroup; + children = ( + 678BD70E2C4CF1A000833DA5 /* CustomMenuPicker.swift */, + 67807F9A2C49325A00D1F168 /* MainView.swift */, + 67807F982C49320100D1F168 /* MainViewModel.swift */, + 67807F942C49306C00D1F168 /* MainCoordinator.swift */, + ); + path = Presentation; + sourceTree = "<group>"; + }; + 67807F9C2C49348B00D1F168 /* View */ = { + isa = PBXGroup; + children = ( + 67807F9F2C4934BD00D1F168 /* View+LayoutChanges.swift */, + ); + path = View; + sourceTree = "<group>"; + }; + 678BD7132C4CF1EB00833DA5 /* Presentation */ = { + isa = PBXGroup; + children = ( + 678BD7102C4CF1EB00833DA5 /* SettingsView.swift */, + 678BD7112C4CF1EB00833DA5 /* SettingsViewCoordinator.swift */, + 678BD7122C4CF1EB00833DA5 /* SettingsViewModel.swift */, + ); + path = Presentation; + sourceTree = "<group>"; + }; + 678BD7142C4CF1EB00833DA5 /* Settings */ = { + isa = PBXGroup; + children = ( + 678BD7132C4CF1EB00833DA5 /* Presentation */, + ); + path = Settings; + sourceTree = "<group>"; + }; 98E49D3F46C8E62718825860 /* Pods */ = { isa = PBXGroup; children = ( @@ -949,6 +1185,8 @@ EC0CF1FC254D8BBF00888722 /* MiniScanner */ = { isa = PBXGroup; children = ( + 672C46AF2C47E8D700497EF0 /* Features */, + 672C46602C47C70F00497EF0 /* DependencyInjection */, EC702548254E1F9F00BE1958 /* Managers */, 535983F02C144E79003EB6ED /* Helpers */, EC8A9B0A254DC2FD00F9AF99 /* Extensions */, @@ -959,21 +1197,10 @@ 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 = ( + 672C468D2C47CB0D00497EF0 /* UserDefaults */, EC8A9B0F254DC6DD00F9AF99 /* PDFManager.swift */, EC8A9B13254DC9D300F9AF99 /* LocalFileManager.swift */, ECD43ED525A7BA9500B5A3F2 /* ThemeManager.swift */, @@ -1006,6 +1233,11 @@ EC8A9B0A254DC2FD00F9AF99 /* Extensions */ = { isa = PBXGroup; children = ( + 67807F9C2C49348B00D1F168 /* View */, + 672C46D82C48017C00497EF0 /* Style */, + 672C46492C47BD8800497EF0 /* String+StringKeys.swift */, + 678BD71C2C4D057200833DA5 /* UIImage+Images.swift */, + 678BD71E2C4D07B100833DA5 /* Image+Images.swift */, EC0CF21C254D8F3900888722 /* String+Extensions.swift */, EC8A9AFF254DBFC600F9AF99 /* UserDefaults+Extensions.swift */, EC8A9B19254DCE3E00F9AF99 /* UIImage+Extensions.swift */, @@ -1027,6 +1259,7 @@ EC8A9B0C254DC30800F9AF99 /* Supporting Files */ = { isa = PBXGroup; children = ( + 672C46422C47B1E400497EF0 /* Localization */, 53A4788B2C35BB700073E956 /* Frameworks */, 539EF14D2C2AA43B0041AE1F /* ara.traineddata */, 539996552C27124B00671340 /* FontChooserContainerView.swift */, @@ -1034,6 +1267,7 @@ 53D9D1C12C1AF521004D1C1C /* MyExtention.swift */, 53F21F932C1377B900172BFC /* Fonts */, EC0CF206254D8BC000888722 /* Assets.xcassets */, + 672C46D62C48006200497EF0 /* Colors.xcassets */, EC0CF1FD254D8BBF00888722 /* AppDelegate.swift */, EC0CF1FF254D8BBF00888722 /* SceneDelegate.swift */, EC0CF208254D8BC000888722 /* LaunchScreen.storyboard */, @@ -1062,7 +1296,6 @@ ECE9BBB2254E331700D45E43 /* Walktrough */, EC8A9B06254DC2EE00F9AF99 /* Documents */, EC8A9B2C254DE94900F9AF99 /* DocumentPreview */, - EC70252F254E066E00BE1958 /* Settings */, ); path = Modules; sourceTree = "<group>"; @@ -1131,12 +1364,7 @@ knownRegions = ( en, Base, - de, - "zh-Hans", - it, - "zh-Hant", - fr, - "pt-PT", + ar, ); mainGroup = EC0CF1F1254D8BBF00888722; packageReferences = ( @@ -1161,6 +1389,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 672C46D72C48006200497EF0 /* Colors.xcassets in Resources */, 5359841B2C145E55003EB6ED /* DocumentsTableViewCell.xib in Resources */, 53014FAD2C11A8E80071CE39 /* rotate.png in Resources */, 53014FB02C11A8E80071CE39 /* flashUnavailable@2x.png in Resources */, @@ -1186,7 +1415,7 @@ 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 */, 539996352C26D41300671340 /* OCRViewController.xib in Resources */, @@ -1196,7 +1425,6 @@ 53BEB1482C2968F8005A3567 /* FolderSelectCollectionViewCell.xib in Resources */, 53F21F9F2C1377B900172BFC /* Tajawal-Regular.ttf in Resources */, 53014FB12C11A8E80071CE39 /* flashUnavailable.png in Resources */, - 53014F8D2C11A8E80071CE39 /* Localizable.strings in Resources */, EC702541254E1E7500BE1958 /* ClassicWalkthroughViewController.xib in Resources */, 53F21F922C1248EC00172BFC /* FolderCollectionViewCell.xib in Resources */, ECA1FAA1254DEA6A0081F00B /* DocumentPreview.storyboard in Resources */, @@ -1268,24 +1496,29 @@ 539996922C27130000671340 /* ConstraintLayoutGuide.swift in Sources */, 539996A32C27130000671340 /* ConstraintLayoutSupportDSL.swift in Sources */, 53D9D1C52C1AF521004D1C1C /* MyExtention.swift in Sources */, + 672C46DC2C48018D00497EF0 /* UIColors+Colors.swift in Sources */, + 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 */, + 672C46DA2C48018400497EF0 /* Color+Colors.swift in Sources */, 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 */, 5399969E2C27130000671340 /* Debugging.swift in Sources */, + 672C46682C47C75100497EF0 /* Clear.swift in Sources */, + 672C46912C47CB5D00497EF0 /* UserDefaultsKeys.swift in Sources */, 5399968E2C27130000671340 /* ConstraintMakerRelatable+Extensions.swift in Sources */, 539996512C26E86700671340 /* DefaultValues.m in Sources */, 53014FA42C11A8E80071CE39 /* EditScanViewController.swift in Sources */, 53E7D33C2C1B00880025A1D3 /* FSPagerCollectionView.swift in Sources */, EC8A9B1A254DCE3E00F9AF99 /* UIImage+Extensions.swift in Sources */, + 672C46CC2C47E9AB00497EF0 /* GetLanguageUseCase.swift in Sources */, 53014FB72C11A8E80071CE39 /* CaptureDevice.swift in Sources */, 5399968D2C27130000671340 /* ConstraintDirectionalInsetTarget.swift in Sources */, 53014F8F2C11A8E80071CE39 /* RectangleFeaturesFunnel.swift in Sources */, @@ -1301,7 +1534,9 @@ 535983EF2C142C9F003EB6ED /* Localization.swift in Sources */, 539996892C27130000671340 /* ConstraintDSL.swift in Sources */, 539996952C27130000671340 /* ConstraintConstantTarget.swift in Sources */, + 672C46622C47C74300497EF0 /* DependencyInjector.swift in Sources */, 539996902C27130000671340 /* UILayoutSupport+Extensions.swift in Sources */, + 67807F952C49306C00D1F168 /* MainCoordinator.swift in Sources */, 53014F992C11A8E80071CE39 /* CGPoint+Utils.swift in Sources */, 53E7D3392C1B00880025A1D3 /* FSPageViewLayout.swift in Sources */, 53BEB1422C2967E0005A3567 /* FoldersViewController.swift in Sources */, @@ -1312,27 +1547,39 @@ 53014FA82C11A8E80071CE39 /* CIRectangleDetector.swift in Sources */, EC8A9AD5254DB76000F9AF99 /* BaseNavigationViewController.swift in Sources */, 535983EB2C142B16003EB6ED /* UILabel+Extensions.swift in Sources */, + 678BD7172C4CF1EB00833DA5 /* SettingsViewModel.swift in Sources */, EC8A9B10254DC6DD00F9AF99 /* PDFManager.swift in Sources */, 5399964B2C26E86700671340 /* FlashButton.m in Sources */, 5399968C2C27130000671340 /* ConstraintInsetTarget.swift in Sources */, ECE9BBAA254E295900D45E43 /* Date+Extensions.swift in Sources */, 53014FA92C11A8E80071CE39 /* QuadrilateralView.swift in Sources */, 539996802C27130000671340 /* ConstraintMultiplierTarget.swift in Sources */, + 672C468F2C47CB2000497EF0 /* UserDefaultsManager.swift in Sources */, + 672C46642C47C74800497EF0 /* Provide.swift in Sources */, 53CD5F562C1503150010424B /* BMViewController.swift in Sources */, + 672C46C92C47E98A00497EF0 /* SupportedLanguage.swift in Sources */, + 672C46C72C47E98A00497EF0 /* GetLanguagesUseCase.swift in Sources */, 539996822C27130000671340 /* ConstraintDescription.swift in Sources */, EC702546254E1E9E00BE1958 /* WalkthroughModel.swift in Sources */, 53D9D1C22C1AF521004D1C1C /* StickerView.swift in Sources */, + 672C46D52C47F8D000497EF0 /* HandleAppStartUseCase.swift in Sources */, + 67807FA02C4934BD00D1F168 /* View+LayoutChanges.swift in Sources */, 539996A22C27130000671340 /* ConstraintDirectionalInsets.swift in Sources */, 53E7D3352C1B00880025A1D3 /* FSPagerView.swift in Sources */, + 672C46B32C47E8D700497EF0 /* DependencyManager.swift in Sources */, + 672C46D32C47EA8F00497EF0 /* SupportedColorScheme.swift in Sources */, 53014F912C11A8E80071CE39 /* ShutterButton.swift in Sources */, + 672C46CF2C47EA6D00497EF0 /* GetColorSchemeUseCase.swift in Sources */, 53F21F8B2C1246AF00172BFC /* AllFolderTableViewCell.swift in Sources */, 53014FBD2C11A8E80071CE39 /* CaptureSession+Focus.swift in Sources */, 5399969C2C27130000671340 /* ConstraintItem.swift in Sources */, 53014F982C11A8E80071CE39 /* URL+Utils.swift in Sources */, EC8A9B00254DBFC700F9AF99 /* UserDefaults+Extensions.swift in Sources */, + 672C46C82C47E98A00497EF0 /* SettingsDataSource.swift in Sources */, 53CD5F5C2C1505A20010424B /* Globals.swift in Sources */, EC8A9B03254DC08800F9AF99 /* NSNotification+Extensions.swift in Sources */, 539996492C26E86700671340 /* CDCameraOverlayView.m in Sources */, + 678BD70D2C4CF18300833DA5 /* CustomMenuPickerItem.swift in Sources */, 5359841A2C145E55003EB6ED /* DocumentsTableViewCell.swift in Sources */, EC702522254DF13200BE1958 /* PencilKitViewController.swift in Sources */, 5399968F2C27130000671340 /* ConstraintConfig.swift in Sources */, @@ -1343,17 +1590,19 @@ 53014FA32C11A8E80071CE39 /* ZoomGestureController.swift in Sources */, 5399964C2C26E86700671340 /* CDCameraView.m in Sources */, 5399969B2C27130000671340 /* ConstraintView+Extensions.swift in Sources */, + 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 */, 53014F9B2C11A8E80071CE39 /* CGAffineTransform+Utils.swift in Sources */, 53014FBC2C11A8E80071CE39 /* CaptureSession.swift in Sources */, + 672C46D12C47EA7400497EF0 /* ChangeColorSchemeUseCase.swift in Sources */, 539996852C27130000671340 /* ConstraintViewDSL.swift in Sources */, EC702542254E1E7500BE1958 /* ClassicWalkthroughViewController.swift in Sources */, 539996882C27130000671340 /* ConstraintMakerFinalizable.swift in Sources */, + 672C46C52C47E98A00497EF0 /* SettingsRepositoryProtocol.swift in Sources */, 53EDED9D2C183CDF00DB8DF9 /* BannerView.swift in Sources */, 5399969A2C27130000671340 /* ConstraintLayoutGuideDSL.swift in Sources */, 53014F922C11A8E80071CE39 /* ScannedItemRenderer.swift in Sources */, @@ -1362,31 +1611,37 @@ 53014FBA2C11A8E80071CE39 /* CaptureSession+Flash.swift in Sources */, 539996572C27124B00671340 /* FontChooserContainerView.swift in Sources */, 53014F952C11A8E80071CE39 /* FocusRectangleView.swift in Sources */, + 672C46C62C47E98A00497EF0 /* ChangeLanguageUseCase.swift in Sources */, 53014F9E2C11A8E80071CE39 /* UIImage+Orientation.swift in Sources */, 53014FB82C11A8E80071CE39 /* Transformable.swift in Sources */, 53014FA22C11A8E80071CE39 /* ScannedPageViewController.swift in Sources */, + 67807F9B2C49325A00D1F168 /* MainView.swift in Sources */, 5399969D2C27130000671340 /* Constraint.swift in Sources */, EC8A9B1D254DCEC600F9AF99 /* File.swift in Sources */, + 67807F8C2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift in Sources */, 53E7D33A2C1B00880025A1D3 /* FSPageControl.swift in Sources */, EC8A9B24254DE72F00F9AF99 /* UIView+Extensions.swift in Sources */, EC0CF200254D8BBF00888722 /* SceneDelegate.swift in Sources */, 53014FBB2C11A8E80071CE39 /* CaptureSession+Orientation.swift in Sources */, 53014F942C11A8E80071CE39 /* DeviceOrientationHelper.swift in Sources */, EC8A9B27254DE91B00F9AF99 /* DocumentPreviewViewController.swift in Sources */, + 67807F992C49320100D1F168 /* MainViewModel.swift in Sources */, 5399964A2C26E86700671340 /* CropperConstantValues.m in Sources */, 53014F9F2C11A8E80071CE39 /* UIImage+Utils.swift in Sources */, 53CD5F582C1504CF0010424B /* UIButton+Extensions.swift in Sources */, + 672C46CA2C47E98A00497EF0 /* SettingsRepository.swift in Sources */, 539D1C8B2C16E97F009DB24A /* ShareSheetViewController.swift in Sources */, 539996A12C27130000671340 /* ConstraintLayoutGuide+Extensions.swift in Sources */, + 672C464A2C47BD8800497EF0 /* String+StringKeys.swift in Sources */, 53014F962C11A8E80071CE39 /* ScannerViewController.swift in Sources */, 53014FA52C11A8E80071CE39 /* EditScanCornerView.swift in Sources */, 53E7D3382C1B00880025A1D3 /* FSPagerViewLayoutAttributes.swift in Sources */, 53014F8E2C11A8E80071CE39 /* ImageScannerController.swift in Sources */, 539996A42C27130000671340 /* ConstraintMakerRelatable.swift in Sources */, + 678BD7162C4CF1EB00833DA5 /* SettingsViewCoordinator.swift in Sources */, 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 */, @@ -1401,27 +1656,15 @@ 53014F9C2C11A8E80071CE39 /* CGRect+Utils.swift in Sources */, 539996842C27130000671340 /* ConstraintAttributes.swift in Sources */, 53EDEDA32C183FFF00DB8DF9 /* PagerImageCollectionViewCell.swift in Sources */, + 678BD70F2C4CF1A000833DA5 /* CustomMenuPicker.swift in Sources */, 53014FA12C11A8E80071CE39 /* MultiPageScanSessionViewController.swift in Sources */, + 678BD71F2C4D07B100833DA5 /* Image+Images.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 53014F4C2C11A8E80071CE39 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 53014F4D2C11A8E80071CE39 /* de */, - 53014F4E2C11A8E80071CE39 /* zh-Hans */, - 53014F502C11A8E80071CE39 /* en */, - 53014F512C11A8E80071CE39 /* it */, - 53014F5B2C11A8E80071CE39 /* zh-Hant */, - 53014F752C11A8E80071CE39 /* fr */, - 53014F762C11A8E80071CE39 /* pt-PT */, - ); - name = Localizable.strings; - sourceTree = "<group>"; - }; EC0CF208254D8BC000888722 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -1437,6 +1680,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1499,6 +1743,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1559,7 +1804,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = Z7STA3KGEU; + DEVELOPMENT_TEAM = GS4JW4VCWQ; INFOPLIST_FILE = "MiniScanner/Supporting Files/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = BeezScanner123; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; @@ -1588,7 +1833,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = Z7STA3KGEU; + DEVELOPMENT_TEAM = GS4JW4VCWQ; INFOPLIST_FILE = "MiniScanner/Supporting Files/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = BeezScanner123; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business"; diff --git a/MiniScanner/Common/AppTabBarController.swift b/MiniScanner/Common/AppTabBarController.swift index 192e8ba5963713d42049d8df10bb3ee538f276b8..ae7a3e4c4605531c84051075790af26a03a6ef1d 100644 --- a/MiniScanner/Common/AppTabBarController.swift +++ b/MiniScanner/Common/AppTabBarController.swift @@ -122,8 +122,7 @@ class AppTabBar: UITabBar { } @objc private func setupMiddleButton() { - let image = UIImage(named: "add_doc_icon") - middleButton.setImage(image, for: UIControl.State.normal) + middleButton.setImage(.addDocIcon, for: UIControl.State.normal) middleButton.contentVerticalAlignment = .fill middleButton.contentHorizontalAlignment = .fill middleButton.imageEdgeInsets = .zero diff --git a/MiniScanner/DependencyInjection/Clear.swift b/MiniScanner/DependencyInjection/Clear.swift new file mode 100644 index 0000000000000000000000000000000000000000..b0b6a0a4cc7059201c8cefa3d020823b95fdf9e0 --- /dev/null +++ b/MiniScanner/DependencyInjection/Clear.swift @@ -0,0 +1,19 @@ +// +// Clear.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +@propertyWrapper struct Clear<T> { + + var wrappedValue: T + + init() { + self.wrappedValue = DependencyInjector.resolve() + DependencyInjector.clear(dependency: wrappedValue) + } +} diff --git a/MiniScanner/DependencyInjection/DependencyInjector.swift b/MiniScanner/DependencyInjection/DependencyInjector.swift new file mode 100644 index 0000000000000000000000000000000000000000..350a6a0a4b2b87911efdff530d4863a628825389 --- /dev/null +++ b/MiniScanner/DependencyInjection/DependencyInjector.swift @@ -0,0 +1,29 @@ +// +// DependencyInjector.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +struct DependencyInjector { + + private static var dependencyList: [String: Any] = [:] + + static func resolve<T>() -> T { + guard let t = dependencyList[String(describing: T.self)] as? T else { + fatalError("No provider registerd for type: \(T.self)") + } + return t + } + + static func register<T>(dependency: T) { + dependencyList[String(describing: T.self)] = dependency + } + + static func clear<T>(dependency: T) { + dependencyList.removeValue(forKey: String(describing: T.self)) + } +} diff --git a/MiniScanner/DependencyInjection/Inject.swift b/MiniScanner/DependencyInjection/Inject.swift new file mode 100644 index 0000000000000000000000000000000000000000..814c260196f925a6bc7831d1c2e1c08acfcd7ade --- /dev/null +++ b/MiniScanner/DependencyInjection/Inject.swift @@ -0,0 +1,18 @@ +// +// Inject.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +@propertyWrapper struct Inject<T> { + + var wrappedValue: T + + init() { + self.wrappedValue = DependencyInjector.resolve() + } +} diff --git a/MiniScanner/DependencyInjection/Provide.swift b/MiniScanner/DependencyInjection/Provide.swift new file mode 100644 index 0000000000000000000000000000000000000000..80046e2bd09dadcd75e333201adafc11e3db4bdc --- /dev/null +++ b/MiniScanner/DependencyInjection/Provide.swift @@ -0,0 +1,19 @@ +// +// Provide.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +@propertyWrapper struct Provide<T> { + + var wrappedValue: T + + init(wrappedValue: T) { + self.wrappedValue = wrappedValue + DependencyInjector.register(dependency: wrappedValue) + } +} diff --git a/MiniScanner/Extensions/Image+Images.swift b/MiniScanner/Extensions/Image+Images.swift new file mode 100644 index 0000000000000000000000000000000000000000..f4616a77478f82bf332844e031a6ceb71ff5787f --- /dev/null +++ b/MiniScanner/Extensions/Image+Images.swift @@ -0,0 +1,20 @@ +// +// Image+Images.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/21/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +// MARK: - App images and icons +extension Image { + +} + +// MARK: - Common system images and icons +extension Image { + + static let chevronBackward = Image(systemName: "chevron.backward") +} diff --git a/MiniScanner/Extensions/Localization.swift b/MiniScanner/Extensions/Localization.swift index b5f544f00b7af6ae62a04fcd402e699586407d0c..23af00f370706727063069875dcd0ecd2194139e 100644 --- a/MiniScanner/Extensions/Localization.swift +++ b/MiniScanner/Extensions/Localization.swift @@ -22,22 +22,28 @@ extension String { static let ar = "ar-KW" var localized: String { - var language = "" +// var language = "" - if LanguageManager.shared.currentLanguage == .en { - language = "en" - } else { - language = "ar-KW" - } - - guard let bundle = Bundle.main.path(forResource: language, ofType: "lproj") else { - return NSLocalizedString(self, comment: "") - } - - if let langBundle = Bundle(path: bundle) { - return NSLocalizedString(self, tableName: nil, bundle: langBundle, comment: "") - } - - return NSLocalizedString(self, comment: "") + return localiz() +// +// if LanguageManager.shared.currentLanguage == .en { +// language = "en" +// } else { +// language = "ar" +// } +// +// guard let bundle = Bundle.main.path(forResource: language, ofType: "lproj") else { +// return NSLocalizedString(self, comment: "") +// } +// +// if let langBundle = Bundle(path: bundle) { +// return NSLocalizedString(self, tableName: nil, bundle: langBundle, comment: "") +// } +// +// return NSLocalizedString(self, comment: "") + } + + func localizedPlural(argument: CVarArg) -> String { + String.localizedStringWithFormat(localized, [argument]) } } diff --git a/MiniScanner/Extensions/String+Extensions.swift b/MiniScanner/Extensions/String+Extensions.swift index 0cabe0d8a0decc285c4f9e866e9f9fbb7169d0bc..ba09149955598c6f513414c6123cbf336c1c671a 100644 --- a/MiniScanner/Extensions/String+Extensions.swift +++ b/MiniScanner/Extensions/String+Extensions.swift @@ -16,7 +16,7 @@ extension String { } static func getDocumentName() -> String { - return "Scan".localized + " " + date() + ".pdf" + return .scan.localized + " " + date() + ".pdf" } static func date(_ date: Date = Date()) -> String { diff --git a/MiniScanner/Extensions/String+StringKeys.swift b/MiniScanner/Extensions/String+StringKeys.swift new file mode 100644 index 0000000000000000000000000000000000000000..5230e97cf2a93d367cc05bb850cca81c4009f00f --- /dev/null +++ b/MiniScanner/Extensions/String+StringKeys.swift @@ -0,0 +1,103 @@ +// +// String+StringKeys.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +extension String { + + static let today = "today" + static let yesterday = "yesterday" + static let thisWeek = "this_week" + + static let scan = "scan" + + static let discard = "discard" + static let cancel = "cancel" + static let delete = "delete" + static let rename = "rename" + static let move = "move" + + static let renameDocument = "rename_document" + static let deleteDocument = "delete_document" + + static let camera = "camera" + static let gallery = "gallery" + + static let areYouSure = "are_you_sure" + + static let currentPage = "current_page" + + static let entireDocument = "entire_document" + + static let discardScannerMsg = "discard_scanner_msg" + + static let addFolder = "add_folder" + static let addFolderMessage = "add_folder_message" + + static let deleteDocumentMsg = "delete_document_msg" + static let yesDelete = "yes_delete" + + static let whatsapp = "whatsapp" + static let telegram = "telegram" + static let gmail = "gmail" + static let print = "print" + static let more = "more" + + static let fileName = "file_name" + + static let yes = "yes" + static let no = "no" + + static let fileManager = "file_manager" + static let folders = "folders" + static let folderFiles = "folder_files" + static let noFilesToShow = "no_files_to_show" + static let folderName = "folder_name" + static let preview = "preview" + static let done = "done" + + static let settings = "settings" + + static let language = "language" + static let appTheme = "app_theme" + + static let appearence = "appearence" + static let deviceLanguage = "device_language" + static let deviceTheme = "device_theme" + static let darkMode = "dark_mode" + static let lightMode = "light_mode" + + static let Continue = "continue" + static let back = "back" + + static let alert = "alert" + static let discardChangesMsg = "discard_changes_msg" + static let discardChangesAndContinueMsg = "discard_changes_and_continue_msg" + + static let deleteImageMsg = "delete_image_msg" + static let ok = "ok" + + static let dPages = "%d pages" + + static let directShare = "direct_share" + static let crop = "crop" + static let edit = "edit" + static let exportText = "export_text" + static let signature = "signature" + + static let copy = "copy" + static let copiedToClipboard = "copied_to_clipboard" + static let signMsg = "sign_msg" + static let allDocument = "all_document" + static let add = "add" + + static let allDocuments = "all_documents" + static let passports = "passports" + static let contracts = "contracts" + static let identifiers = "identifiers" +} diff --git a/MiniScanner/Extensions/Style/Color+Colors.swift b/MiniScanner/Extensions/Style/Color+Colors.swift new file mode 100644 index 0000000000000000000000000000000000000000..19fcea8875aacfa3d447f657ae509d3f39f6d3a5 --- /dev/null +++ b/MiniScanner/Extensions/Style/Color+Colors.swift @@ -0,0 +1,25 @@ +// +// Color+Colors.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +extension Color { + + static let tintColor = Color(.tint) + static let barTintColor = Color(.barTint) + + static let buttonsBlue = Color(.buttonsBlue) + static let cellBackground = Color(.cellBackground) + static let lightButton = Color(.lightButton) + static let mainBlue = Color(.mainBlue) + static let mainText = Color(.mainText) + static let separator = Color(.separator) + static let titlesText = Color(.titlesText) + + static let mainBackground = Color(.mainBackground) +} diff --git a/MiniScanner/Extensions/Style/UIColors+Colors.swift b/MiniScanner/Extensions/Style/UIColors+Colors.swift new file mode 100644 index 0000000000000000000000000000000000000000..1ba2f2d63cc95bb1871a9f2918d8b8d5edd49bfd --- /dev/null +++ b/MiniScanner/Extensions/Style/UIColors+Colors.swift @@ -0,0 +1,25 @@ +// +// UIColors+Colors.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import UIKit + +extension UIColor { + + static let tintColor = UIColor(resource: .tint) + static let barTintColor = UIColor(resource: .barTint) + + static let buttonsBlue = UIColor(resource: .buttonsBlue) + static let cellBackground = UIColor(resource: .cellBackground) + static let lightButton = UIColor(resource: .lightButton) + static let mainBlue = UIColor(resource: .mainBlue) + static let mainText = UIColor(resource: .mainText) + static let separator = UIColor(resource: .separator) + static let titlesText = UIColor(resource: .titlesText) + + static let mainBackground = UIColor(resource: .mainBackground) +} diff --git a/MiniScanner/Extensions/UIColor+Extensions.swift b/MiniScanner/Extensions/UIColor+Extensions.swift index 59668df813191fed8d47d47f229480dec056d816..2c964a0301b2583c87b64d14894e61ca37c0682d 100644 --- a/MiniScanner/Extensions/UIColor+Extensions.swift +++ b/MiniScanner/Extensions/UIColor+Extensions.swift @@ -9,16 +9,6 @@ import Foundation import UIKit -extension UIColor { - static let mainBlue = hex("#007EFF") - static let buttonsBlue = hex("#1F86FF") - static let mainText = hex("#505050") - static let titlesText = hex("#888888") - static let cellBackground = hex("#F4F4F4") - static let lightButton = hex("#E9EDF2") - static let separator = hex("#646464") -} - extension UIColor { /** Creates an UIColor from HEX String in "#363636" format diff --git a/MiniScanner/Extensions/UIFont+Extensions.swift b/MiniScanner/Extensions/UIFont+Extensions.swift index faf282ea5c0a916efcbc9461b8dc2cbe43dd7f63..be5be8a48dca22cd42c37264658426dd210ba33b 100644 --- a/MiniScanner/Extensions/UIFont+Extensions.swift +++ b/MiniScanner/Extensions/UIFont+Extensions.swift @@ -36,24 +36,49 @@ extension UIFont { case extralight = "Tajawal-ExtraLight" } + static let fonts: [SupportedLanguage: [UIFont.AppFont: String]] = { + let arabic = UIFont.AppFont.Arabic.self + let english = UIFont.AppFont.English.self + + var fonts: [SupportedLanguage: [UIFont.AppFont: String]] = [:] + + fonts[.english] = [.extrabold: english.bold.rawValue, + .bold: english.bold.rawValue, + .black: english.bold.rawValue, + .medium: english.medium.rawValue, + .regular: english.regular.rawValue, + .light: english.regular.rawValue, + .extralight: english.regular.rawValue] + + fonts[.arabic] = [.extrabold: arabic.extrabold.rawValue, + .bold: arabic.bold.rawValue, + .black: arabic.black.rawValue, + .medium: arabic.medium.rawValue, + .regular: arabic.regular.rawValue, + .light: arabic.light.rawValue, + .extralight: arabic.extralight.rawValue] + return fonts + }() + func font() -> String { - switch self { - case .bold: - return lang == .en ? English.bold.rawValue : Arabic.bold.rawValue - case .regular: - return lang == .en ? English.regular.rawValue : Arabic.regular.rawValue - case .medium: - return lang == .en ? English.medium.rawValue : Arabic.medium.rawValue - case .light: - return lang == .en ? English.regular.rawValue : Arabic.light.rawValue - case .extrabold: - return lang == .en ? English.bold.rawValue : Arabic.extrabold.rawValue - case .black: - return lang == .en ? English.bold.rawValue : Arabic.black.rawValue - case .extralight: - return lang == .en ? English.regular.rawValue : Arabic.extralight.rawValue - - } + return UIFont.AppFont.fonts[SupportedLanguage.currentLanguage]![self]! + +// switch self { +// case .bold: +// return lang == .english ? English.bold.rawValue : Arabic.bold.rawValue +// case .regular: +// return lang == .english ? English.regular.rawValue : Arabic.regular.rawValue +// case .medium: +// return lang == .english ? English.medium.rawValue : Arabic.medium.rawValue +// case .light: +// return lang == .english ? English.regular.rawValue : Arabic.light.rawValue +// case .extrabold: +// return lang == .english ? English.bold.rawValue : Arabic.extrabold.rawValue +// case .black: +// return lang == .english ? English.bold.rawValue : Arabic.black.rawValue +// case .extralight: +// return lang == .english ? English.regular.rawValue : Arabic.extralight.rawValue +// } } } } diff --git a/MiniScanner/Extensions/UIImage+Images.swift b/MiniScanner/Extensions/UIImage+Images.swift new file mode 100644 index 0000000000000000000000000000000000000000..c5a50a639a893edbdcd7cddc6fc27fd4f7adc4c5 --- /dev/null +++ b/MiniScanner/Extensions/UIImage+Images.swift @@ -0,0 +1,42 @@ +// +// UIImage+Images.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/21/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import UIKit + +// MARK: - App images and icons +extension UIImage { + + static let addDocIcon = UIImage(resource: .addDocIcon) + static let preview = UIImage(resource: .preview) + + static let tabbarIPad = UIImage(resource: .tabbarIpad) + static let tabBar = UIImage(resource: .tabBar) + + static let settings = UIImage(resource: .settings) + + static let resize = UIImage(resource: .resize) + + static let close = UIImage(resource: .close) +} + +// MARK: - Common system images and icons +extension UIImage { + + static let chevronLeft = UIImage(systemName: "chevron.left") + static let chevronRight = UIImage(systemName: "chevron.right") + + static let trash = UIImage(systemName: "trash") + static let trashFill = UIImage(systemName: "trash.fill") + + static let squareAndPencil = UIImage(systemName: "square.and.pencil") + + static let eye = UIImage(systemName: "eye") + + static let camera = UIImage(systemName: "camera") + static let photo = UIImage(systemName: "photo") +} diff --git a/MiniScanner/Extensions/UILabel+Extensions.swift b/MiniScanner/Extensions/UILabel+Extensions.swift index 13d101874e380c629a25d40bf6d7204c621c7899..acd05c76299878688aef05982c8010fda1a3ccd3 100644 --- a/MiniScanner/Extensions/UILabel+Extensions.swift +++ b/MiniScanner/Extensions/UILabel+Extensions.swift @@ -65,7 +65,7 @@ extension UILabel { // MARK: - Alignment func alignment() { - textAlignment = lang == .en ? .left : .right + textAlignment = SupportedLanguage.currentLanguage.isRTL ? .right : .left } func align(to alignment: NSTextAlignment) { diff --git a/MiniScanner/Extensions/URL+Extensions.swift b/MiniScanner/Extensions/URL+Extensions.swift index c3b5145533c7c4d5b85c904a9aa5ba132f7d2563..28a471120ab4048b93580d7f544e66ca2b783d9e 100644 --- a/MiniScanner/Extensions/URL+Extensions.swift +++ b/MiniScanner/Extensions/URL+Extensions.swift @@ -37,11 +37,11 @@ extension URL { if let attributes = attributes, let fileDate = attributes[FileAttributeKey.creationDate] as? Date { if Calendar.current.isDateInToday(fileDate) { - stringDate = "Today".localized + stringDate = .today.localized } else if Calendar.current.isDateInYesterday(fileDate) { - stringDate = "Yesterday".localized + stringDate = .yesterday.localized } else if Date().isSameWeekAsDate(fileDate) { - stringDate = "This week".localized + stringDate = .thisWeek.localized } else { stringDate = getDateInCurrentLocaleWithHour(fileDate) } @@ -52,7 +52,7 @@ extension URL { /// This function will return a current date in format ""Jan 23, 2017, 14:59:09"" private func getDateInCurrentLocaleWithHour(_ date: Date = Date()) -> String { - let currentLocale = Locale.current + let currentLocale = SupportedLanguage.currentLanguage.locale let dateFormatter = DateFormatter() let dateComponents = "y-MMM-d - H'-'ms" let dateFormat = DateFormatter.dateFormat(fromTemplate: dateComponents, options: 0, locale: currentLocale) diff --git a/MiniScanner/Extensions/View/View+LayoutChanges.swift b/MiniScanner/Extensions/View/View+LayoutChanges.swift new file mode 100644 index 0000000000000000000000000000000000000000..8c57593d7c024d0ee664cc26a1729a59d078399d --- /dev/null +++ b/MiniScanner/Extensions/View/View+LayoutChanges.swift @@ -0,0 +1,38 @@ +// +// View+LayoutChanges.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +struct LayoutChangesModifier: ViewModifier { + + @State var layoutDirection: LayoutDirection = .leftToRight + + @Inject var getLanguageUseCase: GetLanguageUseCase + + func body(content: Content) -> some View { + + content + .onAppear { + updateLayoutDirection() + } + .environment(\.layoutDirection, layoutDirection) + } + + private func updateLayoutDirection() { + let language = getLanguageUseCase.execute() + layoutDirection = language.layoutDirection + } +} + +extension View { + + func handleLayoutChanges() -> some View { + ModifiedContent(content: self, + modifier: LayoutChangesModifier()) + } +} diff --git a/MiniScanner/Features/Common/DI/DependencyManager.swift b/MiniScanner/Features/Common/DI/DependencyManager.swift new file mode 100644 index 0000000000000000000000000000000000000000..795688ca726f027222b858a6f01bc6ade8d8340d --- /dev/null +++ b/MiniScanner/Features/Common/DI/DependencyManager.swift @@ -0,0 +1,40 @@ +// +// DependencyManager.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +final class DependencyManager { + + let userDefaultsManager: UserDefaultsManagerProtocol + + init() { + self.userDefaultsManager = UserDefaultsManager() + initializeDependencies() + } + + private func initializeDependencies() { + initializeSettingsDependencies() + } + + private func initializeSettingsDependencies() { + + let dataSource = SettingsDataSource(userDefaultsManager: userDefaultsManager) + let repository = SettingsRepository(dataSource: dataSource) + + @Provide var getLanguagesUseCase = GetLanguagesUseCase(repository: repository) + @Provide var getLanguageUseCase = GetLanguageUseCase(repository: repository) + @Provide var changeLanguageUseCase = ChangeLanguageUseCase(repository: repository) + + @Provide var getColorSchemeUseCase = GetColorSchemeUseCase(repository: repository) + @Provide var changeColorSchemeUseCase = ChangeColorSchemeUseCase(repository: repository) + + @Provide var handleAppStartUseCase = HandleAppStartUseCase(repository: repository) + + @Provide var handleAppLanguageUseCase = HandleAppLanguageUseCase(repository: repository) + } +} diff --git a/MiniScanner/Features/Common/Data/DataSources/SettingsDataSource.swift b/MiniScanner/Features/Common/Data/DataSources/SettingsDataSource.swift new file mode 100644 index 0000000000000000000000000000000000000000..ea183aa1015e13e5308b4db8f5273ce7da29c505 --- /dev/null +++ b/MiniScanner/Features/Common/Data/DataSources/SettingsDataSource.swift @@ -0,0 +1,88 @@ +// +// SettingsDataSource.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation +import LanguageManager_iOS + +protocol SettingsDataSourceProtocol { + func getLanguages() -> [SupportedLanguage] + func getLanguage() -> SupportedLanguage + func changeLanguage(to language: SupportedLanguage) + func changeManagerLanguage(to language: SupportedLanguage) + + func getColorScheme() -> SupportedColorScheme + func changeColorScheme(to colorScheme: SupportedColorScheme) +} + +class SettingsDataSource: SettingsDataSourceProtocol { + + private let userDefaultsManager: UserDefaultsManagerProtocol + + private let languageManager = LanguageManager.shared + + private var language: SupportedLanguage { + get { + .from(codeName: userDefaultsManager.string(key: .appLanguage) ?? SupportedLanguage.device.codeName) + } + set { + userDefaultsManager.set(value: newValue.codeName, key: .appLanguage) + } + } + + private var colorShceme: SupportedColorScheme { + get { + .from(codeName: userDefaultsManager.string(key: .appColorScheme) ?? SupportedColorScheme.device.codeName) + } + set { + userDefaultsManager.set(value: newValue.codeName, key: .appColorScheme) + } + } + + init(userDefaultsManager: UserDefaultsManagerProtocol) { + self.userDefaultsManager = userDefaultsManager + } + + func getLanguages() -> [SupportedLanguage] { + var availableLanguages = Bundle.main.localizations + + availableLanguages.removeAll { $0 == "Base" } + + var languages: [SupportedLanguage] = [] + + languages.append(.device) + + for language in availableLanguages { + languages.append(.from(codeName: language)) + } + + return languages + } + + func getLanguage() -> SupportedLanguage { + language + } + + func changeLanguage(to language: SupportedLanguage) { + self.language = language + + changeManagerLanguage(to: language) + } + + func changeManagerLanguage(to language: SupportedLanguage) { + languageManager.setLanguage(language: language.language) + languageManager.defaultLanguage = language.language + } + + func getColorScheme() -> SupportedColorScheme { + colorShceme + } + + func changeColorScheme(to colorScheme: SupportedColorScheme) { + self.colorShceme = colorScheme + } +} diff --git a/MiniScanner/Features/Common/Data/Model/CustomMenuPickerItem.swift b/MiniScanner/Features/Common/Data/Model/CustomMenuPickerItem.swift new file mode 100644 index 0000000000000000000000000000000000000000..468c520c6b907505fdc06730fd87a35dbc9f7cc9 --- /dev/null +++ b/MiniScanner/Features/Common/Data/Model/CustomMenuPickerItem.swift @@ -0,0 +1,14 @@ +// +// CustomMenuPickerItem.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +protocol CustomMenuPickerItem: Identifiable, Hashable { + + var displayedName: String { get } +} diff --git a/MiniScanner/Features/Common/Data/Model/SupportedColorScheme.swift b/MiniScanner/Features/Common/Data/Model/SupportedColorScheme.swift new file mode 100644 index 0000000000000000000000000000000000000000..39381e3a2b92b2bd9131b9f5ec611085da97b170 --- /dev/null +++ b/MiniScanner/Features/Common/Data/Model/SupportedColorScheme.swift @@ -0,0 +1,41 @@ +// +// SupportedColorScheme.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +enum SupportedColorScheme: String, CaseIterable, CustomMenuPickerItem { + + case device + case light + case dark + + var id: Self { self } + + var displayedName: String { + switch self { + case .device: + .deviceTheme.localized + case .light: + .lightMode.localized + case .dark: + .darkMode.localized + } + } + +} + +extension SupportedColorScheme { + + static func from(codeName: String) -> SupportedColorScheme { + SupportedColorScheme(rawValue: codeName) ?? .device + } + + var codeName: String { + rawValue + } +} diff --git a/MiniScanner/Features/Common/Data/Model/SupportedLanguage.swift b/MiniScanner/Features/Common/Data/Model/SupportedLanguage.swift new file mode 100644 index 0000000000000000000000000000000000000000..342ed8d7f889f56b830af0c39dbb7e9c7f0ded5a --- /dev/null +++ b/MiniScanner/Features/Common/Data/Model/SupportedLanguage.swift @@ -0,0 +1,127 @@ +// +// SupportedLanguage.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation +import LanguageManager_iOS +import SwiftUI + +enum SupportedLanguage: CaseIterable, CustomMenuPickerItem { + + case device + case english + case arabic + + var flag: String { + switch self { + case .device: + SupportedLanguage.currentLanguage.flag + case .english: + "🇺🇸" + case .arabic: + "🇰🇼" + } + } + + static var currentLanguage: SupportedLanguage { + .from(language: LanguageManager.shared.currentLanguage) + } + + var isRTL: Bool { + switch self { + case .device: + SupportedLanguage.currentLanguage.isRTL + case .english: + false + case .arabic: + true + } + } + + var layoutDirection: LayoutDirection { + isRTL ? .rightToLeft : .leftToRight + } + + var semanticContentAttribute: UISemanticContentAttribute { + isRTL ? .forceRightToLeft : .forceLeftToRight + } + + var locale: Locale { + switch self { + case .device: + SupportedLanguage.currentLanguage.locale + case .english: + Locale(identifier: "en") + case .arabic: + Locale(identifier: "ar") + } + } + + var id: Self { self } + + var displayedName: String { + switch self { + case .device: + .deviceLanguage.localized + case .english: + displayNameForLanguage(.english) + case .arabic: + displayNameForLanguage(.arabic) + } + } + + func displayNameForLanguage(_ language: SupportedLanguage) -> String { + let locale = NSLocale(localeIdentifier: SupportedLanguage.currentLanguage.codeName) + return locale.displayName(forKey: .identifier, value: language.codeName) ?? "" + } +} + +extension SupportedLanguage { + + static func from(codeName: String) -> SupportedLanguage { + .from(language: Languages(rawValue: codeName) ?? .deviceLanguage) + } + + var codeName: String { + switch self { + case .device: + Languages.deviceLanguage.rawValue + case .english: + Languages.en.rawValue + case .arabic: + Languages.ar.rawValue + } + } +} + +extension SupportedLanguage { + + static func from(language: Languages) -> Self { + switch language { + case .ar: + .arabic + case .en: + .english + case .deviceLanguage: + .device + + default: + .device + } + } + + var language: Languages { + switch self { + case .device: + LanguageManager.shared.deviceLanguage ?? .en + case .english: + .en + case .arabic: + .ar + } + } +} diff --git a/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift new file mode 100644 index 0000000000000000000000000000000000000000..467d68ffcdf307c46a9be8b6890dd825c904fead --- /dev/null +++ b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift @@ -0,0 +1,138 @@ +// +// SettingsRepository.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class SettingsRepository: SettingsRepositoryProtocol { + + private let dataSource: SettingsDataSourceProtocol + + init(dataSource: SettingsDataSourceProtocol) { + self.dataSource = dataSource + } + + func getLanguages() -> [SupportedLanguage] { + dataSource.getLanguages() + } + + func getLanguage() -> SupportedLanguage { + dataSource.getLanguage() + } + + func changeLanguage(to language: SupportedLanguage) { + + if shouldChangeLanguage(to: language) { + + dataSource.changeLanguage(to: language) + } + } + + func getColorScheme() -> SupportedColorScheme { + dataSource.getColorScheme() + } + + func changeColorScheme(to colorScheme: SupportedColorScheme) { + + if shouldChangeColorScheme(to: colorScheme) { + + dataSource.changeColorScheme(to: colorScheme) + + changeAppColorScheme(to: colorScheme) + } + } + + func handleAppLanguage() { + handleLanguage() + } + + func handleAppStart() { + handleColorScheme() + handleUISettings() + } +} + +extension SettingsRepository { + + private func shouldChangeLanguage(to language: SupportedLanguage) -> Bool { + dataSource.getLanguage() != language + } + + private func shouldChangeColorScheme(to colorScheme: SupportedColorScheme) -> Bool { + dataSource.getColorScheme() != colorScheme + } + + private func changeAppColorScheme(to colorScheme: SupportedColorScheme) { + switch colorScheme { + case .device: + changeUserInterfaceStyle(to: .unspecified) + case .light: + changeUserInterfaceStyle(to: .light) + case .dark: + changeUserInterfaceStyle(to: .dark) + } + } + + private func changeUserInterfaceStyle(to userInterfaceStyle: UIUserInterfaceStyle) { + + let window = UIApplication.shared.connectedScenes + .flatMap { ($0 as? UIWindowScene)?.windows ?? [] } + .first { $0.isKeyWindow } + + window?.overrideUserInterfaceStyle = userInterfaceStyle + } +} + +extension SettingsRepository { + + private func handleLanguage() { + let language = getLanguage() + + dataSource.changeManagerLanguage(to: language) + } + + private func handleColorScheme() { + let colorScheme = getColorScheme() + changeAppColorScheme(to: colorScheme) + } + + private func handleUISettings() { + + handleScrollViewAppearace() + + handleNavigationBarAppearace() + + handleToolBarAppearace() + + handleButtonAppearace() + } + + private func handleScrollViewAppearace() { + + UIScrollView.appearance().bounces = false + } + + private func handleNavigationBarAppearace() { + let navigationBarAppearace = UINavigationBar.appearance() + + navigationBarAppearace.tintColor = .tintColor + navigationBarAppearace.barTintColor = .barTintColor + } + + private func handleToolBarAppearace() { + + let toolBarAppearace = UIToolbar.appearance() + + toolBarAppearace.tintColor = .tintColor + toolBarAppearace.barTintColor = .barTintColor + } + + private func handleButtonAppearace() { + let buttonAppearance = UIButton.appearance() + buttonAppearance.tintColor = .tintColor + } +} diff --git a/MiniScanner/Features/Common/Domain/Repositories/SettingsRepositoryProtocol.swift b/MiniScanner/Features/Common/Domain/Repositories/SettingsRepositoryProtocol.swift new file mode 100644 index 0000000000000000000000000000000000000000..9c98fcf21a41e663d96cb5502679ea441c3de96b --- /dev/null +++ b/MiniScanner/Features/Common/Domain/Repositories/SettingsRepositoryProtocol.swift @@ -0,0 +1,22 @@ +// +// SettingsRepositoryProtocol.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +protocol SettingsRepositoryProtocol { + + func getLanguages() -> [SupportedLanguage] + func getLanguage() -> SupportedLanguage + func changeLanguage(to language: SupportedLanguage) + + func getColorScheme() -> SupportedColorScheme + func changeColorScheme(to colorScheme: SupportedColorScheme) + + func handleAppLanguage() + func handleAppStart() +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/ChangeColorSchemeUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/ChangeColorSchemeUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..ad310299266615eb71fac0c4558756dfd7a82b2f --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/ChangeColorSchemeUseCase.swift @@ -0,0 +1,22 @@ +// +// ChangeColorSchemeUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class ChangeColorSchemeUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute(to colorScheme: SupportedColorScheme) { + repository.changeColorScheme(to: colorScheme) + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/GetColorSchemeUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/GetColorSchemeUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..468f1ba797998a1e10178aa9cc30fd3ee6cf2012 --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/ColorScheme/GetColorSchemeUseCase.swift @@ -0,0 +1,22 @@ +// +// GetColorSchemeUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class GetColorSchemeUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute() -> SupportedColorScheme { + repository.getColorScheme() + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/HandleAppStartUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/HandleAppStartUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..d08552d842b01bbe6fdadf1f71e7a0fcdcc1fbcf --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/HandleAppStartUseCase.swift @@ -0,0 +1,22 @@ +// +// HandleAppStartUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class HandleAppStartUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute() { + repository.handleAppStart() + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/Language/ChangeLanguageUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/Language/ChangeLanguageUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..3810da3ce730a1f2680551dfac36e4a689a4a652 --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/Language/ChangeLanguageUseCase.swift @@ -0,0 +1,22 @@ +// +// ChangeLanguageUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class ChangeLanguageUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute(to language: SupportedLanguage) { + repository.changeLanguage(to: language) + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguageUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguageUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..e949d0b1a199616d0c9a8af4d3f9312dec7d5b4c --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguageUseCase.swift @@ -0,0 +1,22 @@ +// +// GetLanguageUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class GetLanguageUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute() -> SupportedLanguage { + repository.getLanguage() + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguagesUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguagesUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..1a79364175fc35f344edac5005ac3c5bfa867033 --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/Language/GetLanguagesUseCase.swift @@ -0,0 +1,22 @@ +// +// GetLanguagesUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class GetLanguagesUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute() -> [SupportedLanguage] { + repository.getLanguages() + } +} diff --git a/MiniScanner/Features/Common/Domain/UseCases/Language/HandleAppLanguageUseCase.swift b/MiniScanner/Features/Common/Domain/UseCases/Language/HandleAppLanguageUseCase.swift new file mode 100644 index 0000000000000000000000000000000000000000..1af982ab91885e5b23868ca37e745d7e475b34f7 --- /dev/null +++ b/MiniScanner/Features/Common/Domain/UseCases/Language/HandleAppLanguageUseCase.swift @@ -0,0 +1,22 @@ +// +// HandleAppLanguageUseCase.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class HandleAppLanguageUseCase { + + private let repository: SettingsRepositoryProtocol + + init(repository: SettingsRepositoryProtocol) { + self.repository = repository + } + + func execute() { + repository.handleAppLanguage() + } +} diff --git a/MiniScanner/Features/Common/Presentation/CustomMenuPicker.swift b/MiniScanner/Features/Common/Presentation/CustomMenuPicker.swift new file mode 100644 index 0000000000000000000000000000000000000000..cb8c8f944652f0ab7cbd898297a855a5f0c15897 --- /dev/null +++ b/MiniScanner/Features/Common/Presentation/CustomMenuPicker.swift @@ -0,0 +1,32 @@ +// +// CustomMenuPicker.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +struct CustomMenuPicker<Item: CustomMenuPickerItem, Label: View>: View { + + @Binding var selectedItem: Item + var items: [Item] + + @ViewBuilder var label: () -> Label + + var body: some View { + Menu(content: { + Picker(selection: $selectedItem, label: EmptyView()) { + + ForEach(items) { item in + + Text(item.displayedName) + .tag(item) + } + } + }, label: { + label() + }) + } +} diff --git a/MiniScanner/Features/Common/Presentation/MainCoordinator.swift b/MiniScanner/Features/Common/Presentation/MainCoordinator.swift new file mode 100644 index 0000000000000000000000000000000000000000..c086666167f9075aa69fa01d3ec36c7b5592b1f3 --- /dev/null +++ b/MiniScanner/Features/Common/Presentation/MainCoordinator.swift @@ -0,0 +1,39 @@ +// +// MainCoordinator.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +protocol MainCoordinator { + + var navigationController: UINavigationController { get set } + + func start() + + func coordinate(to coordinator: MainCoordinator) + + func coordinateBack() + + func coordinateToView(_ view: some View, title: String?) +} + +extension MainCoordinator { + + func coordinate(to coordinator: MainCoordinator) { + coordinator.start() + } + + func coordinateBack() { + navigationController.popViewController(animated: true) + } + + func coordinateToView(_ view: some View, title: String? = nil) { + let hostingController = UIHostingController(rootView: view) + hostingController.title = title + navigationController.pushViewController(hostingController, animated: true) + } +} diff --git a/MiniScanner/Features/Common/Presentation/MainView.swift b/MiniScanner/Features/Common/Presentation/MainView.swift new file mode 100644 index 0000000000000000000000000000000000000000..15b89890cdb71d8c74c07181b6be78e2247efdfb --- /dev/null +++ b/MiniScanner/Features/Common/Presentation/MainView.swift @@ -0,0 +1,34 @@ +// +// MainView.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +struct MainView<ViewModel: MainViewModel, Content: View>: View { + + var viewModel: ViewModel + + @ViewBuilder var content: () -> Content + + init(viewModel: ViewModel, + @ViewBuilder content: @escaping () -> Content) { + self.viewModel = viewModel + self.content = content + } + + var body: some View { + + content() + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Color.mainBackground) + .onAppear { + viewModel.onAppear() + } + .onDisappear() { viewModel.onDisappear() } + .handleLayoutChanges() + } +} diff --git a/MiniScanner/Features/Common/Presentation/MainViewModel.swift b/MiniScanner/Features/Common/Presentation/MainViewModel.swift new file mode 100644 index 0000000000000000000000000000000000000000..de1b2a6138e1d2f16b4131e47e43fbcf00952d2f --- /dev/null +++ b/MiniScanner/Features/Common/Presentation/MainViewModel.swift @@ -0,0 +1,21 @@ +// +// MainViewModel.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +protocol MainViewModel: ObservableObject { + + func onAppear() + + func onDisappear() +} + +extension MainViewModel { + + func onDisappear() { } +} diff --git a/MiniScanner/Features/Settings/Presentation/SettingsView.swift b/MiniScanner/Features/Settings/Presentation/SettingsView.swift new file mode 100644 index 0000000000000000000000000000000000000000..90958680a1b44b67a0db4a5d1ea51ceb1437d19b --- /dev/null +++ b/MiniScanner/Features/Settings/Presentation/SettingsView.swift @@ -0,0 +1,138 @@ +// +// SettingsView.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +struct SettingsView: View { + + @StateObject var viewModel: SettingsViewModel + + init(coordinator: SettingsViewCoordinating) { + self._viewModel = StateObject(wrappedValue: SettingsViewModel(coordinator: coordinator)) + } + + var body: some View { + MainView(viewModel: viewModel) { + VStack { + + if viewModel.refreshView { + settingsForm + } + else { + settingsForm + } + } + .navigationTitle(viewModel.navigationTitle) + .customNavigationBackButton(defaultBackButtonHidden: viewModel.isDefaultBackButtonHidden, + backButton: backButton) + .environment(\.layoutDirection, viewModel.layoutDirection) + } + } + + private var backButton: some View { + Button(action: { + viewModel.onBackButtonClick() + }, label: { + HStack(spacing: 4) { + + Image.chevronBackward + + Text(viewModel.backButtonTitle) + } + }) + } + + private var settingsForm: some View { + + Form { + + Section { + + language + + colorScheme + + } header: { + Text(String.appearence.localized) + } + } + } +} + +extension SettingsView { + + private var language: some View { + CustomMenuPicker(selectedItem: $viewModel.selectedLanguage, + items: viewModel.languages, + label: { languageLabel }) + } + + private var languageLabel: some View { + HStack { + + Text(String.language.localized) + + Spacer() + + Text(viewModel.selectedLanguage.displayedName) + + Text(viewModel.selectedLanguage.flag) + } + .foregroundStyle(Color.mainText) + } + + private var colorScheme: some View { + CustomMenuPicker(selectedItem: $viewModel.selectedColorScheme, + items: viewModel.colorShemes, + label: { colorSchemeLabel }) + } + + private var colorSchemeLabel: some View { + HStack { + + Text(String.appTheme.localized) + + Spacer() + + Text(viewModel.selectedColorScheme.displayedName) + } + .foregroundStyle(Color.mainText) + } +} + +#Preview { + SettingsView(coordinator: SettingsViewCoordinator(navigationController: UINavigationController())) +} + +fileprivate extension View { + + func customNavigationBackButton<T: View>(defaultBackButtonHidden: Bool, + backButton: T) -> some View { + ModifiedContent(content: self, + modifier: CustomBackButtonViewModifier(defaultBackButtonHidden: defaultBackButtonHidden, backButton: backButton)) + } +} + +fileprivate struct CustomBackButtonViewModifier<T: View>: ViewModifier { + + var defaultBackButtonHidden: Bool + var backButton: T + + func body(content: Content) -> some View { + + if defaultBackButtonHidden { + + content + .navigationBarBackButtonHidden(defaultBackButtonHidden) + .navigationBarItems(leading: backButton) + } + else { + content + } + } +} diff --git a/MiniScanner/Features/Settings/Presentation/SettingsViewCoordinator.swift b/MiniScanner/Features/Settings/Presentation/SettingsViewCoordinator.swift new file mode 100644 index 0000000000000000000000000000000000000000..2d52efbcd9a8a3dbe99a3d779e4a092d04d01638 --- /dev/null +++ b/MiniScanner/Features/Settings/Presentation/SettingsViewCoordinator.swift @@ -0,0 +1,27 @@ +// +// SettingsViewCoordinator.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +protocol SettingsViewCoordinating: MainCoordinator { + var navigationController: UINavigationController { get set } +} + +class SettingsViewCoordinator: SettingsViewCoordinating { + + var navigationController: UINavigationController + + init(navigationController: UINavigationController) { + self.navigationController = navigationController + } + + func start() { + let view = SettingsView(coordinator: self) + coordinateToView(view, title: .settings.localized) + } +} diff --git a/MiniScanner/Features/Settings/Presentation/SettingsViewModel.swift b/MiniScanner/Features/Settings/Presentation/SettingsViewModel.swift new file mode 100644 index 0000000000000000000000000000000000000000..f3e24db0dc064ffef4fcb02706ead6b17ec0dcf7 --- /dev/null +++ b/MiniScanner/Features/Settings/Presentation/SettingsViewModel.swift @@ -0,0 +1,110 @@ +// +// SettingsViewModel.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/18/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import SwiftUI + +final class SettingsViewModel: MainViewModel { + + @Published var layoutDirection: LayoutDirection = .leftToRight + + @Published var refreshView: Bool = false + + @Published var languages: [SupportedLanguage] = [] + @Published var colorShemes: [SupportedColorScheme] = [] + + @Published var selectedLanguage: SupportedLanguage = .device { + didSet { + changeLanguage(to: selectedLanguage) + } + } + + @Published var selectedColorScheme: SupportedColorScheme = .device { + didSet { + changeColorShceme(to: selectedColorScheme) + } + } + + @Published var isDefaultBackButtonHidden: Bool = false + + var navigationTitle: String { .settings.localized } + var backButtonTitle: String { .fileManager.localized } + + @Inject var getLanguagesUseCase: GetLanguagesUseCase + @Inject var getLanguageUseCase: GetLanguageUseCase + @Inject var changeLanguageUseCase: ChangeLanguageUseCase + + @Inject var getColorSchemeUseCase: GetColorSchemeUseCase + @Inject var changeColorSchemeUseCase: ChangeColorSchemeUseCase + + private let coordinator: SettingsViewCoordinating + + init(coordinator: SettingsViewCoordinating) { + self.coordinator = coordinator + } +} + +extension SettingsViewModel { + + func onAppear() { + fetchSettings() + } +} + +extension SettingsViewModel { + + private func fetchSettings() { + languages = getLanguagesUseCase.execute() + colorShemes = SupportedColorScheme.allCases + + selectedLanguage = getLanguageUseCase.execute() + selectedColorScheme = getColorSchemeUseCase.execute() + } +} + +extension SettingsViewModel { + + private func changeLanguage(to language: SupportedLanguage) { + + let previousLanguage = SupportedLanguage.currentLanguage + + changeLanguageUseCase.execute(to: language) + + layoutDirection = language.layoutDirection + + if language.layoutDirection == .leftToRight { + refreshView.toggle() + } + + if previousLanguage != SupportedLanguage.currentLanguage { + + refreshSemanticContentAttribute() + } + } + + private func changeColorShceme(to colorScheme: SupportedColorScheme) { + changeColorSchemeUseCase.execute(to: colorScheme) + } +} + +extension SettingsViewModel { + + private func refreshSemanticContentAttribute() { + let navigationController = coordinator.navigationController + + let semanticContentAttribute = SupportedLanguage.currentLanguage.semanticContentAttribute + + navigationController.tabBarController?.tabBar.semanticContentAttribute = semanticContentAttribute + navigationController.navigationBar.semanticContentAttribute = semanticContentAttribute + + isDefaultBackButtonHidden = true + } + + func onBackButtonClick() { + coordinator.coordinateBack() + } +} diff --git a/MiniScanner/Managers/ThemeManager.swift b/MiniScanner/Managers/ThemeManager.swift index 05bd3526cfdbeda123a81a6d3772e6f5338b3e48..5b2b455ac010cf59e48bf3a6ce4bd601f85b8686 100644 --- a/MiniScanner/Managers/ThemeManager.swift +++ b/MiniScanner/Managers/ThemeManager.swift @@ -7,51 +7,6 @@ import UIKit -final class ThemeManager { - - static let shared = ThemeManager() - - /// Setups the appearance proxy for the UINavigationBar, UIToolbar and UIButton. - func setupTheme() { - let navigationBarAppearace = UINavigationBar.appearance() - - navigationBarAppearace.tintColor = .tintColor - navigationBarAppearace.barTintColor = .barTintColor - - let toolBarAppearace = UIToolbar.appearance() - - toolBarAppearace.tintColor = .tintColor - toolBarAppearace.barTintColor = .barTintColor - - let buttonAppearance = UIButton.appearance() - buttonAppearance.tintColor = .tintColor - } -} - -extension UIColor { - class var tintColor: UIColor { - if UIScreen.isDarkMode { - return .white - } else { - return UIColor(named: "AccentColor")! - } - } - - class var barTintColor: UIColor { - if UIScreen.isDarkMode { - return .darkText - } else { - return .white - } - } -} - -extension UIScreen { - static var isDarkMode: Bool { - return main.traitCollection.userInterfaceStyle == .dark - } -} - extension UIDevice { static var isSimulator: Bool { #if targetEnvironment(simulator) diff --git a/MiniScanner/Managers/UserDefaults/UserDefaultsKeys.swift b/MiniScanner/Managers/UserDefaults/UserDefaultsKeys.swift new file mode 100644 index 0000000000000000000000000000000000000000..8e0bc31cf1f46f5ea02e2f007601990cc61ddd2d --- /dev/null +++ b/MiniScanner/Managers/UserDefaults/UserDefaultsKeys.swift @@ -0,0 +1,15 @@ +// +// UserDefaultsKeys.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +enum UserDefaultsKeys: String { + + case appLanguage = "app_language" + case appColorScheme = "app_color_scheme" +} diff --git a/MiniScanner/Managers/UserDefaults/UserDefaultsManager.swift b/MiniScanner/Managers/UserDefaults/UserDefaultsManager.swift new file mode 100644 index 0000000000000000000000000000000000000000..99767924275d85dec0bead53afd460a079d56fda --- /dev/null +++ b/MiniScanner/Managers/UserDefaults/UserDefaultsManager.swift @@ -0,0 +1,77 @@ +// +// UserDefaultsManager.swift +// MiniScanner +// +// Created by Mustafa Merza on 7/17/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +protocol UserDefaultsManagerProtocol { + + func string(key: UserDefaultsKeys) -> String? + func bool(key: UserDefaultsKeys) -> Bool + func get<T: Codable>(key: UserDefaultsKeys) -> T? + + func set(value: String, key: UserDefaultsKeys) + func set(value: Bool, key: UserDefaultsKeys) + func set<T: Codable>(value: T?, key: UserDefaultsKeys) + + func clear(key: UserDefaultsKeys) +} + +class UserDefaultsManager: UserDefaultsManagerProtocol { + + private let userDefaults: UserDefaults = .standard + + func string(key: UserDefaultsKeys) -> String? { + userDefaults.string(forKey: key.rawValue) + } + + func bool(key: UserDefaultsKeys) -> Bool { + userDefaults.bool(forKey: key.rawValue) + } + + func set(value: String, key: UserDefaultsKeys) { + set(value: value as Any?, key: key) + } + + func set(value: Bool, key: UserDefaultsKeys) { + set(value: value as Any?, key: key) + } + + func get<T: Codable>(key: UserDefaultsKeys) -> T? { + var value: T? = nil + + if let data = get(key: key) as? Data { + value = try? JSONDecoder().decode(T.self, from: data) + } + + return value + } + + func set<T: Codable>(value: T?, key: UserDefaultsKeys) { + if let value { + + let data = try? JSONEncoder().encode(value) + set(value: data as Any?, key: key) + } + else { + set(value: value as Any?, key: key) + } + } + + func clear(key: UserDefaultsKeys) { + userDefaults.removeObject(forKey: key.rawValue) + } + + private func get(key: UserDefaultsKeys) -> Any? { + userDefaults.object(forKey: key.rawValue) + } + + private func set(value: Any?, key: UserDefaultsKeys) { + userDefaults.set(value, forKey: key.rawValue) + userDefaults.synchronize() + } +} diff --git a/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard b/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard index c66d3920b1925575ab2c25996a48bc481453b396..beadaa17bc8879d55de6cfa45ab19580985aca48 100644 --- a/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard +++ b/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="b1K-XK-mdX"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="b1K-XK-mdX"> <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <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"/> @@ -161,6 +161,7 @@ <barButtonItem key="rightBarButtonItem" title="Item" image="printer" catalog="system" hidden="YES" id="Z0H-Ze-WXm"/> </navigationItem> <connections> + <outlet property="directShareLabel" destination="GR8-HI-C1V" id="586-VP-rx9"/> <outlet property="pdfView" destination="HkK-Fc-Rgz" id="3sS-2Q-v88"/> </connections> </viewController> diff --git a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift index cd2a56c863ce944afd0af0846c79bac68810aa91..36cf285a019e267a2c9f38c3a75905f8b38475d2 100644 --- a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift +++ b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift @@ -18,6 +18,7 @@ final class DocumentPreviewViewController: UIViewController { } @IBOutlet private weak var pdfView: CustomPDFView! + @IBOutlet weak var directShareLabel: UILabel! var file: File? private var scannedItem: ScannedItem! @@ -42,6 +43,9 @@ final class DocumentPreviewViewController: UIViewController { payload = [url] } + directShareLabel.set(localized: .directShare) + + view.backgroundColor = .mainBackground } @IBAction func whatsappTapped(_ sender: UIButton) { @@ -95,23 +99,23 @@ final class DocumentPreviewViewController: UIViewController { let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - let cameraAction = UIAlertAction(title: "Camera".localized, style: .default, handler: { action in + let cameraAction = UIAlertAction(title: .camera.localized, style: .default, handler: { action in self.openCamera() }) - let galleryAction = UIAlertAction(title: "Gallery".localized, style: .default, handler: { action in + let galleryAction = UIAlertAction(title: .gallery.localized, style: .default, handler: { action in self.openGallery() }) alertController.addAction(cameraAction) - cameraAction.setValue(UIImage(systemName: "camera"), forKey: "image") + cameraAction.setValue(UIImage.camera, forKey: "image") cameraAction.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment") alertController.addAction(galleryAction) - galleryAction.setValue(UIImage(systemName: "photo"), forKey: "image") + galleryAction.setValue(UIImage.photo, forKey: "image") galleryAction.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment") - alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + alertController.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) alertController.popoverPresentationController?.barButtonItem = sender present(alertController, animated: true) } @@ -137,11 +141,11 @@ final class DocumentPreviewViewController: UIViewController { } @IBAction func deleteTapped(_ sender: UIBarButtonItem) { - let alertController = UIAlertController(title: "Delete".localized, - message: "Are you sure?".localized, preferredStyle: .actionSheet) + let alertController = UIAlertController(title: .delete.localized, + message: .areYouSure.localized, preferredStyle: .actionSheet) if pdfView.document?.pageCount == 1 { - let currentPageAction = UIAlertAction(title: "Delete document".localized, style: .default, handler: { action in + let currentPageAction = UIAlertAction(title: .deleteDocument.localized, style: .default, handler: { action in guard let documentURL = self.file?.fileURL, let pdfView = self.pdfView else { return } if pdfView.document?.pageCount == 1 { try? FileManager.default.removeItem(at: documentURL) @@ -156,7 +160,7 @@ final class DocumentPreviewViewController: UIViewController { alertController.addAction(currentPageAction) } else { - let currentPageAction = UIAlertAction(title: "Current page".localized, style: .default, handler: { action in + let currentPageAction = UIAlertAction(title: .currentPage.localized, style: .default, handler: { action in guard let documentURL = self.file?.fileURL, let pdfView = self.pdfView else { return } if pdfView.document?.pageCount == 1 { try? FileManager.default.removeItem(at: documentURL) @@ -173,7 +177,7 @@ final class DocumentPreviewViewController: UIViewController { } }) - let entireDocumentAction = UIAlertAction(title: "Entire document".localized, style: .default, handler: { action in + let entireDocumentAction = UIAlertAction(title: .entireDocument.localized, style: .default, handler: { action in guard let documentURL = self.file?.fileURL else { return } try? FileManager.default.removeItem(at: documentURL) self.navigationController?.popViewController(animated: true) @@ -183,7 +187,7 @@ final class DocumentPreviewViewController: UIViewController { alertController.addAction(entireDocumentAction) } - alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + alertController.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) alertController.popoverPresentationController?.barButtonItem = sender present(alertController, animated: true) } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift index 64374608674881acdd940dbf2df2111ec09a76d0..9a732ca7331ae3e0964d7ebd9d92d64c5de1a359 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift @@ -18,6 +18,7 @@ final class AllFolderTableViewCell: UIView { @IBOutlet private weak var view: UIView! @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var addFolderButton: UIButton! + @IBOutlet weak var foldersLabel: UILabel! // MARK: - Properties var folders: [AppConfigurator.Folder] = [] @@ -34,6 +35,19 @@ final class AllFolderTableViewCell: UIView { super.init(coder: aDecoder) setupNib() + setupUI() + } + + private func setupUI() { + addFolderButton.set(localized: .addFolder) + + foldersLabel.set(localized: .folders) + } + + func reloadLocalization() { + addFolderButton.set(localized: .addFolder) + + foldersLabel.set(localized: .folders) } private func setupNib() { @@ -44,6 +58,9 @@ final class AllFolderTableViewCell: UIView { addSubview(view) setupCollectionView() + + view.backgroundColor = .mainBackground + collectionView.backgroundColor = .mainBackground } @IBAction func addFolderButtonTapped(_ sender: UIButton) { diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.xib b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.xib index 90947360347b7d04b6746e913f83f92dabcaaa43..e35c3e3f89600c000f4726b4148b4ddf4916cf19 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.xib +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.xib @@ -1,9 +1,9 @@ <?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"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" 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"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <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"/> @@ -13,6 +13,7 @@ <connections> <outlet property="addFolderButton" destination="RpH-94-tHk" id="EvT-GP-STM"/> <outlet property="collectionView" destination="ATv-Qf-nQ6" id="tpu-Qf-4th"/> + <outlet property="foldersLabel" destination="k4D-XM-uc5" id="rjr-lJ-sap"/> <outlet property="view" destination="IMm-Qg-H9R" id="eqa-cf-UOK"/> </connections> </placeholder> diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift index 0ff692a1c4efc1fb1bf50d3ff3ffeca33a4f34d4..0aa188831db01c243d0f2adfb78fcfa8bc7a3a3a 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift @@ -34,12 +34,29 @@ class FolderCollectionViewCell: UICollectionViewCell { } private func setSelected() { - self.boxView.backgroundColor = isFolderSelected ? .mainBlue : .white + self.boxView.backgroundColor = isFolderSelected ? .mainBlue : .mainBackground } func set(folder: AppConfigurator.Folder) { isFolderSelected = folder.isSelected - self.titleLabel.set(text: folder.name, color: isFolderSelected ? .white : .mainText, font: isFolderSelected ? .bold(18) : .medium(18)) + + var folderName = folder.name + let savedName = folder.savedName + + switch savedName { + case "all_documents": + folderName = .allDocuments.localized + case "passports": + folderName = .passports.localized + case "contracts": + folderName = .contracts.localized + case "identifiers": + folderName = .identifiers.localized + default: + break + } + + self.titleLabel.set(text: folderName, color: isFolderSelected ? .white : .mainText, font: isFolderSelected ? .bold(18) : .medium(18)) setSelected() } } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift index f306ce9a746f2253749db7eccd585182ee80d66e..cc3844b88c3d76aac72727d17ef9dd8009bcf898 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift @@ -60,14 +60,17 @@ class CustomTabBarView: UIView { } private func setupUI() { - editImageIcon.image = UIImage(named: "preview") - editImageLabel.set(text: "Preview", color: .white, font: .medium(18)) + editImageIcon.image = .preview + editImageLabel.set(text: .preview.localized, color: .white, font: .medium(18)) editImageView.layer.cornerRadius = 10 editImageView.backgroundColor = .buttonsBlue badgeView.layer.cornerRadius = 10 badgeView.backgroundColor = .red - tabbarImage.image = UIDevice.current.userInterfaceIdiom == .pad ? UIImage(named: "tabbarIpad") : UIImage(named: "tabBar") + tabbarImage.image = UIDevice.current.userInterfaceIdiom == .pad ? .tabbarIPad.withRenderingMode(.alwaysTemplate) : .tabBar.withRenderingMode(.alwaysTemplate) + + tabbarImage.tintColor = .mainBackground + tabbarImage.isHidden = isAddedToPDF fileManagerButton.isHidden = isAddedToPDF galleryButton.isHidden = isAddedToPDF @@ -91,7 +94,7 @@ class CustomTabBarView: UIView { if isAddedToPDF { editImageIcon.image = nil - editImageLabel.set(text: "Done") + editImageLabel.set(text: .done.localized) editImageLabel.textAlignment = .center editImage_width.constant = 0 editImage_trailing.constant = 0 diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift index 7c26b8bb18f4cd95f441dbd312866ba0f26dcc1b..971599f474f0181fbffb536004d407b56f4e82e6 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift @@ -44,8 +44,8 @@ final class KNAlertViewController: BMViewController { private var message: String = "" - private var confirmButtonTitle: String = "Yes" - private var destructiveButtonTitle: String = "No" + private var confirmButtonTitle: String = .yes + private var destructiveButtonTitle: String = .no var shouldDismissAndLogin: Bool = false @@ -149,6 +149,8 @@ extension KNAlertViewController { buttonsView_height.constant = 0 + folderName.placeholder = .folderFiles.localized + folderName.addTarget(self, action: #selector(textChanged), for: .editingChanged) confirmationButton.isEnabled = folderName.text != "" ? true : false } @@ -206,7 +208,7 @@ extension KNAlertViewController { buttonsView_trailing.constant = buttonsView_Spacing confirmationButton.isHidden = false - confirmationButton.setTitle("OK", for: .normal) + confirmationButton.set(localized: .ok) buttonsView_height.constant = BUTTON_HEIGHT case .decision: @@ -218,8 +220,7 @@ extension KNAlertViewController { destructiveButton.isHidden = false confirmationButton.isHidden = false - - confirmationButton.setTitle("Yes", for: .normal) + confirmationButton.set(localized: .yes) buttonsView_height.constant = BUTTON_HEIGHT diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift index 4be47b2e9e0c63026f6cd6284b1d6dba7fb10fd5..733c9147a58d5bad89a133e9090d3f1a42e54891 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift @@ -66,13 +66,17 @@ final class SearchFilesView: UIView { private func setupUI() { boxView.layer.cornerRadius = 30 - titleLabel.set(text: "Folder files", color: .titlesText, font: .bold(20)) + titleLabel.set(text: .folderFiles.localized, color: .titlesText, font: .bold(20)) searchTextField.isHidden = true searchTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) searchTextField.delegate = self titleLabel.isHidden = !searchTextField.isHidden searchButton.isHidden = !searchTextField.isHidden } + + func reloadLocalization() { + titleLabel.set(text: .folderFiles.localized, color: .titlesText, font: .bold(20)) + } } // MARK: - TextFieldDelegate diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift index 4b48ecc4cb7b386f7241a6fb3d0519a0787f1899..8e7042c5ca32e393a77a13be6651c6c35479b353 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift @@ -50,33 +50,39 @@ class ShareSheetViewController: UIViewController { private func setupUI() { pagesCountLabel.set(text: "", color: .mainText, font: .regular(16)) - whatsappLabel.set(localized: "Whatsapp", color: .mainText, font: .regular(12)) - telegramLabel.set(localized: "Telegram", color: .mainText, font: .regular(12)) - airdropLabel.set(localized: "Gmail", color: .mainText, font: .regular(12)) - printLabel.set(localized: "Print", color: .mainText, font: .regular(12)) - moreLabel.set(localized: "More", color: .mainText, font: .regular(12)) + whatsappLabel.set(localized: .whatsapp, color: .mainText, font: .regular(12)) + telegramLabel.set(localized: .telegram, color: .mainText, font: .regular(12)) + airdropLabel.set(localized: .gmail, color: .mainText, font: .regular(12)) + printLabel.set(localized: .print, color: .mainText, font: .regular(12)) + moreLabel.set(localized: .more, color: .mainText, font: .regular(12)) whatsappLabel.textAlignment = .center telegramLabel.textAlignment = .center airdropLabel.textAlignment = .center printLabel.textAlignment = .center moreLabel.textAlignment = .center - fileNameTextField.placeholder = "File name" + fileNameTextField.placeholder = .fileName.localized backgroundView.layer.cornerRadius = 30 backgroundView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] pdfImage.layer.cornerRadius = 10 pdfImage.clipsToBounds = true pdfImage.contentMode = .scaleAspectFill - previewButton.setImage(UIImage(named: "preview")?.tint(with: .mainText), for: .normal) + previewButton.setImage(.preview.tint(with: .mainText), for: .normal) shareStackView.isHidden = !isShareShown shareStack_height.constant = isShareShown ? 96 : 0 + + view.backgroundColor = .mainBackground } private func setup() { let _ = self.session?.scannedItems[0].render(completion: { image in self.pdfImage.image = image?.retrieveImage() }) - pagesCountLabel.set(text: "\(self.session?.scannedItems.count ?? 0) pages") + + let pagesCount = self.session?.scannedItems.count ?? 0 + let text = String.dPages.localizedPlural(argument: pagesCount) + + pagesCountLabel.set(text: text) } diff --git a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift index b828d037360f48dad1b86527f4112535c2f18594..d7bc532c3f9cea1645c00fdb232b42886bea91fe 100644 --- a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift +++ b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift @@ -63,8 +63,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, } scanSession = MultiPageScanSession() options = ImageScannerOptions() - navigationItem.title = "File Manager" - let settingsButton = UIBarButtonItem(image: UIImage(named: "settings"), style: .done, target: self, action: #selector(openSettings)) + let settingsButton = UIBarButtonItem(image: .settings, style: .done, target: self, action: #selector(openSettings)) navigationItem.rightBarButtonItem = settingsButton tableView.register(UINib(nibName: "DocumentsTableViewCell", bundle: nil), forCellReuseIdentifier: "DocumentsTableViewCell") @@ -74,6 +73,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, tableView.dataSource = self tableView.reloadData() + tableView.backgroundColor = .mainBackground let savedFolders = AppConfigurator().getFolders() for item in savedFolders { @@ -107,12 +107,15 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, fixedTableSheet.layer.shadowOffset = CGSize(width: 0, height: 2) // Shadow position fixedTableSheet.layer.shadowOpacity = 0.7 // Shadow opacity fixedTableSheet.layer.shadowRadius = 4.0 - fixedTableSheet.backgroundColor = .white // or any non-clear color + fixedTableSheet.backgroundColor = .mainBackground fixedTableSheet.clipsToBounds = false - noFilesLabel.set(text: "No Files to show", color: .mainText, font: .medium(22)) + noFilesLabel.isHidden = true fetchViewModels() + navigationController?.navigationBar.prefersLargeTitles = false + + view.backgroundColor = .mainBackground } override func viewWillAppear(_ animated: Bool) { @@ -120,6 +123,13 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, scanSession?.removeAll() self.tabBarController?.tabBar.isHidden = false fetchViewModels() + + handleBackIcon() + navigationItem.title = .fileManager.localized + noFilesLabel.set(text: .noFilesToShow.localized, color: .mainText, font: .medium(22)) + + AllFolderView.reloadLocalization() + searchForFilesView.reloadLocalization() } deinit { @@ -144,16 +154,10 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, } @objc private func openSettings() { - if #available(iOS 16.0, *) { - let liveScan = DataScannerViewController(recognizedDataTypes: [.text()], - qualityLevel: .balanced, - isHighlightingEnabled: true) - liveScan.delegate = self - try? liveScan.startScanning() - self.present(liveScan, animated: true) - } else { - let settings = SettingViewController() - self.navigationController?.pushViewController(settings, animated: false) + + if let navigationController { + let settingsCoorindator = SettingsViewCoordinator(navigationController: navigationController) + settingsCoorindator.start() } } @@ -255,24 +259,24 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, // Trash action let trash = UIContextualAction(style: .destructive, - title: "Delete".localized) { [weak self] (_, _, completionHandler) in + title: .delete.localized) { [weak self] (_, _, completionHandler) in self?.deleteFile(at: indexPath) completionHandler(true) } trash.backgroundColor = .systemRed - trash.image = UIImage(systemName: "trash")?.tint(with: .white) + trash.image = .trash?.tint(with: .white) // Rename action let rename = UIContextualAction(style: .normal, - title: "Rename".localized) { [weak self] (_, _, completionHandler) in + title: .rename.localized) { [weak self] (_, _, completionHandler) in self?.renameFile(at: indexPath) completionHandler(true) } rename.backgroundColor = UIColor.black.withAlphaComponent(0.5) - rename.image = UIImage(systemName: "square.and.pencil")?.tint(with: .white) + rename.image = .squareAndPencil?.tint(with: .white) let move = UIContextualAction(style: .normal, - title: "Move".localized) { [weak self] (_, _, completionHandler) in + title: .move.localized) { [weak self] (_, _, completionHandler) in if let viewModel = self?.isSearching == true ? self?.searchedViewModel[indexPath.row] : self?.viewModels[indexPath.row] { self?.moveto(file: viewModel) } @@ -318,7 +322,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, private func renameFile(at indexPath: IndexPath) { let viewModel = isSearching ? searchedViewModel[indexPath.row] : viewModels[indexPath.row] - renameAlertController = UIAlertController(title: "Rename document".localized, message: nil, preferredStyle: .alert) + renameAlertController = UIAlertController(title: .renameDocument.localized, message: nil, preferredStyle: .alert) renameAlertController!.addTextField { [weak self] textField in guard let self = self else { return } @@ -329,7 +333,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, textField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) } - let continueAction = UIAlertAction(title: "Rename".localized, + let continueAction = UIAlertAction(title: .rename.localized, style: .default) { [weak self] _ in guard let self = self else { return } guard let textFields = self.renameAlertController?.textFields else { return } @@ -345,7 +349,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, } renameAlertController!.addAction(continueAction) - renameAlertController!.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + renameAlertController!.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) renameAlertController?.actions.first?.isEnabled = false present(renameAlertController!, animated: true) } @@ -363,9 +367,9 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, if UserDefaults.standard.askOnSwipeDelete { let alertController = UIAlertController(title: Bundle.appName, - message: "Are you sure you want to delete this document?".localized, preferredStyle: .alert) + message: .deleteDocumentMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Yes, delete!".localized, style: .destructive, handler: { [weak self] action in + let okAction = UIAlertAction(title: .yesDelete.localized, style: .destructive, handler: { [weak self] action in guard let self = self else { return } self.delete(file: viewModel.fileURL, at: indexPath) @@ -373,7 +377,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, alertController.addAction(okAction) - alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + alertController.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) alertController.popoverPresentationController?.sourceView = tableView.cellForRow(at: indexPath) present(alertController, animated: true) } else { @@ -483,7 +487,7 @@ extension DocumentsTableViewController: ScannerViewControllerDelegate { extension DocumentsTableViewController: AllFolderTableViewCellDelegate { func addFolderTapped() { - alert(confirm: "Add Folder", destructive: "Cancel", message: "Add Folder?"){ folderName in + alert(confirm: .addFolder, destructive: .cancel, message: .addFolderMessage){ folderName in let newFolder = AppConfigurator.Folder(name: folderName, savedName: folderName.replacingOccurrences(of: " ", with: "_"), isSelected: false) var currentFolders = AppConfigurator().getFolders() currentFolders.append(newFolder) @@ -595,7 +599,7 @@ extension DocumentsTableViewController: DataScannerViewControllerDelegate { let alertController = UIAlertController(title: Bundle.appName, message: text.transcript, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + alertController.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) self.dismiss(animated: true) { self.present(alertController, animated: true) } @@ -628,3 +632,26 @@ extension DocumentsTableViewController: FoldersViewControllerDelegate { } } } + +extension DocumentsTableViewController { + + private func handleBackIcon() { + + let navigationController = navigationController! + + var backImage: UIImage? = nil + + let deviceLanguage = SupportedLanguage.device.language + let currentLanguageLayoutDirection = SupportedLanguage.currentLanguage.layoutDirection + + if deviceLanguage == .ar { + backImage = currentLanguageLayoutDirection == .leftToRight ? .chevronRight : .chevronLeft + } + else { + backImage = currentLanguageLayoutDirection == .leftToRight ? .chevronLeft : .chevronRight + } + + navigationController.navigationBar.backIndicatorImage = backImage + navigationController.navigationBar.backIndicatorTransitionMaskImage = backImage + } +} diff --git a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift index fdbc867ccd32e3aaf01aaf34f774a8d788c6f4d6..782858f27fe9cb97c95aa2d70345d6c226e3679d 100644 --- a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift +++ b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift @@ -68,6 +68,9 @@ class FoldersViewController: UIViewController { collectionView.delegate = self collectionView.dataSource = self collectionView.reloadData() + + view.backgroundColor = .mainBackground + collectionView.backgroundColor = .mainBackground } } diff --git a/MiniScanner/Modules/Documents/Model/File.swift b/MiniScanner/Modules/Documents/Model/File.swift index 0320c027ea64c2b8661b217400a184090a8356b9..13698b31fa85863614ee59ff1ad27670bf8978b8 100644 --- a/MiniScanner/Modules/Documents/Model/File.swift +++ b/MiniScanner/Modules/Documents/Model/File.swift @@ -31,6 +31,10 @@ class File: NSObject { self.fileExtension = fileURL.pathExtension self.date = fileURL.getDate pdfDocument = PDFDocument(url: fileURL) - self.pagesCount = "\(pdfDocument?.pageCount ?? 1) pages" + + let pagesCount = pdfDocument?.pageCount ?? 1 + let text = String.dPages.localizedPlural(argument: pagesCount) + + self.pagesCount = text // "\(pdfDocument?.pageCount ?? 1) pages" } } diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index dc4aa68a9caf89d4a48604c3fab82893df19cb11..af4550a778a66817ba389ecee8a4d2088c5aabd3 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -25,6 +25,12 @@ public class EditViewController: UIViewController { @IBOutlet weak var banner: BannerView! @IBOutlet weak var pageIndex: UILabel! @IBOutlet weak var continueButton: UIButton! + @IBOutlet weak var directShareLabel: UILabel! + + @IBOutlet weak var signatureLabel: UILabel! + @IBOutlet weak var cropLabel: UILabel! + @IBOutlet weak var editLabel: UILabel! + @IBOutlet weak var exportTextLabel: UILabel! // MARK: - Properties private var scanSession:MultiPageScanSession? @@ -70,15 +76,23 @@ public class EditViewController: UIViewController { view.addSubview(activityIndicator) continueButton.backgroundColor = .mainBlue - continueButton.setTitle("Continue", for: .normal) + continueButton.set(localized: .Continue) continueButton.setTitleColor(.white, for: .normal) continueButton.layer.cornerRadius = 10 localFileManager = LocalFileManager() options = ImageScannerOptions() configImageEditor() - let backButton = UIBarButtonItem(title: "Back", style: .plain, target: self, action: #selector(backTapped)) + let backButton = UIBarButtonItem(title: .back.localized, style: .plain, target: self, action: #selector(backTapped)) self.navigationItem.leftBarButtonItem = backButton + directShareLabel.set(localized: .directShare) + + signatureLabel.text = .signature.localized + exportTextLabel.text = .exportText.localized + editLabel.text = .edit.localized + cropLabel.text = .crop.localized + + view.backgroundColor = .mainBackground } public override func viewWillAppear(_ animated: Bool) { @@ -105,9 +119,9 @@ public class EditViewController: UIViewController { if self.navigationItem.rightBarButtonItem == nil { self.navigationController?.popViewController(animated: true) } else { - let alertController = UIAlertController(title: "Alert", message: "Do you want to discard the changes you've made?", preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, message: .discardChangesMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Discard", style: .destructive) { (action) in + let okAction = UIAlertAction(title: .discard.localized, style: .destructive) { (action) in self.dismiss(animated: true) { if let items = self.scanSession?.scannedItems { @@ -126,7 +140,7 @@ public class EditViewController: UIViewController { } } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -267,9 +281,9 @@ public class EditViewController: UIViewController { let bottomSheetController = NBBottomSheetController(configuration: configuration) bottomSheetController.present(popup, on: self) } else { - let alertController = UIAlertController(title: "Alert", message: "Do you want to discard the changes you've made and continue?", preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, message: .discardChangesAndContinueMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Yes", style: .destructive) { (action) in + let okAction = UIAlertAction(title: .yes.localized, style: .destructive) { (action) in self.dismiss(animated: true) { if let items = self.scanSession?.scannedItems { @@ -296,7 +310,7 @@ public class EditViewController: UIViewController { } } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -369,7 +383,7 @@ public class EditViewController: UIViewController { } } isCropping = true - let cropButton = UIBarButtonItem(title: "Crop", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let cropButton = UIBarButtonItem(title: .crop.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = cropButton @@ -433,9 +447,9 @@ 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 alertController = UIAlertController(title: .alert.localized, message: .deleteImageMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Yes", style: .default) { (action) in + let okAction = UIAlertAction(title: .yes.localized, style: .default) { (action) in self.scanSession?.remove(index: index) if index != 0 { self.selectedIndex = index - 1 @@ -453,7 +467,7 @@ extension EditViewController: BannerViewDelegate { self.dismiss(animated: true) } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -557,9 +571,9 @@ extension EditViewController: EPSignatureDelegate { self.banner.isEditing = true self.signatureImage = signatureImage if (self.scanSession?.scannedItems.count ?? 0) > 1 { - let alertController = UIAlertController(title: "", message: "Do you want to sign:", preferredStyle: .alert) + let alertController = UIAlertController(title: "", message: .signMsg.localized, preferredStyle: .alert) - let allAction = UIAlertAction(title: "All document", style: .default) { (action) in + let allAction = UIAlertAction(title: .allDocument, style: .default) { (action) in if let items = self.scanSession?.scannedItems { for (index, _) in items.enumerated() { @@ -572,13 +586,13 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } - let currentAction = UIAlertAction(title: "Current page", style: .default) { (action) in + let currentAction = UIAlertAction(title: .currentPage.localized, style: .default) { (action) in if let items = self.scanSession?.scannedItems { for (index, _) in items.enumerated() { if index == self.banner.pagerView.currentIndex { @@ -592,11 +606,11 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.banner.isEditing = false self.dismiss(animated: true) } @@ -620,7 +634,7 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } diff --git a/MiniScanner/Modules/EditViewController/EditViewController.xib b/MiniScanner/Modules/EditViewController/EditViewController.xib index 417be6149ac2191c36d2334dec296a5c78072fae..7e465bc20d223f7e9bdbe504c679bab320f41aa3 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.xib +++ b/MiniScanner/Modules/EditViewController/EditViewController.xib @@ -1,9 +1,9 @@ <?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"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_72" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <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"/> @@ -21,7 +21,12 @@ <connections> <outlet property="banner" destination="4ep-ST-cZS" id="WFR-ov-H7F"/> <outlet property="continueButton" destination="jE5-UT-fB1" id="v74-7i-T0B"/> + <outlet property="cropLabel" destination="fB8-gh-FgW" id="Lm5-hr-Iol"/> + <outlet property="directShareLabel" destination="Kl7-O6-xwc" id="64C-0v-w2g"/> + <outlet property="editLabel" destination="qsI-va-wrT" id="bgi-CV-nVT"/> + <outlet property="exportTextLabel" destination="7JD-iL-DeH" id="rkg-DS-xq4"/> <outlet property="pageIndex" destination="cqF-h7-7PR" id="KbK-o3-cPN"/> + <outlet property="signatureLabel" destination="wyA-kN-C8j" id="MsC-hs-DpR"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> </connections> </placeholder> diff --git a/MiniScanner/Modules/OCRViewController/OCRViewController.swift b/MiniScanner/Modules/OCRViewController/OCRViewController.swift index 7bc835835f363ff11c4889b9cea9687711fd6780..98990c3f9d565cda309dbe238d9ae2a1d0ed159a 100644 --- a/MiniScanner/Modules/OCRViewController/OCRViewController.swift +++ b/MiniScanner/Modules/OCRViewController/OCRViewController.swift @@ -26,7 +26,7 @@ class OCRViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() recognizeText() - let co = UIBarButtonItem(title: "Copy", style: .plain, target: self, action: #selector(copyText)) + let co = UIBarButtonItem(title: .copy.localized, style: .plain, target: self, action: #selector(copyText)) self.navigationItem.rightBarButtonItem = co let handler = VNImageRequestHandler(cgImage: ocrImage.cgImage!, options: [:]) @@ -39,7 +39,7 @@ class OCRViewController: UIViewController { @objc func copyText() { UIPasteboard.general.string = self.ocrTextView.text - self.view.makeToast("Copied to clipboard!") + self.view.makeToast(.copiedToClipboard.localized) } 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() - } -} diff --git a/MiniScanner/Supporting Files/AppDelegate.swift b/MiniScanner/Supporting Files/AppDelegate.swift index eda1335b3374049e496bf7f123f093857805f228..a7769728b20b2b73c68103265cd824706cbfd534 100644 --- a/MiniScanner/Supporting Files/AppDelegate.swift +++ b/MiniScanner/Supporting Files/AppDelegate.swift @@ -1,5 +1,4 @@ import UIKit -import LanguageManager_iOS import IQKeyboardManagerSwift @main @@ -8,7 +7,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. - ThemeManager.shared.setupTheme() + + initializeDependencies() + + @Inject var handleAppLanguageUseCase: HandleAppLanguageUseCase + handleAppLanguageUseCase.execute() + if let savedFolders = UserDefaults.standard.object(forKey: "folders") as? Data { print("nooo!!") } else { @@ -19,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { IQKeyboardManager.shared.toolbarConfiguration.previousNextDisplayMode = .alwaysShow IQKeyboardManager.shared.toolbarConfiguration.tintColor = .mainBlue - setAppLanguage() return true } @@ -38,41 +41,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } - - // MARK: - Set Language - private func setAppLanguage() { - if let language = UserDefaults.standard.string(forKey: Keys.appLanguage) { - if language == .en { - setEnglishLanguage() - } else { - setArabicLanguage() - } - } else { - if let deviceLanguage = Bundle.main.preferredLocalizations.first { - if deviceLanguage == "ar" || deviceLanguage == "ar-KW" { - setArabicLanguage() - } else if deviceLanguage == "en" { - setEnglishLanguage() - } - } else { - setEnglishLanguage() - } - } - } - - private func setArabicLanguage() { - LanguageManager.shared.setLanguage(language: .ar) - LanguageManager.shared.defaultLanguage = .ar - UserDefaults.standard.setValue(String.ar, forKey: Keys.appLanguage) - } - - private func setEnglishLanguage() { - LanguageManager.shared.setLanguage(language: .en) - LanguageManager.shared.defaultLanguage = .en - UserDefaults.standard.setValue(String.en, forKey: Keys.appLanguage) - } - - } struct AppConfigurator { @@ -92,11 +60,11 @@ struct AppConfigurator { var isSelected: Bool } - func setDefaults() { - let allDocs = AppConfigurator.Folder(name: "All Documents", savedName: "all_documents", isSelected: true) - let passports = AppConfigurator.Folder(name: "Passports", savedName: "passports", isSelected: false) - let contracts = AppConfigurator.Folder(name: "Contracts", savedName: "contracts", isSelected: false) - let identifiers = AppConfigurator.Folder(name: "Identifiers", savedName: "identifiers", isSelected: false) + func setDefaults() { + let allDocs = AppConfigurator.Folder(name: .allDocuments.localized, savedName: "all_documents", isSelected: true) + let passports = AppConfigurator.Folder(name: .passports.localized, savedName: "passports", isSelected: false) + let contracts = AppConfigurator.Folder(name: .contracts.localized, savedName: "contracts", isSelected: false) + let identifiers = AppConfigurator.Folder(name: .identifiers.localized, savedName: "identifiers", isSelected: false) let folders = [allDocs, passports, contracts, identifiers] @@ -129,3 +97,10 @@ extension Bundle { return bundleDisplayname ?? bundleName } } + +extension AppDelegate { + + private func initializeDependencies() { + _ = DependencyManager() + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Bar Tint.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Bar Tint.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..9bf4ebcee1f44f1302c3faa98f91b0f4469ba423 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Bar Tint.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x33", + "green" : "0x33", + "red" : "0x33" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Buttons Blue.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Buttons Blue.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..1ee49e185ca53baf49d55c9b7858815487299d5c --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Buttons Blue.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x86", + "red" : "0x1F" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFE" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Cell Background.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Cell Background.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..3a962ac1f6aa10a61b66664347c300d1f38c2708 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Cell Background.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF4", + "green" : "0xF4", + "red" : "0xF4" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x33", + "green" : "0x33", + "red" : "0x33" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..73c00596a7fca3f3d4bdd64053b69d86745f9e10 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Light Button.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Light Button.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..814694de83a368d86269625df7e232022328ce5a --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Light Button.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF2", + "green" : "0xED", + "red" : "0xE9" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF2", + "green" : "0xED", + "red" : "0xE9" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Main Background.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Main Background.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..fc8af76fa7fa8aa25a23e1396f6b3264e069091a --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Main Background.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x44", + "green" : "0x44", + "red" : "0x44" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Main Blue.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Main Blue.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..5babd882d85d2f644cff1f0f2c0e7808c0f93104 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Main Blue.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x7E", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x7E", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Main Text.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Main Text.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..f7b308d4b9cfd34fc493635045263d2acc6006f1 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Main Text.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x50", + "green" : "0x50", + "red" : "0x50" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x50", + "green" : "0x50", + "red" : "0x50" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Separator.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Separator.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..83491adc62167abc1fdea71998ab99e6688dac63 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Separator.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x64", + "green" : "0x64", + "red" : "0x64" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFE" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Tint.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Tint.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..f9fd806619fd43def77293f245a5dde02c486cb9 --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Tint.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC6", + "green" : "0x4F", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC6", + "green" : "0x4F", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/Colors.xcassets/Titles Text.colorset/Contents.json b/MiniScanner/Supporting Files/Colors.xcassets/Titles Text.colorset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..6e67b4237e61004e11d616965aaaf0c8459d347a --- /dev/null +++ b/MiniScanner/Supporting Files/Colors.xcassets/Titles Text.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x88", + "green" : "0x88", + "red" : "0x88" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x88", + "green" : "0x88", + "red" : "0x88" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MiniScanner/Supporting Files/FontChooserContainerView.swift b/MiniScanner/Supporting Files/FontChooserContainerView.swift index 9dafde4453519c43077ee30d07b3533f0790e4e9..78fb7635ee7b10df28e70b8dfd8290474a38cb4b 100644 --- a/MiniScanner/Supporting Files/FontChooserContainerView.swift +++ b/MiniScanner/Supporting Files/FontChooserContainerView.swift @@ -118,7 +118,7 @@ class FontChooserContainerView: UIView, ZLTextFontChooserDelegate { } let hideBtn = UIButton(type: .custom) - hideBtn.setImage(UIImage(named: "close"), for: .normal) + hideBtn.setImage(.close, for: .normal) hideBtn.backgroundColor = .clear hideBtn.titleLabel?.font = UIFont.systemFont(ofSize: 14) hideBtn.addTarget(self, action: #selector(hideBtnClick), for: .touchUpInside) diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift index adab235d7e0888b1a3e69e2822fed950c78bba9f..bb59a13e38cb45382a7e5926289cc1927308a67b 100644 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift +++ b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift @@ -532,17 +532,17 @@ extension ScannerViewController: CustomTabBarViewDelegate { if multipageSession.scannedItems.isEmpty { self.navigationController?.popViewController(animated: false) } else { - let alertController = UIAlertController(title: "Alert", - message: "You have captured some images, do you want to discard them?".localized, preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, + message: .discardScannerMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Discard".localized, style: .destructive, handler: { [weak self] action in + let okAction = UIAlertAction(title: .discard.localized, style: .destructive, handler: { [weak self] action in guard let self = self else { return } self.navigationController?.popViewController(animated: false) }) alertController.addAction(okAction) - alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil)) + alertController.addAction(UIAlertAction(title: .cancel.localized, style: .cancel, handler: nil)) present(alertController, animated: true) } } diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/de.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/de.lproj/Localizable.strings deleted file mode 100644 index 6ae9dfb6d529c817a6211281a0f707f7ceb28d3f..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/de.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. - */ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "Weiter"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "Scan editieren"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "Überprüfen"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "Abbrechen"; -"wescan.scanning.auto" = "Auto"; -"wescan.scanning.manual" = "Manuell"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/en.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/en.lproj/Localizable.strings deleted file mode 100644 index ec645987447f59bb264e5c7cda8af4348a54cb42..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/en.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. -*/ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "Next"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "Edit Scan"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "Review"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "Cancel"; -"wescan.scanning.auto" = "Auto"; -"wescan.scanning.manual" = "Manual"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/fr.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/fr.lproj/Localizable.strings deleted file mode 100644 index b05f258eac508c3b29ff2a16abf6e2b55dc5b033..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/fr.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. - */ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "Suivant"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "Modifier"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "Aperçu"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "Annuler"; -"wescan.scanning.auto" = "Auto"; -"wescan.scanning.manual" = "Manuel"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/it.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/it.lproj/Localizable.strings deleted file mode 100644 index ed4b1867e5144b235af4f926d9625929eb4a09ae..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/it.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. -*/ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "Avanti"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "Modifica Scansione"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "Analisi"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "Annulla"; -"wescan.scanning.auto" = "Auto"; -"wescan.scanning.manual" = "Manuale"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/pt-PT.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/pt-PT.lproj/Localizable.strings deleted file mode 100644 index 44da26d1632171cb429b1237bdc85991e1e72ed9..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/pt-PT.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. -*/ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "Avançar"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "Editar imagem"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "Rever"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "Cancelar"; -"wescan.scanning.auto" = "Auto"; -"wescan.scanning.manual" = "Manual"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hans.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hans.lproj/Localizable.strings deleted file mode 100644 index d136a22c2b4e8edc36d11e4ff612dc438b8d1979..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hans.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. -*/ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "下一æ¥"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "编辑"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "回顾"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "å–æ¶ˆ"; -"wescan.scanning.auto" = "自动"; -"wescan.scanning.manual" = "手动"; diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hant.lproj/Localizable.strings b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hant.lproj/Localizable.strings deleted file mode 100644 index e560c2f89d9b6f52c50d488cc5337a54fe9ab385..0000000000000000000000000000000000000000 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/zh-Hant.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ -/* - localizable.strings - WeScanSampleProject - - Created by Boris Emorine on 2/27/18. - Copyright © 2018 WeTransfer. All rights reserved. -*/ - -/* The "Next" button on the right side of the navigation bar on the Edit screen. */ -"wescan.edit.button.next" = "下一æ¥"; - -/* The title on the navigation bar of the Edit screen. */ -"wescan.edit.title" = "編輯"; - -/* The title on the navigation bar of the Review screen. */ -"wescan.review.title" = "回顧"; - -/* The button titles on the Scanning screen. */ -"wescan.scanning.cancel" = "å–æ¶ˆ"; -"wescan.scanning.auto" = "自動"; -"wescan.scanning.manual" = "手動"; diff --git a/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift index 0f4213677d8d40c8dbe898332eb89fa02c7c9df0..9a590974e3c4210487d19a4b72dd204057fb7f9c 100644 --- a/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift +++ b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift @@ -99,7 +99,7 @@ open class FSPagerViewCell: UICollectionViewCell { trashButton = UIButton(frame: CGRect(x: xPosition, y: Int(yPosition), width: 50, height: 50)) // Adjust frame as needed self.contentView.addSubview(trashButton) // Add the button to the cell's contentView - trashButton.setImage(UIImage(systemName: "trash.fill"), for: .normal) + trashButton.setImage(.trashFill, for: .normal) trashButton.addTarget(self, action: #selector(topLeftButtonTapped), for: .touchUpInside) // Set the button action trashButton.tintColor = .red @@ -109,7 +109,7 @@ open class FSPagerViewCell: UICollectionViewCell { previewButton = UIButton(frame: CGRect(x: Int(previewXPosition), y: Int(previewYPosition), width: 50, height: 50)) // Adjust frame as needed self.contentView.addSubview(previewButton) // Add the button to the cell's contentView - previewButton.setImage(UIImage(systemName: "eye"), for: .normal) + previewButton.setImage(.eye, for: .normal) previewButton.addTarget(self, action: #selector(imagePreview), for: .touchUpInside) // Set the button action previewButton.tintColor = .red imageView.contentMode = .scaleAspectFit @@ -263,11 +263,9 @@ open class FSPagerViewCell: UICollectionViewCell { print("position: \(position)") stickerView.center = position stickerView.delegate = self - if let exitIcon = UIImage(named: "close"), - let rotateIcon = UIImage(named: "resize") { - stickerView.setImage(exitIcon, forHandler: StickerViewHandler.close) - stickerView.setImage(rotateIcon, forHandler: StickerViewHandler.rotate) - } + + stickerView.setImage(.close, forHandler: StickerViewHandler.close) + stickerView.setImage(.resize, forHandler: StickerViewHandler.rotate) stickerView.showEditing = false stickerView.transform = stickerView.transform.rotated(by: CGFloat(rotation)) diff --git a/MiniScanner/Supporting Files/ImageStickerContainerView.swift b/MiniScanner/Supporting Files/ImageStickerContainerView.swift index 8df375b55238f29210d6eb17c1156bf507c0daa2..c9a96ba1117fc574519ae137867242ad255e149e 100644 --- a/MiniScanner/Supporting Files/ImageStickerContainerView.swift +++ b/MiniScanner/Supporting Files/ImageStickerContainerView.swift @@ -69,7 +69,7 @@ class ImageStickerContainerView: UIView, ZLImageStickerContainerDelegate { } let hideBtn = UIButton(type: .custom) - hideBtn.setImage(UIImage(named: "close"), for: .normal) + hideBtn.setImage(.close, for: .normal) hideBtn.backgroundColor = .clear hideBtn.titleLabel?.font = UIFont.systemFont(ofSize: 14) hideBtn.addTarget(self, action: #selector(hideBtnClick), for: .touchUpInside) diff --git a/MiniScanner/Supporting Files/Info.plist b/MiniScanner/Supporting Files/Info.plist index 4e28385494dcdfbc030f42916a3670714c2dd2f9..7648ba4f28faf911acce826c4c1f60d66ca46c07 100644 --- a/MiniScanner/Supporting Files/Info.plist +++ b/MiniScanner/Supporting Files/Info.plist @@ -70,7 +70,5 @@ <array> <string>UIInterfaceOrientationPortrait</string> </array> - <key>UIUserInterfaceStyle</key> - <string>Light</string> </dict> </plist> diff --git a/MiniScanner/Supporting Files/Localization/Localizable.xcstrings b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings new file mode 100644 index 0000000000000000000000000000000000000000..663a613933d3007b577770add46cf2f29459f75d --- /dev/null +++ b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings @@ -0,0 +1,1272 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "%d pages" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "variations" : { + "plural" : { + "few" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d ØµÙØØ§Øª" + } + }, + "many" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d ØµÙØØ©" + } + }, + "one" : { + "stringUnit" : { + "state" : "translated", + "value" : "ØµÙØØ© ÙˆØ§ØØ¯Ø©" + } + }, + "other" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d ØµÙØØ§Øª" + } + }, + "two" : { + "stringUnit" : { + "state" : "translated", + "value" : "ØµÙØØªØ§Ù†" + } + }, + "zero" : { + "stringUnit" : { + "state" : "translated", + "value" : "لا يوجد ØµÙØØ§Øª" + } + } + } + } + }, + "en" : { + "variations" : { + "plural" : { + "one" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d Page" + } + }, + "other" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d Pages" + } + }, + "zero" : { + "stringUnit" : { + "state" : "translated", + "value" : "No pages" + } + } + } + } + } + } + }, + "add" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ø¥Ø¶Ø§ÙØ©" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add" + } + } + } + }, + "add_folder" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ø¥Ø¶Ø§ÙØ© مجلد" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add Folder" + } + } + } + }, + "add_folder_message" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ø¥Ø¶Ø§ÙØ© مجلد؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add Folder ?" + } + } + } + }, + "alert" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تنبيه" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Alert" + } + } + } + }, + "all_document" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "كامل المستند" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "All document" + } + } + } + }, + "all_documents" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "كل المستندات" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "All Documents" + } + } + } + }, + "app_theme" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "App theme" + } + } + } + }, + "appearence" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "مظهر التطبيق" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Appearence" + } + } + } + }, + "are_you_sure" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل أنت متأكد" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Are you sure?" + } + } + } + }, + "back" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "رجوع" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Back" + } + } + } + }, + "camera" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "كاميرا" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Camera" + } + } + } + }, + "cancel" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إلغاء" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cancel" + } + } + } + }, + "continue" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "متابعة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Continue" + } + } + } + }, + "contracts" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "العقود" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Contracts" + } + } + } + }, + "copied_to_clipboard" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Copied to clipboard!" + } + } + } + }, + "copy" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "نسخ" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Copy" + } + } + } + }, + "crop" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "قص" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Crop" + } + } + } + }, + "current_page" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ø§Ù„ØµÙØØ© Ø§Ù„ØØ§Ù„ية" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Current Page" + } + } + } + }, + "dark_mode" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "الوضع الليلي" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dark mode" + } + } + } + }, + "delete" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "ØØ°Ù" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Delete" + } + } + } + }, + "delete_document" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "ØØ°Ù المستند" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Delete document" + } + } + } + }, + "delete_document_msg" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل أنت متأكد أنك تريد ØØ°Ù هذا المستند؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Are you sure you want to delete this document?" + } + } + } + }, + "delete_image_msg" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل أنت متأكد أنك تريد ØØ°Ù هذه الصورة؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Are you sure you want to delete this image?" + } + } + } + }, + "device_language" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "لغة الجهاز" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Device language" + } + } + } + }, + "device_theme" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Device Theme" + } + } + } + }, + "direct_share" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "مشاركة Ùورية" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Direct Share" + } + } + } + }, + "discard" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تجاهل" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Discard" + } + } + } + }, + "discard_changes_and_continue_msg" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل تريد تجاهل التعديلات التي قمت بها والمتابعة؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to discard the changes you've made and continue?." + } + } + } + }, + "discard_changes_msg" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل تريد تجاهل التعديلات التي قمت بها؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to discard the changes you've made?" + } + } + } + }, + "discard_scanner_msg" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "لقد قمت بالتقاط بعض الصور، هل أنت متأكد أنك تريد تجاهلها؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "You have captured some images, do you want to discard them?" + } + } + } + }, + "done" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تم" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Done" + } + } + } + }, + "edit" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تعديل" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Edit" + } + } + } + }, + "entire_document" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "كامل المستند" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Entire document" + } + } + } + }, + "export_text" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "استخراج النص" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Export text" + } + } + } + }, + "file_manager" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "مدير Ø§Ù„Ù…Ù„ÙØ§Øª" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "File Manager" + } + } + } + }, + "file_name" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "اسم الملÙ" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "File name" + } + } + } + }, + "folder_files" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ù…Ù„ÙØ§Øª المجلد" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Folder files" + } + } + } + }, + "folder_name" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "اسم المجلد" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Folder name" + } + } + } + }, + "folders" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "المجلدات" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Folders" + } + } + } + }, + "gallery" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "المعرض" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gallery" + } + } + } + }, + "gmail" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gmail" + } + } + } + }, + "identifiers" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "الهويات" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Identifiers" + } + } + } + }, + "language" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "اللغة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Language" + } + } + } + }, + "light_mode" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "الوضع النهاري" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Light mode" + } + } + } + }, + "more" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "المزيد" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "More" + } + } + } + }, + "move" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "نقل" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Move" + } + } + } + }, + "no" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "لا" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "No" + } + } + } + }, + "no_files_to_show" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "لا يوجد Ù…Ù„ÙØ§Øª للعرض" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "No Files to show" + } + } + } + }, + "ok" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ok" + } + } + } + }, + "passports" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "جوازات Ø§Ù„Ø³ÙØ±" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Passports" + } + } + } + }, + "preview" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "معاينة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Preview" + } + } + } + }, + "print" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "طباعة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Print" + } + } + } + }, + "rename" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إعادة تسمية" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Rename" + } + } + } + }, + "rename_document" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إعادة تسمية المستند" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Rename document" + } + } + } + }, + "scan" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Scan" + } + } + } + }, + "settings" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "الإعدادات" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Settings" + } + } + } + }, + "sign_msg" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to sign:" + } + } + } + }, + "signature" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "توقيع" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Signature" + } + } + } + }, + "telegram" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تلغرام" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Telegram" + } + } + } + }, + "this_week" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هذا الأسبوع" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "This week" + } + } + } + }, + "today" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "اليوم" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Today" + } + } + } + }, + "wescan.edit.button.done" : { + "comment" : "A generic done button", + "extractionState" : "extracted_with_value", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تم" + } + }, + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Done" + } + } + } + }, + "wescan.edit.button.next" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "التالي" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Next" + } + } + } + }, + "wescan.edit.button.save" : { + "comment" : "Save button", + "extractionState" : "extracted_with_value", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "ØÙظ" + } + }, + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Save" + } + } + } + }, + "wescan.edit.title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Edit Scan" + } + } + } + }, + "wescan.review.title" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "مراجعة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Review" + } + } + } + }, + "wescan.scanning.auto" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "آلي" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Auto" + } + } + } + }, + "wescan.scanning.cancel" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إلغاء" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cancel" + } + } + } + }, + "wescan.scanning.manual" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "يدوي" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Manual" + } + } + } + }, + "whatsapp" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "واتساب" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Whatsapp" + } + } + } + }, + "yes" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "نعم" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Yes" + } + } + } + }, + "yes_delete" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "نعم، ØØ°Ù!" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Yes, delete!" + } + } + } + }, + "yesterday" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ø§Ù„Ø¨Ø§Ø±ØØ©" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Yesterday" + } + } + } + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/MiniScanner/Supporting Files/SceneDelegate.swift b/MiniScanner/Supporting Files/SceneDelegate.swift index 28988ff20927c6e071abec158880668cef0436b2..97a3b835e7d05fe74beb8f48487315e5ce60ca67 100644 --- a/MiniScanner/Supporting Files/SceneDelegate.swift +++ b/MiniScanner/Supporting Files/SceneDelegate.swift @@ -15,6 +15,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { let navigationController = AppTabBarController.buildViewController()//BaseNavigationViewController.buildViewController() window?.rootViewController = navigationController window?.makeKeyAndVisible() + + @Inject var handleAppStartUseCase: HandleAppStartUseCase + + handleAppStartUseCase.execute() } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 7a6e41248e7f9e390f2d5903eb5f0b79811dbed9..a2d2f4e45eeffaa7bbd5d759bbc5872a7b5952b9 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 3B6258C4E2C1059AABC67D66F9314FE8 /* Pods-MiniScanner-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MiniScanner-acknowledgements.markdown"; sourceTree = "<group>"; }; 3C53B8519BC6ACB20FAB10CD35EA45E4 /* NBBottomSheet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = NBBottomSheet.debug.xcconfig; sourceTree = "<group>"; }; 3CB35CAE22A8D6C0BE783A689D5D3541 /* EPSignature-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "EPSignature-dummy.m"; sourceTree = "<group>"; }; - 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = EPSignature; path = EPSignature.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EPSignature.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55096EB5A40F7CB24180EDC9F3EC511B /* EPSignature.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = EPSignature.debug.xcconfig; sourceTree = "<group>"; }; 5801546255F9EF1F65284B93A54FA593 /* NBBottomSheet-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NBBottomSheet-prefix.pch"; sourceTree = "<group>"; }; 5D07C1C57799623C9E72ED017D80D19A /* EPSignature-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "EPSignature-prefix.pch"; sourceTree = "<group>"; }; @@ -75,10 +75,10 @@ 7CC191E7994C3C7161A6641B457C9166 /* Pods-MiniScanner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MiniScanner.debug.xcconfig"; sourceTree = "<group>"; }; 86B11CF937B3CCD0B6A6541ADF4B8C64 /* EPSignature-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "EPSignature-Info.plist"; sourceTree = "<group>"; }; 89194C84FD5E62D9D2C9F2157676FF5C /* Pods-MiniScanner-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MiniScanner-acknowledgements.plist"; sourceTree = "<group>"; }; - 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = NBBottomSheet; path = NBBottomSheet.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NBBottomSheet.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9311D435EB5FF3E24E7932038D65D926 /* EPSignatureViewController.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; name = EPSignatureViewController.xib; path = Pod/Classes/EPSignatureViewController.xib; sourceTree = "<group>"; }; 976B8085DC82710F9620DDCE5BA70A32 /* NBBottomSheet-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NBBottomSheet-dummy.m"; sourceTree = "<group>"; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; AC9E338141AAC78DA68EE142D4F21C5B /* NBConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NBConfiguration.swift; path = NBBottomSheet/NBBottomSheet/Sources/NBConfiguration.swift; sourceTree = "<group>"; }; B2968141E72EA49CC006DD4020E3386D /* Pods-MiniScanner-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MiniScanner-frameworks.sh"; sourceTree = "<group>"; }; BBBB6316686E0FE5CC7D0C42A233FD6E /* NBBottomSheetPresentationTransition.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NBBottomSheetPresentationTransition.swift; path = NBBottomSheet/NBBottomSheet/Sources/NBBottomSheetPresentationTransition.swift; sourceTree = "<group>"; }; @@ -159,7 +159,6 @@ AC9E338141AAC78DA68EE142D4F21C5B /* NBConfiguration.swift */, B51EDF87BDDABDD39EFDF561D09C6D84 /* Support Files */, ); - name = NBBottomSheet; path = NBBottomSheet; sourceTree = "<group>"; }; @@ -172,7 +171,6 @@ 009E190AEFA92AD872F6491697F92847 /* Resources */, 8BBB5D6887F53A525D1A845FDC973674 /* Support Files */, ); - name = EPSignature; path = EPSignature; sourceTree = "<group>"; }; @@ -254,8 +252,8 @@ F5C3923B4670EB0FDE0960B441ABF085 /* Products */ = { isa = PBXGroup; children = ( - 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature */, - 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet */, + 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature.framework */, + 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet.framework */, 3438B9790556194C521D4C9806D29C85 /* Pods-MiniScanner */, ); name = Products; @@ -307,7 +305,7 @@ ); name = EPSignature; productName = EPSignature; - productReference = 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature */; + productReference = 3DFAC6F70B9CECADF5873F487AF082BA /* EPSignature.framework */; productType = "com.apple.product-type.framework"; }; 4372AB6A3C495222906A1ABFD39A4463 /* Pods-MiniScanner */ = { @@ -345,7 +343,7 @@ ); name = NBBottomSheet; productName = NBBottomSheet; - productReference = 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet */; + productReference = 91BC4F27F2DA380ABC44B3609495F0E1 /* NBBottomSheet.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -470,7 +468,7 @@ GCC_PREFIX_HEADER = "Target Support Files/EPSignature/EPSignature-prefix.pch"; INFOPLIST_FILE = "Target Support Files/EPSignature/EPSignature-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -542,7 +540,7 @@ GCC_PREFIX_HEADER = "Target Support Files/EPSignature/EPSignature-prefix.pch"; INFOPLIST_FILE = "Target Support Files/EPSignature/EPSignature-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -705,7 +703,7 @@ GCC_PREFIX_HEADER = "Target Support Files/NBBottomSheet/NBBottomSheet-prefix.pch"; INFOPLIST_FILE = "Target Support Files/NBBottomSheet/NBBottomSheet-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -776,7 +774,7 @@ GCC_PREFIX_HEADER = "Target Support Files/NBBottomSheet/NBBottomSheet-prefix.pch"; INFOPLIST_FILE = "Target Support Files/NBBottomSheet/NBBottomSheet-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks",