How to add and remove SF Symbol Effects using UIKit

Oscar de la Hera Gomez
Two flowers that represent Swift and XCode with the text "SF Symbols Add and Remove Effects" beneath them.

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.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details