Skip to content

Commit

Permalink
[Pod release] Trying to remove assets' struct #16
Browse files Browse the repository at this point in the history
  • Loading branch information
mozharovsky committed Jan 17, 2017
1 parent 4dec6a7 commit be3f031
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 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"
s.version = "0.0.9.1"
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Source/ATHImagePickerCaptureViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ final public class ATHImagePickerCaptureViewController: UIViewController, PhotoC

switch flashMode {
case .on:
let image = config.assets?.flashOnImage ??
let image = /*config.assets?.flashOnImage ??*/
UIImage(named: "Flash", in: bundle, compatibleWith: nil)

flashButton.setImage(image, for: .normal)

case .off:
let image = config.assets?.flashOffImage ??
let image = /*config.assets?.flashOffImage ??*/
UIImage(named: "FlashOff", in: bundle, compatibleWith: nil)

flashButton.setImage(image, for: .normal)

case .auto:
let image = config.assets?.flashAutoImage ??
let image = /*config.assets?.flashAutoImage ??*/
UIImage(named: "FlashAuto", in: bundle, compatibleWith: nil)

flashButton.setImage(image, for: .normal)
Expand Down Expand Up @@ -162,7 +162,7 @@ final public class ATHImagePickerCaptureViewController: UIViewController, PhotoC
statusBarAnimation = config.statusBarAnimation

let bundle = Bundle(for: self.classForCoder)
let image = config.assets?.switchCameraIcon ??
let image = /*config.assets?.switchCameraIcon ??*/
UIImage(named: "FlipCamera", in: bundle, compatibleWith: nil)
switchButton.setImage(image, for: .normal)
}
Expand Down
48 changes: 24 additions & 24 deletions Source/ATHImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import UIKit
internal typealias Color = ATHImagePickerColor

internal protocol StatusBarUpdatable {
//associatedtype Config
func updateStatusBar(with config: ATHImagePickerStatusBarConfig)
associatedtype Config
func updateStatusBar(with config: Config)
}

extension StatusBarUpdatable where Self: UIViewController {
func updateStatusBar(with config: ATHImagePickerStatusBarConfig) {
extension StatusBarUpdatable where Self: UIViewController, Self.Config == ATHImagePickerStatusBarConfig {
func updateStatusBar(with config: Config) {
if config.isAnimated {
UIView.animate(withDuration: config.animationDuration) {
self.setNeedsStatusBarAppearanceUpdate()
Expand Down Expand Up @@ -72,22 +72,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
Expand All @@ -103,7 +103,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,
Expand All @@ -115,8 +115,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
Expand All @@ -130,7 +130,7 @@ public struct ATHImagePickerPageConfig {
self.isStatusBarHidden = isStatusBarHidden
self.statusBarAnimation = statusBarAnimation

self.assets = assets
//self.assets = assets
}
}

Expand Down

0 comments on commit be3f031

Please sign in to comment.