Skip to content

Commit 6ad1bbe

Browse files
piotrprzeliorztilltue
authored andcommitted
Support iOS 26 UIBarButtonItem APIs
1 parent dad0fb0 commit 6ad1bbe

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

TLPhotoPicker/Classes/TLPhotosPickerConfigure.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ public struct TLPhotosPickerConfigure {
5555
public var groupByFetch: PHFetchedResultGroupedBy? = nil
5656
public var supportedInterfaceOrientations: UIInterfaceOrientationMask = .portrait
5757
public var popup: [PopupConfigure] = []
58+
public var doneButtonHidesSharedBackground = false
59+
public var cancelButtonHidesSharedBackground = false
60+
public var photosButtonHidesSharedBackground = false
61+
5862

5963
public init() {
6064

TLPhotoPicker/Classes/TLPhotosPickerViewController.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,16 @@ extension TLPhotosPickerViewController {
390390
self.titleLabel.text = self.configure.customLocalizedTitle["Camera Roll"]
391391
self.subTitleLabel.text = self.configure.tapHereToChange
392392
self.cancelButton.title = self.configure.cancelTitle
393-
393+
if #available(iOS 26.0, *) {
394+
self.cancelButton.hidesSharedBackground = configure.cancelButtonHidesSharedBackground
395+
}
396+
394397
let attributes: [NSAttributedString.Key: Any] = [.font: UIFont.boldSystemFont(ofSize: UIFont.labelFontSize)]
395398
self.doneButton.setTitleTextAttributes(attributes, for: .normal)
396399
self.doneButton.title = self.configure.doneTitle
400+
if #available(iOS 26.0, *) {
401+
self.doneButton.hidesSharedBackground = configure.doneButtonHidesSharedBackground
402+
}
397403
self.emptyView.isHidden = true
398404
self.emptyImageView.image = self.configure.emptyImage
399405
self.emptyMessageLabel.text = self.configure.emptyMessage
@@ -408,6 +414,10 @@ extension TLPhotosPickerViewController {
408414
self.usedPrefetch = false
409415
}
410416

417+
if #available(iOS 26.0, *) {
418+
self.photosButton.hidesSharedBackground = configure.photosButtonHidesSharedBackground
419+
}
420+
411421
// Setup TableView (Album selection)
412422
self.albumPopView.tableView.delegate = self
413423
self.albumPopView.tableView.dataSource = self

0 commit comments

Comments
 (0)