Skip to content

Commit

Permalink
Merge pull request hyperoslo#468 from abdallahEid/configuration-class…
Browse files Browse the repository at this point in the history
…-renaming

Renaming Configuration class to ImagePickerConfiguration
  • Loading branch information
3lvis authored Oct 7, 2020
2 parents 079f350 + f56b91a commit ecee6e2
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Source/AssetManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open class AssetManager {
return UIImage(named: name, in: bundle, compatibleWith: traitCollection) ?? UIImage()
}

public static func fetch(withConfiguration configuration: Configuration, _ completion: @escaping (_ assets: [PHAsset]) -> Void) {
public static func fetch(withConfiguration configuration: ImagePickerConfiguration, _ completion: @escaping (_ assets: [PHAsset]) -> Void) {
guard PHPhotoLibrary.authorizationStatus() == .authorized else { return }

DispatchQueue.global(qos: .background).async {
Expand Down
4 changes: 2 additions & 2 deletions Source/BottomView/BottomContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class BottomContainerView: UIView {
static let height: CGFloat = 101
}

var configuration = Configuration()
var configuration = ImagePickerConfiguration()

lazy var pickerButton: ButtonPicker = { [unowned self] in
let pickerButton = ButtonPicker(configuration: self.configuration)
Expand Down Expand Up @@ -65,7 +65,7 @@ open class BottomContainerView: UIView {

// MARK: Initializers

public init(configuration: Configuration? = nil) {
public init(configuration: ImagePickerConfiguration? = nil) {
if let configuration = configuration {
self.configuration = configuration
}
Expand Down
4 changes: 2 additions & 2 deletions Source/BottomView/ButtonPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ButtonPicker: UIButton {
static let buttonBorderSize: CGFloat = 68
}

var configuration = Configuration()
var configuration = ImagePickerConfiguration()

lazy var numberLabel: UILabel = { [unowned self] in
let label = UILabel()
Expand All @@ -27,7 +27,7 @@ class ButtonPicker: UIButton {

// MARK: - Initializers

public init(configuration: Configuration? = nil) {
public init(configuration: ImagePickerConfiguration? = nil) {
if let configuration = configuration {
self.configuration = configuration
}
Expand Down
4 changes: 2 additions & 2 deletions Source/CameraView/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protocol CameraViewDelegate: class {

class CameraView: UIViewController, CLLocationManagerDelegate, CameraManDelegate {

var configuration = Configuration()
var configuration = ImagePickerConfiguration()

lazy var blurView: UIVisualEffectView = { [unowned self] in
let effect = UIBlurEffect(style: .dark)
Expand Down Expand Up @@ -102,7 +102,7 @@ class CameraView: UIViewController, CLLocationManagerDelegate, CameraManDelegate
private var currentZoomFactor: CGFloat = 1.0
private var previousZoomFactor: CGFloat = 1.0

public init(configuration: Configuration? = nil) {
public init(configuration: ImagePickerConfiguration? = nil) {
if let configuration = configuration {
self.configuration = configuration
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Configuration.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AVFoundation
import UIKit

@objc public class Configuration: NSObject {
@objc public class ImagePickerConfiguration: NSObject {

// MARK: Colors

Expand Down Expand Up @@ -67,7 +67,7 @@ import UIKit
}

// MARK: - Orientation
extension Configuration {
extension ImagePickerConfiguration {

@objc public var rotationTransform: CGAffineTransform {
let currentOrientation = UIDevice.current.orientation
Expand Down
4 changes: 2 additions & 2 deletions Source/ImageGallery/ImageGalleryLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import UIKit

class ImageGalleryLayout: UICollectionViewFlowLayout {

let configuration: Configuration
let configuration: ImagePickerConfiguration

init(configuration: Configuration) {
init(configuration: ImagePickerConfiguration) {
self.configuration = configuration
super.init()
}
Expand Down
4 changes: 2 additions & 2 deletions Source/ImageGallery/ImageGalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ open class ImageGalleryView: UIView {
static let galleryBarHeight: CGFloat = 24
}

var configuration = Configuration()
var configuration = ImagePickerConfiguration()

lazy open var collectionView: UICollectionView = { [unowned self] in
let collectionView = UICollectionView(frame: CGRect.zero,
Expand Down Expand Up @@ -90,7 +90,7 @@ open class ImageGalleryView: UIView {

// MARK: - Initializers

public init(configuration: Configuration? = nil) {
public init(configuration: ImagePickerConfiguration? = nil) {
if let configuration = configuration {
self.configuration = configuration
}
Expand Down
8 changes: 4 additions & 4 deletions Source/ImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Photos

open class ImagePickerController: UIViewController {

let configuration: Configuration
let configuration: ImagePickerConfiguration

struct GestureConstants {
static let maximumHeight: CGFloat = 200
Expand Down Expand Up @@ -91,18 +91,18 @@ open class ImagePickerController: UIViewController {

// MARK: - Initialization

@objc public required init(configuration: Configuration = Configuration()) {
@objc public required init(configuration: ImagePickerConfiguration = ImagePickerConfiguration()) {
self.configuration = configuration
super.init(nibName: nil, bundle: nil)
}

public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
self.configuration = Configuration()
self.configuration = ImagePickerConfiguration()
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}

public required init?(coder aDecoder: NSCoder) {
self.configuration = Configuration()
self.configuration = ImagePickerConfiguration()
super.init(coder: aDecoder)
}

Expand Down
4 changes: 2 additions & 2 deletions Source/TopView/TopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class TopView: UIView {
static let height: CGFloat = 34
}

var configuration = Configuration()
var configuration = ImagePickerConfiguration()

var currentFlashIndex = 0
let flashButtonTitles = ["AUTO", "ON", "OFF"]
Expand Down Expand Up @@ -50,7 +50,7 @@ open class TopView: UIView {

// MARK: - Initializers

public init(configuration: Configuration? = nil) {
public init(configuration: ImagePickerConfiguration? = nil) {
if let configuration = configuration {
self.configuration = configuration
}
Expand Down

0 comments on commit ecee6e2

Please sign in to comment.