|
@@ -28,14 +28,6 @@ open class ImageVideoPicker: NSObject {
|
|
|
|
|
|
self.pickerController.delegate = self
|
|
|
self.pickerController.allowsEditing = false
|
|
|
-
|
|
|
- if UIBarButtonItem.appearance().titleTextAttributes(for: .normal) != nil {
|
|
|
- isBlackCancelButton = UIBarButtonItem.appearance().titleTextAttributes(for: .normal)?.values.first as! NSObject == UIColor.black
|
|
|
- }
|
|
|
- if !isBlackCancelButton {
|
|
|
- let cancelButtonAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
|
|
|
- UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes , for: .normal)
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
enum Source {
|
|
@@ -46,6 +38,13 @@ open class ImageVideoPicker: NSObject {
|
|
|
}
|
|
|
|
|
|
func present(source sourceView: Source) {
|
|
|
+ if UIBarButtonItem.appearance().titleTextAttributes(for: .normal) != nil {
|
|
|
+ isBlackCancelButton = UIBarButtonItem.appearance().titleTextAttributes(for: .normal)?.values.first as! NSObject == UIColor.black
|
|
|
+ }
|
|
|
+ if !isBlackCancelButton {
|
|
|
+ let cancelButtonAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
|
|
|
+ UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes , for: .normal)
|
|
|
+ }
|
|
|
if (sourceView == .imageAlbum) {
|
|
|
self.pickerController.mediaTypes = ["public.image"]
|
|
|
self.pickerController.sourceType = .savedPhotosAlbum
|