New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS version availability checks to resolve deprecation warnings #736
Conversation
Source/svg/SVGParser.swift
Outdated
@@ -704,7 +704,13 @@ open class SVGParser { | |||
cleanedHexString = "\(x[0])\(x[0])\(x[1])\(x[1])\(x[2])\(x[2])" | |||
} | |||
var rgbValue: UInt32 = 0 | |||
Scanner(string: cleanedHexString).scanHexInt32(&rgbValue) | |||
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) { | |||
if let scannedInt = Scanner(string: cleanedHexString).scanUInt64(representation: .hexadecimal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can match two conditions into one
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *), let scannedInt = Scanner(string: cleanedHexString).scanUInt64(representation: .hexadecimal)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@amarunko the travis-ci didn't kick off to build/test this PR. Does this have to be manually triggered by someone? |
Hm, no, Travis worked automatically on this project, need to check |
Actually, build passed, I can't find this action on GitHub as before, but it's ok |
Hmm interesting. Odd it didn't append details to the PR as travis normally does. Anyway, good to see it's passed automated processes |
Thanks! Merged to the master. |
Mainly deprecations in
Scanner
methods from iOS 13.0 and one fromCADisplayLink
. See image here for warnings when we've included via cocoapods