diff --git a/Demo/Images.xcassets/AppIcon.appiconset/Contents.json b/Demo/Images.xcassets/AppIcon.appiconset/Contents.json index eeea76c..9221b9b 100644 --- a/Demo/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Demo/Images.xcassets/AppIcon.appiconset/Contents.json @@ -2,72 +2,97 @@ "images" : [ { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" + "scale" : "1x", + "size" : "29x29" }, { "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" + "scale" : "1x", + "size" : "40x40" }, { "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" + "scale" : "1x", + "size" : "76x76" }, { "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Demo/Images.xcassets/progress.imageset/Contents.json b/Demo/Images.xcassets/progress.imageset/Contents.json index 2971541..77a6fec 100644 --- a/Demo/Images.xcassets/progress.imageset/Contents.json +++ b/Demo/Images.xcassets/progress.imageset/Contents.json @@ -1,15 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "progress.pdf" + "filename" : "progress.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { - "template-rendering-intent" : "original" + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/PKHUD.xcodeproj/project.pbxproj b/PKHUD.xcodeproj/project.pbxproj index 7b2c1ee..7c164e7 100644 --- a/PKHUD.xcodeproj/project.pbxproj +++ b/PKHUD.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 12CE19FD1E2578680062D873 /* PKHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F996321E19514FD8001F73CA /* PKHUD.framework */; }; 3097AF3A1C4843AE007DD42B /* PKHUDRotatingImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3097AF391C4843AE007DD42B /* PKHUDRotatingImageView.swift */; }; 640011571C5B6C080013F32B /* HUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 640011551C5B6C080013F32B /* HUD.swift */; }; + AC028B24255C285F001B6ACD /* UIColor+.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC028B23255C285F001B6ACD /* UIColor+.swift */; }; F908BEC01BB849290015E5A8 /* PKHUDSuccessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F908BEBF1BB849290015E5A8 /* PKHUDSuccessView.swift */; }; F908BEC31BB84D0B0015E5A8 /* PKHUDAnimating.swift in Sources */ = {isa = PBXBuildFile; fileRef = F908BEC21BB84D0B0015E5A8 /* PKHUDAnimating.swift */; }; F908BEC51BB852C60015E5A8 /* PKHUDErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F908BEC41BB852C60015E5A8 /* PKHUDErrorView.swift */; }; @@ -88,6 +89,7 @@ 12CE19F51E25784D0062D873 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3097AF391C4843AE007DD42B /* PKHUDRotatingImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDRotatingImageView.swift; sourceTree = ""; }; 640011551C5B6C080013F32B /* HUD.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HUD.swift; sourceTree = ""; }; + AC028B23255C285F001B6ACD /* UIColor+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+.swift"; sourceTree = ""; }; F908BEBF1BB849290015E5A8 /* PKHUDSuccessView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDSuccessView.swift; sourceTree = ""; }; F908BEC21BB84D0B0015E5A8 /* PKHUDAnimating.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDAnimating.swift; sourceTree = ""; }; F908BEC41BB852C60015E5A8 /* PKHUDErrorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDErrorView.swift; sourceTree = ""; }; @@ -250,6 +252,7 @@ F996324919514FEF001F73CA /* FrameView.swift */, F996324B19514FEF001F73CA /* Window.swift */, F996324C19514FEF001F73CA /* WindowRootViewController.swift */, + AC028B23255C285F001B6ACD /* UIColor+.swift */, ); name = Internal; sourceTree = ""; @@ -443,6 +446,7 @@ F996325019514FEF001F73CA /* FrameView.swift in Sources */, 640011571C5B6C080013F32B /* HUD.swift in Sources */, 3097AF3A1C4843AE007DD42B /* PKHUDRotatingImageView.swift in Sources */, + AC028B24255C285F001B6ACD /* UIColor+.swift in Sources */, F935B1611B2B8C8E003C3734 /* PKHUDTextView.swift in Sources */, F996325319514FEF001F73CA /* WindowRootViewController.swift in Sources */, F908BEC31BB84D0B0015E5A8 /* PKHUDAnimating.swift in Sources */, diff --git a/PKHUD/FrameView.swift b/PKHUD/FrameView.swift index 473048f..8854724 100644 --- a/PKHUD/FrameView.swift +++ b/PKHUD/FrameView.swift @@ -13,7 +13,13 @@ import UIKit internal class FrameView: UIVisualEffectView { internal init() { - super.init(effect: UIBlurEffect(style: .light)) + let blurEffectStyle: UIBlurEffect.Style + if #available(iOS 13.0, *) { + blurEffectStyle = .systemUltraThinMaterial + } else { + blurEffectStyle = .light + } + super.init(effect: UIBlurEffect(style: blurEffectStyle)) DispatchQueue.main.async { self.commonInit() } @@ -27,7 +33,11 @@ internal class FrameView: UIVisualEffectView { } private func commonInit() { - backgroundColor = UIColor(white: 0.8, alpha: 0.36) + if #available(iOS 13.0, *) { + backgroundColor = .clear + } else { + backgroundColor = UIColor(white: 0.8, alpha: 0.36) + } layer.cornerRadius = 9.0 layer.masksToBounds = true diff --git a/PKHUD/Images.xcassets/checkmark.imageset/Contents.json b/PKHUD/Images.xcassets/checkmark.imageset/Contents.json index 03ff7b9..cff7cd2 100644 --- a/PKHUD/Images.xcassets/checkmark.imageset/Contents.json +++ b/PKHUD/Images.xcassets/checkmark.imageset/Contents.json @@ -1,12 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "checkmark.pdf" + "filename" : "checkmark.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/PKHUD/Images.xcassets/cross.imageset/Contents.json b/PKHUD/Images.xcassets/cross.imageset/Contents.json index c7c5c82..c2c707c 100644 --- a/PKHUD/Images.xcassets/cross.imageset/Contents.json +++ b/PKHUD/Images.xcassets/cross.imageset/Contents.json @@ -1,12 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "cross.pdf" + "filename" : "cross.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/PKHUD/Images.xcassets/progress_activity.imageset/Contents.json b/PKHUD/Images.xcassets/progress_activity.imageset/Contents.json index f71552a..77a6fec 100644 --- a/PKHUD/Images.xcassets/progress_activity.imageset/Contents.json +++ b/PKHUD/Images.xcassets/progress_activity.imageset/Contents.json @@ -1,12 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "progress.pdf" + "filename" : "progress.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/PKHUD/Images.xcassets/progress_circular.imageset/Contents.json b/PKHUD/Images.xcassets/progress_circular.imageset/Contents.json index c517056..dcf26bb 100644 --- a/PKHUD/Images.xcassets/progress_circular.imageset/Contents.json +++ b/PKHUD/Images.xcassets/progress_circular.imageset/Contents.json @@ -1,15 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "progress_circular.pdf" + "filename" : "progress_circular.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { - "template-rendering-intent" : "original" + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/PKHUD/PKHUDErrorView.swift b/PKHUD/PKHUDErrorView.swift index d53bb05..92b6e63 100644 --- a/PKHUD/PKHUDErrorView.swift +++ b/PKHUD/PKHUDErrorView.swift @@ -36,7 +36,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { #endif dash.fillColor = nil - dash.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor + dash.strokeColor = UIColor.imageTintColor.cgColor dash.lineWidth = 6 return dash } diff --git a/PKHUD/PKHUDSquareBaseView.swift b/PKHUD/PKHUDSquareBaseView.swift index 9fd8260..f9012fd 100644 --- a/PKHUD/PKHUDSquareBaseView.swift +++ b/PKHUD/PKHUDSquareBaseView.swift @@ -25,6 +25,11 @@ open class PKHUDSquareBaseView: UIView { public init(image: UIImage? = nil, title: String? = nil, subtitle: String? = nil) { super.init(frame: PKHUDSquareBaseView.defaultSquareBaseViewFrame) self.imageView.image = image + if #available(iOS 13.0, *) { + imageView.tintColor = .label + } else { + imageView.tintColor = .black + } titleLabel.text = title subtitleLabel.text = subtitle @@ -45,7 +50,7 @@ open class PKHUDSquareBaseView: UIView { let label = UILabel() label.textAlignment = .center label.font = UIFont.boldSystemFont(ofSize: 17.0) - label.textColor = UIColor.black.withAlphaComponent(0.85) + label.textColor = .textTintColor label.adjustsFontSizeToFitWidth = true label.minimumScaleFactor = 0.25 return label @@ -55,7 +60,7 @@ open class PKHUDSquareBaseView: UIView { let label = UILabel() label.textAlignment = .center label.font = UIFont.systemFont(ofSize: 14.0) - label.textColor = UIColor.black.withAlphaComponent(0.7) + label.textColor = .textTintColor label.adjustsFontSizeToFitWidth = true label.numberOfLines = 2 label.adjustsFontSizeToFitWidth = true diff --git a/PKHUD/PKHUDSuccessView.swift b/PKHUD/PKHUDSuccessView.swift index 56825ec..bd347ae 100644 --- a/PKHUD/PKHUDSuccessView.swift +++ b/PKHUD/PKHUDSuccessView.swift @@ -33,7 +33,7 @@ open class PKHUDSuccessView: PKHUDSquareBaseView, PKHUDAnimating { #endif layer.fillColor = nil - layer.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor + layer.strokeColor = UIColor.imageTintColor.cgColor layer.lineWidth = 6.0 return layer }() diff --git a/PKHUD/PKHUDTextView.swift b/PKHUD/PKHUDTextView.swift index 5dc5055..fe1498b 100644 --- a/PKHUD/PKHUDTextView.swift +++ b/PKHUD/PKHUDTextView.swift @@ -38,7 +38,7 @@ open class PKHUDTextView: PKHUDWideBaseView { let label = UILabel() label.textAlignment = .center label.font = UIFont.boldSystemFont(ofSize: 17.0) - label.textColor = UIColor.black.withAlphaComponent(0.85) + label.textColor = .textTintColor label.adjustsFontSizeToFitWidth = true label.numberOfLines = 3 return label diff --git a/PKHUD/UIColor+.swift b/PKHUD/UIColor+.swift new file mode 100644 index 0000000..eae4900 --- /dev/null +++ b/PKHUD/UIColor+.swift @@ -0,0 +1,28 @@ +// +// UIColor+.swift +// PKHUD +// +// Created by Mario Iannotta on 11/11/2020. +// Copyright © 2020 NSExceptional. All rights reserved. +// + +import Foundation + +extension UIColor { + + static var textTintColor: UIColor { + if #available(iOS 13.0, *) { + return UIColor.label.withAlphaComponent(0.85) + } else { + return UIColor.black.withAlphaComponent(0.85) + } + } + + static var imageTintColor: UIColor { + if #available(iOS 13.0, *) { + return UIColor.secondaryLabel + } else { + return UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0) + } + } +}