Skip to content

Commit

Permalink
[Pod release] Status bar setup returned
Browse files Browse the repository at this point in the history
* now using the main config
  • Loading branch information
mozharovsky committed Jan 17, 2017
1 parent e5d3560 commit 1c09827
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion ATHKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "ATHKit"
s.version = "0.0.9.3"
s.version = "0.0.9.4"
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" }
Expand Down
10 changes: 4 additions & 6 deletions Source/ATHImagePickerCaptureViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ final public class ATHImagePickerCaptureViewController: UIViewController, PhotoC

fileprivate var isStatusBarHidden: Bool = false {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

fileprivate var statusBarAnimation: UIStatusBarAnimation = .none {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

Expand Down Expand Up @@ -160,8 +158,8 @@ final public class ATHImagePickerCaptureViewController: UIViewController, PhotoC
pageTabBarItem.titleColor = view.window != nil ? config.titleColor : config.titleInactiveColor
pageTabBarItem.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: UIFontWeightMedium)

isStatusBarHidden = config.isStatusBarHidden
statusBarAnimation = config.statusBarAnimation
isStatusBarHidden = config.statusBarConfig.isStatusBarHidden
statusBarAnimation = config.statusBarConfig.statusBarAnimation

let bundle = Bundle(for: self.classForCoder)
let image = /*config.assets?.switchCameraIcon ??*/
Expand Down
33 changes: 16 additions & 17 deletions Source/ATHImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ 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
//
Expand Down Expand Up @@ -108,9 +100,7 @@ public struct ATHImagePickerPageConfig {
public let leftButtonColor: UIColor
public let rightButtonColor: UIColor

public let isStatusBarHidden: Bool
public let statusBarAnimation: UIStatusBarAnimation

public let statusBarConfig: ATHImagePickerStatusBarConfig
public let assets: ATHImagePickerAssets?

public init(leftButtonTitle: String,
Expand All @@ -122,8 +112,7 @@ public struct ATHImagePickerPageConfig {
titleInactiveColor: UIColor,
leftButtonColor: UIColor,
rightButtonColor: UIColor,
isStatusBarHidden: Bool = false,
statusBarAnimation: UIStatusBarAnimation = .none,
statusBarConfig: ATHImagePickerStatusBarConfig = ATHImagePickerStatusBarConfig(),
assets: ATHImagePickerAssets? = nil) {
self.leftButtonTitle = leftButtonTitle
self.rightButtonTitle = rightButtonTitle
Expand All @@ -135,16 +124,26 @@ public struct ATHImagePickerPageConfig {
self.leftButtonColor = leftButtonColor
self.rightButtonColor = rightButtonColor

self.isStatusBarHidden = isStatusBarHidden
self.statusBarAnimation = statusBarAnimation

self.statusBarConfig = statusBarConfig
self.assets = assets
}
}

public struct ATHImagePickerStatusBarConfig {
public var isAnimated: Bool = false
public var isStatusBarHidden = false
public var statusBarAnimation: UIStatusBarAnimation = .none
public var isAnimated = false
public var animationDuration: TimeInterval = 0.3

public init(isStatusBarHidden: Bool = false,
statusBarAnimation: UIStatusBarAnimation = .none,
isAnimated: Bool = false,
animationDuration: TimeInterval = 0.3) {
self.isStatusBarHidden = isStatusBarHidden
self.statusBarAnimation = statusBarAnimation
self.isAnimated = isAnimated
self.animationDuration = animationDuration
}
}

open class ATHImagePickerController: UINavigationController, ATHImagePickerCommiterDelegate {
Expand Down
10 changes: 4 additions & 6 deletions Source/ATHImagePickerSelectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ open class ATHImagePickerSelectionViewController: UIViewController, SelectionCon

fileprivate var isStatusBarHidden: Bool = false {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

fileprivate var statusBarAnimation: UIStatusBarAnimation = .none {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

Expand Down Expand Up @@ -134,8 +132,8 @@ open class ATHImagePickerSelectionViewController: UIViewController, SelectionCon
pageTabBarItem.titleColor = view.window != nil ? config.titleColor : config.titleInactiveColor
pageTabBarItem.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: UIFontWeightMedium)

isStatusBarHidden = config.isStatusBarHidden
statusBarAnimation = config.statusBarAnimation
isStatusBarHidden = config.statusBarConfig.isStatusBarHidden
statusBarAnimation = config.statusBarConfig.statusBarAnimation
}

// MARK: - SelectionController
Expand Down
10 changes: 4 additions & 6 deletions Source/ATHImagePickerTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ open class ATHImagePickerTabBarController: PageTabBarController, StatusBarUpdata

fileprivate var isStatusBarHidden: Bool = false {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

fileprivate var statusBarAnimation: UIStatusBarAnimation = .none {
didSet {
//updateStatusBar(with: ATHImagePickerController.statusBarConfig)
updateStatusBar(with: ATHImagePickerStatusBarConfig())
updateStatusBar(with: config.statusBarConfig)
}
}

Expand Down Expand Up @@ -109,8 +107,8 @@ open class ATHImagePickerTabBarController: PageTabBarController, StatusBarUpdata
pageTabBarItem.titleColor = config.titleColor
pageTabBarItem.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: UIFontWeightMedium)

isStatusBarHidden = config.isStatusBarHidden
statusBarAnimation = config.statusBarAnimation
isStatusBarHidden = config.statusBarConfig.isStatusBarHidden
statusBarAnimation = config.statusBarConfig.statusBarAnimation
}
}

Expand Down

0 comments on commit 1c09827

Please sign in to comment.