Skip to content

Instantly share code, notes, and snippets.

@NathanWalker
Created September 27, 2023 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NathanWalker/b844067ad4573eb28af410b4694b2f2c to your computer and use it in GitHub Desktop.
Save NathanWalker/b844067ad4573eb28af410b4694b2f2c to your computer and use it in GitHub Desktop.
iOS 17 variable color symbol effects with NativeScript
<Image [src]="image" stretch="aspectFit" (loaded)="loadedImage($event)" class="w-full h-full"></Image>
export class ViewComponent {
image: UIImage;
constructor() {
const config = UIImageSymbolConfiguration.configurationPreferringMulticolor();
this.image = UIImage.systemImageNamedWithConfiguration('rainbow', config);
}
loadedImage(args) {
const imageView = args.object.ios as UIImageView;
imageView.addSymbolEffectOptionsAnimated(
NSSymbolVariableColorEffect.effect(),
NSSymbolEffectOptions.optionsWithSpeed(1),
true
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment