|
@@ -700,12 +700,9 @@ class NCUtility: NSObject {
|
|
|
}
|
|
|
|
|
|
func getDefaultUserIcon() -> UIImage {
|
|
|
- if #available(iOS 13.0, *) {
|
|
|
- let config = UIImage.SymbolConfiguration(pointSize: 30)
|
|
|
- return NCUtility.shared.loadImage(named: "person.crop.circle", symbolConfiguration: config)
|
|
|
- } else {
|
|
|
- return NCUtility.shared.loadImage(named: "person.crop.circle", size: 30)
|
|
|
- }
|
|
|
+
|
|
|
+ let config = UIImage.SymbolConfiguration(pointSize: 30)
|
|
|
+ return NCUtility.shared.loadImage(named: "person.crop.circle", symbolConfiguration: config)
|
|
|
}
|
|
|
|
|
|
@objc func createAvatar(image: UIImage, size: CGFloat) -> UIImage {
|
|
@@ -849,44 +846,24 @@ class NCUtility: NSObject {
|
|
|
|
|
|
func colorNavigationController(_ navigationController: UINavigationController?, backgroundColor: UIColor, titleColor: UIColor, tintColor: UIColor?, withoutShadow: Bool) {
|
|
|
|
|
|
- if #available(iOS 13.0, *) {
|
|
|
-
|
|
|
- // iOS 14, 15
|
|
|
- let appearance = UINavigationBarAppearance()
|
|
|
- appearance.titleTextAttributes = [.foregroundColor: titleColor]
|
|
|
- appearance.largeTitleTextAttributes = [.foregroundColor: titleColor]
|
|
|
-
|
|
|
- if withoutShadow {
|
|
|
- appearance.shadowColor = .clear
|
|
|
- appearance.shadowImage = UIImage()
|
|
|
- }
|
|
|
-
|
|
|
- if let tintColor = tintColor {
|
|
|
- navigationController?.navigationBar.tintColor = tintColor
|
|
|
- }
|
|
|
-
|
|
|
- navigationController?.view.backgroundColor = backgroundColor
|
|
|
- navigationController?.navigationBar.barTintColor = titleColor
|
|
|
- navigationController?.navigationBar.standardAppearance = appearance
|
|
|
- navigationController?.navigationBar.compactAppearance = appearance
|
|
|
- navigationController?.navigationBar.scrollEdgeAppearance = appearance
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- navigationController?.navigationBar.isTranslucent = true
|
|
|
- navigationController?.navigationBar.barTintColor = backgroundColor
|
|
|
+ let appearance = UINavigationBarAppearance()
|
|
|
+ appearance.titleTextAttributes = [.foregroundColor: titleColor]
|
|
|
+ appearance.largeTitleTextAttributes = [.foregroundColor: titleColor]
|
|
|
|
|
|
- if withoutShadow {
|
|
|
- navigationController?.navigationBar.shadowImage = UIImage()
|
|
|
- navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
|
- }
|
|
|
+ if withoutShadow {
|
|
|
+ appearance.shadowColor = .clear
|
|
|
+ appearance.shadowImage = UIImage()
|
|
|
+ }
|
|
|
|
|
|
- let titleDict: NSDictionary = [NSAttributedString.Key.foregroundColor: titleColor]
|
|
|
- navigationController?.navigationBar.titleTextAttributes = titleDict as? [NSAttributedString.Key: Any]
|
|
|
- if let tintColor = tintColor {
|
|
|
- navigationController?.navigationBar.tintColor = tintColor
|
|
|
- }
|
|
|
+ if let tintColor = tintColor {
|
|
|
+ navigationController?.navigationBar.tintColor = tintColor
|
|
|
}
|
|
|
+
|
|
|
+ navigationController?.view.backgroundColor = backgroundColor
|
|
|
+ navigationController?.navigationBar.barTintColor = titleColor
|
|
|
+ navigationController?.navigationBar.standardAppearance = appearance
|
|
|
+ navigationController?.navigationBar.compactAppearance = appearance
|
|
|
+ navigationController?.navigationBar.scrollEdgeAppearance = appearance
|
|
|
}
|
|
|
|
|
|
func getEncondingDataType(data: Data) -> String.Encoding? {
|