Skip to content

Commit

Permalink
Merge pull request #76 from 87kangsw/feature/75-build-warning-fix
Browse files Browse the repository at this point in the history
빌드 Warning 수정
  • Loading branch information
87kangsw committed Apr 26, 2022
2 parents 7a07554 + a42f59f commit c5af068
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ included: # paths to include during linting. `--path` is ignored if present.
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- GitTime/Sources/Utils/PropertyWrappers/BundleInfoWrapper.swift

analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
- explicit_self
Expand Down
2 changes: 1 addition & 1 deletion GitTime/Sources/Services/AuthService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final class AuthService: AuthServiceType {
}
})
if #available(iOS 13.0, *) {
if let loginVC = UIApplication.shared.keyWindow?.rootViewController as? LoginViewController {
if let loginVC = UIApplication.keyWindow?.rootViewController as? LoginViewController {
self.session?.presentationContextProvider = loginVC
}
}
Expand Down
22 changes: 22 additions & 0 deletions GitTime/Sources/Utils/Extensions/UIApplication+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// UIApplication+Extensions.swift
// GitTime
//
// Created by Kanz on 2022/04/26.
//

import UIKit

extension UIApplication {
static var keyWindow: UIWindow? {
if #available(iOS 15.0, *) {
return UIApplication.shared.connectedScenes
.filter { $0.activationState == .foregroundActive }
.first(where: { $0 is UIWindowScene })
.flatMap { $0 as? UIWindowScene }?.windows
.first(where: \.isKeyWindow)
} else {
return UIApplication.shared.windows.first(where: { $0.isKeyWindow })
}
}
}
32 changes: 16 additions & 16 deletions GitTime/Sources/Utils/Extensions/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
import UIKit

extension UIColor {
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int = UInt32()
Scanner(string: hex).scanHexInt32(&int)
let a, r, g, b: UInt32
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
case 6: // RGB (24-bit)
(a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
case 8: // ARGB (32-bit)
(a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
default:
(a, r, g, b) = (255, 0, 0, 0)
}
self.init(red: CGFloat(r) / 255, green: CGFloat(g) / 255, blue: CGFloat(b) / 255, alpha: CGFloat(a) / 255)
convenience init(hexString: String, alpha: CGFloat = 1.0) {
var hexFormatted: String = hexString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()
if hexFormatted.hasPrefix("#") {
hexFormatted = String(hexFormatted.dropFirst())
}
assert(hexFormatted.count == 6, "Invalid hex code used.")
var rgbValue: UInt64 = 0
Scanner(string: hexFormatted).scanHexInt64(&rgbValue)
self.init(red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: alpha)
}
}

Expand Down
8 changes: 7 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ target 'GitTime' do

end


post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,6 @@ SPEC CHECKSUMS:
URLNavigator: 2593c0e2d293732ec5c44503cf54dceba1a68085
WeakMapTable: 05c694ce8439a7a9ebabb56187287a63c57673d6

PODFILE CHECKSUM: ecfb47752adb4f2669fe0fbed01e71aadb792c5e
PODFILE CHECKSUM: 889e35fd688c78c4e6f036a683a2aed3bbd554c6

COCOAPODS: 1.11.2

0 comments on commit c5af068

Please sign in to comment.