[Swift 1] Day 1 - Code Exercise Solutions


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.


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.


@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).




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.



@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:

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:



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


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: