Settings

Theme

Animations in Swift

mathewsanders.com

41 points by normanv 12 years ago · 6 comments

Reader

monkey_slap 12 years ago

Really cool! I'd argue that Swift doesn't really have much to do with this, more "Animations in iOS".

You brought up a couple of neat concepts that I wasn't aware of, especially "UISystemAnimation.Delete".

  • mathewsanders 12 years ago

    Yeah, you're right.

    The main goal was try and introduce these APIs to designers, since there seems to be a current of interest around designers getting excited about learning Swift.

mathewsanders 12 years ago

Thanks for submission!

I've had some feedback that I've made a bit of a mess with casting when trying to calculate a random number - would appreciate any best practices or thoughts on that...

https://gist.github.com/mathewsanders/82311409978066b02932

  • LinaLauneBaer 12 years ago

    arc4random_uniform

    • mathewsanders 12 years ago

      you're right, in my example arc4random_uniform works perfectly and unlike rand() you don't have to seed.

      delay = NSTimeInterval(arc4random_uniform(900)+100) / 1000

      Not sure why I didn't do that in the first place...

sdegutis 12 years ago

This just feels like more proof that Swift will be nominally better than ObjC for the next 5 years, until Apple's APIs are (re?)written to make use of reasonable Swift idioms.

Also, this is the community's periodic reminder that not all ObjC (and soon Swift) is iOS; people still write (and use! imagine that!) OS X apps.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection