Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements across. #56

Merged
merged 5 commits into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
29D699E91B70ABFC0021FA73 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29D699E71B70ABFC0021FA73 /* LaunchScreen.xib */; };
29D699F51B70ABFC0021FA73 /* ImagePickerDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29D699F41B70ABFC0021FA73 /* ImagePickerDemoTests.swift */; };
29D699FF1B70ACD50021FA73 /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = 29D699FE1B70ACD50021FA73 /* Podfile */; };
C3771E008DA39CF04754C8A9 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 733A7AD0105A657A80502E72 /* Pods.framework */; };
C3771E008DA39CF04754C8A9 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 733A7AD0105A657A80502E72 /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down
4 changes: 2 additions & 2 deletions Demo/ImagePickerDemo/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ DEPENDENCIES:

EXTERNAL SOURCES:
ImagePicker:
:path: "../../"
:path: ../../

SPEC CHECKSUMS:
ImagePicker: 32becfa25b8e9179e60c45411b577340d35e3e32

COCOAPODS: 0.39.0
COCOAPODS: 0.39.0.beta.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giphy-59

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a renegade.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebel without a cause 😎

3 changes: 1 addition & 2 deletions Source/BottomView/StackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ class ImageStackView: UIView {
extension ImageStackView {

func imageDidPush(notification: NSNotification) {
//TODO indexOf in swift 2
let emptyView = views.filter {$0.image == nil}.first
let emptyView = views.filter { $0.image == nil }.first

if let emptyView = emptyView {
animateImageView(emptyView)
Expand Down
4 changes: 3 additions & 1 deletion Source/CameraView/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CameraView: UIViewController {
}()

let captureSession = AVCaptureSession()
let devices = AVCaptureDevice.devices()
var devices = AVCaptureDevice.devices()
var captureDevice: AVCaptureDevice? {
didSet {
if let currentDevice = captureDevice {
Expand Down Expand Up @@ -121,6 +121,8 @@ class CameraView: UIViewController {

let authorizationStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)

if devices.isEmpty { devices = AVCaptureDevice.devices() }

for device in devices {
if let device = device as? AVCaptureDevice where device.hasMediaType(AVMediaTypeVideo) {
if authorizationStatus == .Authorized {
Expand Down
6 changes: 4 additions & 2 deletions Source/ImageGallery/ImageGalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ public class ImageGalleryView: UIView {
let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle")
let bundle = NSBundle(path: bundlePath!)
let traitCollection = UITraitCollection(displayScale: 3)
let image = UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: traitCollection)

guard let image = UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: traitCollection)
else { return UIImage() }

return image!
return image
}

func displayNoImagesMessage(hideCollectionView: Bool) {
Expand Down
2 changes: 2 additions & 0 deletions Source/ImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public class ImagePickerController: UIViewController {
extension ImagePickerController: BottomContainerViewDelegate {

func pickerButtonDidPress() {
bottomContainer.pickerButton.enabled = false
bottomContainer.stackView.startLoader()
collapseGalleryView { [unowned self] in
self.cameraController.takePicture()
Expand Down Expand Up @@ -247,6 +248,7 @@ extension ImagePickerController: CameraViewDelegate {
self.stack.pushAsset(asset)
}
galleryView.shouldTransform = true
bottomContainer.pickerButton.enabled = true

UIView.animateWithDuration(0.3, animations: {
self.galleryView.collectionView.transform = CGAffineTransformMakeTranslation(self.galleryView.collectionSize.width, 0)
Expand Down