How to add and remove SF Symbol Effects using UIKit

UIKit Code for adding or removing an SF Symbol Effect from a UIImageView.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 09/22/2023 at 10:23
Last Updated on 09/22/2023 at 10:41
<p>Two flowers that represent Swift and XCode with the text "SF Symbols Add and Remove Effects" beneath them.</p>

UIKit Code for adding or removing an SF Symbol Effect from a UIImageView.

SubscribeWhat are Symbols?

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:

How to use SF Symbols in Swift

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.

WWDC23: Animate Symbols in your appWWDC23: 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.

How to animate the replacement of an SF Symbol using UIKit

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.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe