How to add and remove SF Symbol Effects using UIKit
UIKit Code for adding or removing an SF Symbol Effect from a UIImageView.
The following article assumes that you have added an SF symbol to your Swift project. To learn how to do this consult the article below:
Add a Symbol Effect
To add a symbol effect to a UIImageView, use code similar to the one below replacing Effect_Name with the name of the effect (i.e. .bounce).
imageView.addSymbolEffect(Effect_Name)
Remove a Symbol Effect
To remove a symbol effect to a UIImageView, use code similar to the one below replacing Effect_Name with the name of the effect (i.e. .bounce).
imageView.removeSymbolEffect(ofType: Effect_Name)
Remove All Symbol Effects
To remove all symbol effects to a UIImageView, use code similar to the one below:
imageView.removeAllSymbolEffects()
Frequently Asked Questions (FAQ)
How do I animate symbols using SwiftUI ?
Consult the WWDC session Animate symbols in your app to learn how to animate SF symbols in SwiftUI.
To learn more about what's available in SF Symbols consult What's new in SF Symbols 5.
How do I perform an animated replacement using UIKit ?
Consult the article linked below to learn how to animate a UIImageView as it changes to a new SF Symbol.