Created
May 13, 2020 21:26
-
-
Save frankrausch/572a3368c50b77be854265a8c91a77b2 to your computer and use it in GitHub Desktop.
Convert UIKeyCommand from deprecated init syntax to iOS 13 SDK syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Regex: | |
UIKeyCommand\(input: (.+)\, modifierFlags: (.+), action: #selector\((.+)\), discoverabilityTitle: (.+)\), | |
# Replace: | |
UIKeyCommand(title: $4, | |
image: nil, | |
action: #selector($3), | |
input: $1, | |
modifierFlags: $2, | |
propertyList: nil, | |
alternates: [], | |
discoverabilityTitle: nil, | |
attributes: [], | |
state: .off), |
Ha, I got the new parameters from the Xcode autocomplete and didn’t bother to look more closely. Thanks, Douglas!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most of those parameters are default values if you want to trim it down a bit.