In the storyboard of XCode 11.5 there are several icons in the "image" property of a UIButton. However, I can't find any references to these images in the documentation and when attempting to create a button programatically I can only find references to using images I put in the bundle myself. Is there a way of accessing these built-in images from the code? How?
They are SFSysmbol icons. If you're asking about an auto-complete in Xcode when adding images programmatically, there isn't one. But you can get the list of all the available SFSymbols from this app. And you can use UIImage(systemName:)
initializer to access the available icons.
To access system icons:
let image = UIImage(systemName: "wrench")
button.setImage(image, for: .normal)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With