diff --git a/MHAppKit/Extensions/Foundation/NSError+Presentation.swift b/MHAppKit/Extensions/Foundation/NSError+Presentation.swift index 169041e..7175f96 100644 --- a/MHAppKit/Extensions/Foundation/NSError+Presentation.swift +++ b/MHAppKit/Extensions/Foundation/NSError+Presentation.swift @@ -71,48 +71,15 @@ extension Error { UNUserNotificationCenter.current().add(request, withCompletionHandler: nil) } - ///Show the receiver as a local notification. - ///- parameter title: The title of the notification - ///- parameter configurationHandler: A closure used for addition configuration of the UILocalNotification - ///- note: The message of the notification is the receiver's `localizedDescription`. - @available(tvOS, unavailable) - public func showAsLocalNotification(withTitle title: String, configurationHandler: ((UILocalNotification) -> Void)) { - - let message = self.localizedDescription - - let notification = UILocalNotification() - notification.fireDate = nil - notification.alertBody = message - - if #available(iOS 8.2, *) { - - notification.alertTitle = title - } - - configurationHandler(notification) - - UIApplication.shared.scheduleLocalNotification(notification) - } - ///Show the receiver as a local notification. ///- parameter title: The title of the notification ///- note: The message of the notification is the receiver's `localizedDescription`. @available(tvOS, unavailable) public func showAsLocalNotification(withTitle title: String) { - if #available(iOS 10, *) { - - self.showAsLocalNotification(withTitle: title) { (notificationContent: UNMutableNotificationContent) in - - //default empty configuration - } - } - else { - - self.showAsLocalNotification(withTitle: title) { (notificationContent: UILocalNotification) in - - //default empty configuration - } + self.showAsLocalNotification(withTitle: title) { (notificationContent: UNMutableNotificationContent) in + + //default empty configuration } } diff --git a/MHAppKit/Extensions/UIKit/UIImagePickerController/UIImagePickerControllerMediaInfo+Properties.swift b/MHAppKit/Extensions/UIKit/UIImagePickerController/UIImagePickerControllerMediaInfo+Properties.swift index 3fbe61f..1e14880 100644 --- a/MHAppKit/Extensions/UIKit/UIImagePickerController/UIImagePickerControllerMediaInfo+Properties.swift +++ b/MHAppKit/Extensions/UIKit/UIImagePickerController/UIImagePickerControllerMediaInfo+Properties.swift @@ -98,17 +98,7 @@ extension Dictionary where Key == UIImagePickerController.InfoKey, Value == Any @available(tvOS 10, *) public func fetchAsset() -> PHAsset? { - if #available(iOS 11.0, *), let asset = self.asset { - - return asset - } - - guard let url = self.referenceURL else { - - return nil - } - - return PHAsset.fetchAssets(withALAssetURLs: [url], options: nil).firstObject + return self.asset } } diff --git a/MHAppKit/Extensions/UIKit/UIView/UIView+Snapshot.swift b/MHAppKit/Extensions/UIKit/UIView/UIView+Snapshot.swift index 54b70d6..26bbb06 100644 --- a/MHAppKit/Extensions/UIKit/UIView/UIView+Snapshot.swift +++ b/MHAppKit/Extensions/UIKit/UIView/UIView+Snapshot.swift @@ -42,7 +42,7 @@ extension UIView { if #available(iOS 10.0, *), #available(tvOS 10.0, *) { - let rendererFormat = UIGraphicsImageRendererFormat.default() + let rendererFormat = UIGraphicsImageRendererFormat.preferred() rendererFormat.opaque = self.isOpaque let renderer = UIGraphicsImageRenderer(size: self.bounds.size, format: rendererFormat) diff --git a/MHAppKit/ViewControllers/StaticTableViewController.swift b/MHAppKit/ViewControllers/StaticTableViewController.swift index 92b9992..82f62da 100644 --- a/MHAppKit/ViewControllers/StaticTableViewController.swift +++ b/MHAppKit/ViewControllers/StaticTableViewController.swift @@ -102,7 +102,7 @@ open class StaticTableViewController: UITableViewController, UINavigationControl let h = self.refreshControl?.frame.size.height ?? 0 var offset = self.tableView.contentOffset - offset.y = -h - self.topLayoutGuide.length + offset.y = -h - self.view.safeAreaInsets.top self.tableView.setContentOffset(offset, animated: animated) }