Hello, 2017! Updates, Swift and More!

Welcome to my new blog. I have moved some of my favorite posts over from my old one. Happy reading.

I know this is late but well it’s 2017, and things are shaping up to be a good year! My last blog post was in November, and since then Christmas, work, family and more work have kept me too busy to write some updates, so let us get up to speed.

 We all know the standard issue of downloading images and caching them, there are many frameworks out there to solve this KingfisherSDWebImage and AsyncDisplayKit to name a few.

I have been spending a lot of time with Async, and it is well worth a dive into however it does have a slightly steep learning curve. Without going into to much detail, it allows you to render views, layout and hierarchies off the main thread as it uses nodes to lay out its views which are an abstraction of UIView. Highly worth a look.

While messing with around with Async, I stumbled across another framework for downloading images and let me say it is my favourite. Nuke by Alexander Grebenyuk is a very powerful image loading and caching framework.

There are two reasons I like it, one it is dead simple to implement, and two preheat! For those of you who don’t know what preheat is well this feature is better than Zelda Breath of the Wild, that may be going a bit too far, but it’s good. You make the request for the image before you need it and it gets downloaded in the background and stored in the application’s network cache then when you need to show the picture later the response for your request comes from the cache which is way faster and loads instantly. Pretty amazing right.

The fun doesn’t stop there no there is an Alamofire plugin best of both worlds there and an excellent Toucan Plugin which allows you to make the image circle and add borders.

What else have I learnt recently……

Well in my current quest to find out which is better storyboards or building views programmatically I have been delving into stack views and created a few excellent extension for making the code a bit tidier when creating them programmatically which I will share on GitHub at some point. By the way, both storyboard and programmatic views have their pros and cons. Personally, I have come to the conclusion you need to pick which method is better based on the challenge at hand. Anyway, let’s not stoke that argument up.

Well delving into programmatic views I discovered Tiny Constraints. If you thought Anchors and StackViews made AutoLayout code smaller and quicker get a load of Tiny Constraints. This thing takes four lines of layout code and turns it into one, go check it out.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s