1

How can i make simple animations for apple watch in swift?

i have checked this blog

but its about frame animation, i am asking for fade in , fade out , rotate vs animations

such as using this low level function

 self.view.setAlpha(0.0)

I have android background , so i am searching for some swift functions for apple watch like in android equvalent of

Animation fadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fadein);
imageView.startAnimation(fadeInAnimation );

check more

or or this one for

ObjectAnimator fadeIn = ObjectAnimator.ofFloat(myView, "alpha", .3f, 1f);
fadeIn.setDuration(2000)
Community
  • 1
  • 1
Alp
  • 1,863
  • 1
  • 20
  • 38

1 Answers1

4

In apple watch code you just type

animateWithDuration(0.3) {
    self.view.setAlpha(0.0)
}

the method animateWithDuration is part of WKInterfaceController

Gerd Castan
  • 6,275
  • 3
  • 44
  • 89