Skip to content

Commit

Permalink
fixed #96
Browse files Browse the repository at this point in the history
  • Loading branch information
tilltue committed Mar 26, 2018
1 parent b183f3b commit 7360da1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TLPhotoPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TLPhotoPicker'
s.version = '1.5.4'
s.version = '1.5.5'
s.summary = 'multiple phassets picker for iOS lib. like facebook'

# This description is used to generate tags and improve search results.
Expand Down
18 changes: 14 additions & 4 deletions TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,17 @@ open class TLPhotosPickerViewController: UIViewController {
stopPlay()
}

override open func viewDidLoad() {
super.viewDidLoad()
makeUI()
func checkAuthorization() {
switch PHPhotoLibrary.authorizationStatus() {
case .notDetermined:
PHPhotoLibrary.requestAuthorization { [weak self] status in
self?.initPhotoLibrary()
switch status {
case .authorized:
self?.initPhotoLibrary()
default:
self?.dismiss(done: false)
self?.handleDeniedAlbumsAuthorization()
}
}
case .authorized:
self.initPhotoLibrary()
Expand All @@ -191,6 +195,12 @@ open class TLPhotosPickerViewController: UIViewController {
}
}

override open func viewDidLoad() {
super.viewDidLoad()
makeUI()
checkAuthorization()
}

override open func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if self.thumbnailSize == CGSize.zero {
Expand Down

1 comment on commit 7360da1

@sonjh1217
Copy link

Choose a reason for hiding this comment

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

Thank you

Please sign in to comment.