Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert UIKeyCommand from deprecated init syntax to iOS 13 SDK syntax
# 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),
@douglashill

This comment has been minimized.

Copy link

@douglashill douglashill commented May 17, 2020

Most of those parameters are default values if you want to trim it down a bit.

@frankrausch

This comment has been minimized.

Copy link
Owner Author

@frankrausch frankrausch commented May 18, 2020

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