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/Extensions/UIImage+Images.swift b/MiniScanner/Extensions/UIImage+Images.swift index 255f457f4bdfb87b82262e4220bcdde269fa9a3c..4bae801d8ad46385c21f7ecf763f26fa832c0656 100644 --- a/MiniScanner/Extensions/UIImage+Images.swift +++ b/MiniScanner/Extensions/UIImage+Images.swift @@ -11,6 +11,17 @@ import UIKit // MARK: - App images and icons extension UIImage { + static let addDocIcon = UIImage(named: "add_doc_icon") + static let preview = UIImage(named: "preview") + + static let tabbarIPad = UIImage(named: "tabbarIpad") + static let tabBar = UIImage(named: "tabBar") + + static let settings = UIImage(named: "settings") + + static let resize = UIImage(named: "resize") + + static let close = UIImage(named: "close") } // MARK: - Common system images and icons diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift index df78b9d45e520020276dfbf1462ccffa6896b6c4..d07f1a7ddf3b2df6a6c39392a8a4ca67c5059945 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift @@ -60,14 +60,14 @@ class CustomTabBarView: UIView { } private func setupUI() { - editImageIcon.image = UIImage(named: "preview") + 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 : .tabBar tabbarImage.isHidden = isAddedToPDF fileManagerButton.isHidden = isAddedToPDF galleryButton.isHidden = isAddedToPDF diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift index 6c3827d4c540438bb7dfcab00812b04b5d70dd42..1f9b3c19a13a5ada4fa5973db1101e145ef0b05c 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift @@ -67,7 +67,7 @@ class ShareSheetViewController: UIViewController { 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 } diff --git a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift index bf853e92c201b0ad8baa91030d74e4f657d39a90..100a5a051e624f17a53b1e4a820a106308ac262b 100644 --- a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift +++ b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift @@ -64,7 +64,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, scanSession = MultiPageScanSession() options = ImageScannerOptions() navigationItem.title = .fileManager.localized - 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") 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/FSPager/FSPagerViewCell.swift b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift index 27a03d10548120f1fed817b8a87ce1ae3a527d90..b2b792cf153a0a03b35effe005b2367144cda1cd 100644 --- a/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift +++ b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift @@ -263,8 +263,8 @@ open class FSPagerViewCell: UICollectionViewCell { print("position: \(position)") stickerView.center = position stickerView.delegate = self - if let exitIcon = UIImage(named: "close"), - let rotateIcon = UIImage(named: "resize") { + if let exitIcon = UIImage.close, + let rotateIcon = UIImage.resize { stickerView.setImage(exitIcon, forHandler: StickerViewHandler.close) stickerView.setImage(rotateIcon, forHandler: StickerViewHandler.rotate) } 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)