[Swift 1] Day 1 - Code Exercise Solutions


#83

i have been able to move the words up, down, right, and left with great success. I would like to know if anyone has figured out how to make the word “walk” down, up, left or right.

When I say “walk” in i mean have the words come in like they are walking down a staircase. So one end of the word comes down at a diagonal like a 5 pixels, while the rest of the word is still in its original position, then the end in the original position will drop down like 10 pixels and the word continues to go in a sloping manner until it is in position.

Or

Has anyone figure out just how to make a words animation just slope like the word is on a set of pillars that are in a perfect diagonal slope.

I would like to know how to do this. it would be cool. Any Ideas.


#84

@CarverParkes You will have to create several different labels with the letters or words and move them around.

Individual character animations is a little challenging on iOS and would require a lot more work.

You can use the animateWithDuration and provide a delay and then you could nest multiple animations together using the completion block.

Take a look at some animations that you could try with Swift (not the same, but it’ll give you some more ideas to play with).

http://www.appcoda.com/view-animation-in-swift/


#85

@CarverParkes

Digging a little deeper I found what looks to be a good tutorial on animating text. This gets into using more complex objects than simple labels.

You can use NSLayoutManager, NSTextStorage, and NSTextContainer. Google them for more details.

http://swiftyeti.com/texteffects-with-nslayoutmanager/


#86

@PaulSolt Nice article.

Sometimes we forget what String means - which basically is an Array of some sort from characters.
However we need to keep up with the tech Monster Apple, as they just changed fundamentally what String is and how it works :wink:

Check here :wink:
https://developer.apple.com/swift/blog/?id=30

P.S. - basically the example from the article might have to be reworked for Swift 2.0 or even better - make your own :slight_smile:


#87

@ravenshore

I made a short post on working with the new String in Swift 2.


#88

Nice.
I was recently looking into it, as I was thinking on making an AI chat bot and obviously String manipulation is a big part of it :smiley: