Skip to content

Instantly share code, notes, and snippets.

@passatgt
Last active April 4, 2023 15:44
Show Gist options
  • Save passatgt/b05faa1b0cb5e9b52931cb53dac37e26 to your computer and use it in GitHub Desktop.
Save passatgt/b05faa1b0cb5e9b52931cb53dac37e26 to your computer and use it in GitHub Desktop.
Custom ShortcutsLink in your SwiftUI Form
@passatgt
Copy link
Author

passatgt commented Apr 4, 2023

The built-in ShortcutsLink() button looks out of place, but theres no way to modify it. This is a hacky way to solve the problem. Create a new row on a Form using a ZStack, so the ShortcutsLink will overlay the actual button you can design your own way. The lowest opacity that still work in my testing was 0.011. Two ShortcutsLink, so it covers the whole row. Looks like this in my case:

image

It will use the dark version in dark mode and the light version in light mode, so you really need to play close attention to notice it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment