Skip to content

Commit

Permalink
Fix setting wrong cell type & other minor code presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
daveluong committed Apr 4, 2019
1 parent 83f2f6f commit d1deed0
Show file tree
Hide file tree
Showing 8 changed files with 542 additions and 440 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v1.3.2

* Add new configurable to show live camera view cell in photo picker

## v1.3.1

* Update the project to Xcode 10 [#26](https://github.com/carousell/pickle/pull/26)
Expand Down
2 changes: 2 additions & 0 deletions Example/Pickle/CarousellImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ private struct CarousellTheme: ImagePickerConfigurable {

let doneBarButtonItem: UIBarButtonItem? = UIBarButtonItem(title: "Next", style: .plain, target: nil, action: nil)

let liveCameraViewEnabled: Bool? = false

// MARK: - Navigation Bar

let navigationBarStyle: UIBarStyle? = .blackTranslucent
Expand Down
959 changes: 523 additions & 436 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Pickle/Classes/ImagePickerConfigurable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public protocol ImagePickerConfigurable {
/// A custom bar button item displayed on the right (or trailing) edge of the navigation bar when the receiver is the top navigation item.
var doneBarButtonItem: UIBarButtonItem? { get }

/// Configure to enable/disable live camera view in place of the camera icon cell
var liveCameraViewEnabled: Bool { get }

// MARK: - Navigation Bar

/// The navigation bar style that specifies its appearance.
Expand Down Expand Up @@ -78,6 +75,10 @@ public protocol ImagePickerConfigurable {

/// The margin for the text of the hint label.
var hintTextMargin: UIEdgeInsets? { get }

// MARK: -
/// Specifies whether the photo gallery should show a live camera view cell
var liveCameraViewEnabled: Bool? { get }
}


Expand Down
1 change: 1 addition & 0 deletions LiveView.swift → Pickle/Classes/LiveView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import AVFoundation
import UIKit

final class LiveView: UIView {

Expand Down
6 changes: 6 additions & 0 deletions Pickle/Classes/Parameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import UIKit
/// A struct with placeholders that `ImagePickerConfigurable` requires.
public struct Parameters: ImagePickerConfigurable {


/// Returns a configuration instance with default parameters.
public init() {}

Expand Down Expand Up @@ -79,4 +80,9 @@ public struct Parameters: ImagePickerConfigurable {
/// The margin for the text of the hint label.
public var hintTextMargin: UIEdgeInsets?

// MARK: -

/// Specifies weather photo gallery should show a live preview
public var liveCameraViewEnabled: Bool?

}
1 change: 1 addition & 0 deletions Pickle/Classes/PhotoGalleryLiveViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import Foundation
import AVFoundation
import UIKit

final class PhotoGalleryLiveViewCell: UICollectionViewCell {

Expand Down
2 changes: 1 addition & 1 deletion Pickle/Classes/PhotoGalleryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal final class PhotoGalleryViewController: UIViewController,
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: PhotoGalleryLiveViewCell.self), for: indexPath)
return cell
} else {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: PhotoGalleryCell.self), for: indexPath)
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: PhotoGalleryCameraCell.self), for: indexPath)
return cell
}
}
Expand Down

0 comments on commit d1deed0

Please sign in to comment.