Kodeco Forums

Introducing iOS Design Patterns in Swift โ€“ Part 2/2

Learn about common iOS design patterns like adapter, observers, and memento/archiving and how to use them in your own applications.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2106-introducing-ios-design-patterns-in-swift-part-2-2

It looks like album cover URLs have moved.

For example, the bowie URL was: โ€œhttp://www.coversproject.com/static/thumbs/album/album_david%20bowie_best%20of%20bowie.pngโ€

Now it is:
โ€œhttp://www.coversproject.com/static/thumbs/album/album_david_bowie_best_of_bowie.pngโ€

Hi rob going to try update this tutorial this weekend. Thanks for letting me know !

Hey everyone, hope can help you:
Here is the project updated at Swift 2+

1 Like

As per my comment on part 1, theyโ€™ve moved again:
https://s3.amazonaws.com/CoverProject/album/album_no_doubt_its_my_life_bathwater.png

Hi everybody.

Iโ€™m not sure if it helps, but since Iโ€™ve run into this problem while following the tutorial I thought Iโ€™d share it here.
On the following line:

scroller.setTranslatesAutoresizingMaskIntoConstraints(false)

I ran into the following error:

value of type UIScrollView has no member setTranslatesAutoresizingMaskIntoConstraints

I found out that the syntax has been changed to this:

scroller.translatesAutoresizingMaskIntoConstraints = false

Regards!

Thank you Thank you Thank you

Is this project compatible with swift 3, I canโ€™t seem to run it without getting a lot of errors after conversion ?

Please update this tutorial for Swift 3. I feel like the content is very useful, but some of the language changes (the dispatch functions in particular) are not explained well (not explained at all, to be honest) and make a roadblock into getting the code to run.

you need to update UI on main thread so you access the main thread by dispatch_sync(dispatch_get_main_queue() and inside the block , you update the imageViewโ€™s image and save image to disk.