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

This PR includes 4 changes #780

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1cbe8b1
show UI for video compression options
Oct 11, 2022
8a32cf9
remove old file else its not deleted from temp folder
Oct 11, 2022
4be3ea9
user default sort descriptor as modificationDate
Oct 11, 2022
7078615
updated version to 5.3.0
Oct 12, 2022
978e3a9
Merge pull request #1 from niralishaha25/dev
niralishaha25 Oct 12, 2022
84318c6
included YPVideoCompressionVC.storyboard in build phase
Nov 1, 2022
f4966c7
fixed crash in YPImagePicker. selected video and then click on cancel
Nov 1, 2022
7f8ccf6
Merge pull request #2 from niralishaha25/dev
niralishaha25 Nov 1, 2022
dd65901
Revert "included YPVideoCompressionVC.storyboard in build phase"
Nov 1, 2022
28c675e
added storyboard to resources
Nov 1, 2022
e06ed7c
Merge pull request #3 from niralishaha25/dev
niralishaha25 Nov 1, 2022
b9843e6
no message
Nov 1, 2022
fcc030c
Merge pull request #4 from niralishaha25/dev
niralishaha25 Nov 1, 2022
e2cb258
added Bundle for YPVideoCompressionVC
Nov 1, 2022
4f69fdb
Merge pull request #5 from niralishaha25/dev
niralishaha25 Nov 1, 2022
7d9e81e
fixed bug in picking multiple videos with compress options
Nov 1, 2022
15d7ff7
Merge pull request #6 from niralishaha25/dev
niralishaha25 Nov 1, 2022
1a1b84b
fix in video compression
Nov 10, 2022
5eaa916
Merge pull request #7 from niralishaha25/dev
niralishaha25 Nov 10, 2022
cb0c721
fix bug in video compression
Nov 10, 2022
ac4c5ff
Merge pull request #8 from niralishaha25/dev
niralishaha25 Nov 10, 2022
a669169
The compression and sorting option is completely configurable
Nov 10, 2022
020dc3d
Merge pull request #9 from niralishaha25/dev
niralishaha25 Nov 10, 2022
52f4446
keep original as default vide compression option
Jan 11, 2023
7e194f9
Merge pull request #10 from niralishaha25/dev
niralishaha25 Jan 11, 2023
97c361f
keep original as default vide compression option
Jan 11, 2023
067431a
Merge pull request #11 from niralishaha25/dev
niralishaha25 Jan 11, 2023
58a0beb
Added option to select more photos
Jan 12, 2023
03e58e0
Merge pull request #12 from niralishaha25/dev
niralishaha25 Jan 12, 2023
ccb78c8
stop spinner when 0 selected items
Jan 12, 2023
e1ebc9a
Merge pull request #13 from niralishaha25/dev
niralishaha25 Jan 12, 2023
dc38032
spinner should be public
Jan 12, 2023
3164db0
Merge pull request #14 from niralishaha25/dev
niralishaha25 Jan 12, 2023
b6b33ff
added see all photos option for limited photo
Jan 17, 2023
b5f8513
Merge pull request #15 from niralishaha25/dev
niralishaha25 Jan 17, 2023
678dc12
fix in added buttons bottom constraint
Jan 18, 2023
b3320f4
Merge pull request #16 from niralishaha25/dev
niralishaha25 Jan 18, 2023
b4ceb52
updated bottom constraint of button
Jan 20, 2023
2340b58
Merge pull request #17 from niralishaha25/dev
niralishaha25 Jan 20, 2023
4d40d0c
fixed bug in showing select more photos options when defaultMultipleS…
Jan 20, 2023
f8db4d2
Merge pull request #18 from niralishaha25/dev
niralishaha25 Jan 20, 2023
767be82
fix bug in select more when no photo selected for limited mode
Jan 20, 2023
8634b0e
Merge pull request #19 from niralishaha25/dev
niralishaha25 Jan 20, 2023
adb12c5
stop spinner if photo permission not given
Jan 30, 2023
3c0f2b9
Merge pull request #20 from niralishaha25/dev
niralishaha25 Jan 30, 2023
736fc0f
Single media in single album deselect crash fix
RonitOfficial Oct 1, 2024
29b66da
Merge pull request #21 from RonitOfficial/master
niralishaha25 Oct 1, 2024
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
Prev Previous commit
Next Next commit
stop spinner if photo permission not given
Nirali Shah committed Jan 30, 2023
commit adb12c594b44be23a5bebb633b5c7de238857aa0
10 changes: 5 additions & 5 deletions Source/Helpers/Permissions/YPPermissionCheckable.swift
Original file line number Diff line number Diff line change
@@ -9,20 +9,20 @@
import UIKit

internal protocol YPPermissionCheckable {
func doAfterLibraryPermissionCheck(block: @escaping () -> Void)
func doAfterLibraryPermissionCheck(block: @escaping (Bool) -> Void)
func doAfterCameraPermissionCheck(block: @escaping () -> Void)
func checkLibraryPermission()
func checkCameraPermission()
}

internal extension YPPermissionCheckable where Self: UIViewController {
func doAfterLibraryPermissionCheck(block: @escaping () -> Void) {
func doAfterLibraryPermissionCheck(block: @escaping (Bool) -> Void) {
YPPermissionManager.checkLibraryPermissionAndAskIfNeeded(sourceVC: self) { hasPermission in
if hasPermission {
block()
} else {
if !hasPermission {
ypLog("Not enough permissions.")
}
block(hasPermission)

}
}

16 changes: 10 additions & 6 deletions Source/Pages/Gallery/YPLibraryVC.swift
Original file line number Diff line number Diff line change
@@ -157,8 +157,10 @@ internal final class YPLibraryVC: UIViewController, YPPermissionCheckable {

@objc
func squareCropButtonTapped() {
doAfterLibraryPermissionCheck { [weak self] in
self?.v.assetViewContainer.squareCropButtonTapped()
doAfterLibraryPermissionCheck { hasPermission in
if hasPermission {
self.v.assetViewContainer.squareCropButtonTapped()
}
}
}

@@ -194,11 +196,13 @@ internal final class YPLibraryVC: UIViewController, YPPermissionCheckable {
return
}

doAfterLibraryPermissionCheck { [weak self] in
if self?.isMultipleSelectionEnabled == false {
self?.selectedItems.removeAll()
doAfterLibraryPermissionCheck { hasPermission in
if hasPermission {
if self.isMultipleSelectionEnabled == false {
self.selectedItems.removeAll()
}
self.toggleMultipleSelection()
}
self?.toggleMultipleSelection()
}
}

8 changes: 6 additions & 2 deletions Source/YPPickerVC.swift
Original file line number Diff line number Diff line change
@@ -166,8 +166,12 @@ open class YPPickerVC: YPBottomPager, YPBottomPagerDelegate {

// Re-trigger permission check
if let vc = vc as? YPLibraryVC {
vc.doAfterLibraryPermissionCheck { [weak vc] in
vc?.initialize()
vc.doAfterLibraryPermissionCheck { hasPermission in
if hasPermission {
vc.initialize()
} else {
vc.v.stopSpinner()
}
}
} else if let cameraVC = vc as? YPCameraVC {
cameraVC.start()