From e5d3560c840a8fbf504ea68c2eca3d3afcfb24e1 Mon Sep 17 00:00:00 2001 From: Eugene Mozharovsky Date: Tue, 17 Jan 2017 20:43:39 +0300 Subject: [PATCH] [Pod release] returned assets --- ATHKit.podspec | 2 +- Source/ATHImagePickerController.swift | 50 +++++++++++++++------------ 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ATHKit.podspec b/ATHKit.podspec index d3f15dd..7cd5c2c 100644 --- a/ATHKit.podspec +++ b/ATHKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "ATHKit" -s.version = "0.0.9.2" +s.version = "0.0.9.3" s.summary = "ATHKit is a collection of customizable UI components such as ImagePickerController and more." s.homepage = "https://github.com/Athlee/ATHKit" s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/Source/ATHImagePickerController.swift b/Source/ATHImagePickerController.swift index 8d261e1..28e3485 100644 --- a/Source/ATHImagePickerController.swift +++ b/Source/ATHImagePickerController.swift @@ -31,6 +31,14 @@ extension StatusBarUpdatable where Self: UIViewController, Self.Config == ATHIma } } +internal final class ATHImagePickerStatusBarAppearance { + internal var config = ATHImagePickerStatusBarConfig() + + internal let shared = ATHImagePickerStatusBarAppearance() + + private init() { } +} + // // MARK: - `ATHImagePickerController` public components // @@ -72,22 +80,22 @@ public protocol ATHImagePickerControllerDelegate: class { func imagePickerController(_ picker: ATHImagePickerController, configFor sourceType: ATHImagePickerSourceType) -> ATHImagePickerPageConfig } -//public struct ATHImagePickerAssets { -// public let switchCameraIcon: UIImage? -// public let flashOnImage: UIImage? -// public let flashOffImage: UIImage? -// public let flashAutoImage: UIImage? -// -// public init(switchCameraIcon: UIImage? = nil, -// flashOnImage: UIImage? = nil, -// flashOffImage: UIImage? = nil, -// flashAutoImage: UIImage? = nil) { -// self.switchCameraIcon = switchCameraIcon -// self.flashOnImage = flashOnImage -// self.flashOffImage = flashOffImage -// self.flashAutoImage = flashAutoImage -// } -//} +public struct ATHImagePickerAssets { + public let switchCameraIcon: UIImage? + public let flashOnImage: UIImage? + public let flashOffImage: UIImage? + public let flashAutoImage: UIImage? + + public init(switchCameraIcon: UIImage? = nil, + flashOnImage: UIImage? = nil, + flashOffImage: UIImage? = nil, + flashAutoImage: UIImage? = nil) { + self.switchCameraIcon = switchCameraIcon + self.flashOnImage = flashOnImage + self.flashOffImage = flashOffImage + self.flashAutoImage = flashAutoImage + } +} public struct ATHImagePickerPageConfig { public let leftButtonTitle: String @@ -103,7 +111,7 @@ public struct ATHImagePickerPageConfig { public let isStatusBarHidden: Bool public let statusBarAnimation: UIStatusBarAnimation - //public let assets: ATHImagePickerAssets? + public let assets: ATHImagePickerAssets? public init(leftButtonTitle: String, rightButtonTitle: String, @@ -115,8 +123,8 @@ public struct ATHImagePickerPageConfig { leftButtonColor: UIColor, rightButtonColor: UIColor, isStatusBarHidden: Bool = false, - statusBarAnimation: UIStatusBarAnimation = .none - /*assets: ATHImagePickerAssets? = nil*/) { + statusBarAnimation: UIStatusBarAnimation = .none, + assets: ATHImagePickerAssets? = nil) { self.leftButtonTitle = leftButtonTitle self.rightButtonTitle = rightButtonTitle self.leftButtonImage = leftButtonImage @@ -130,7 +138,7 @@ public struct ATHImagePickerPageConfig { self.isStatusBarHidden = isStatusBarHidden self.statusBarAnimation = statusBarAnimation - //self.assets = assets + self.assets = assets } } @@ -151,8 +159,6 @@ open class ATHImagePickerController: UINavigationController, ATHImagePickerCommi open var sourceType: ATHImagePickerSourceType = [.camera] open weak var pickerDelegate: ATHImagePickerControllerDelegate? - //open static var statusBarConfig = ATHImagePickerStatusBarConfig() - // MARK: - Life cycle override open func viewDidLoad() {