Weekly Swift 3, Interfaces and CoreData

This is the third post I'm writing about my swift adventure and it's been great so far. I feel like I've been able to learn a lot about Swift and UIKit. I did miss two days because I was extremely busy those days, so that's a bit of a shame.

In week three I focused on learning UI stuff rather than focusing on building Arto App, I decided to do this because a better understanding of UIKit might be very important in the process of developing it. I also took a peek at CoreData which was interesting.

UIScrollView

UIScrollView 1

I used the UIScrollView this week for making a zoomable/scrollable image and a slideshow. This was useful because I got to learn that a tableview actually subclasses the scrollview. It's also pretty easy to get started with a scrollview and it seems like an awesome way for creating good user experiences. It just feels good to use, especially because it's so easy to implement.

UIScrollView 2

Sidescrolling menu

Many apps today use a navigation pattern where there's a menu hidden underneath the content of a page. Using a great tutorial from raywenderlich.com, I was able to create one of these menus and again I was amazed at how flexible and natural a lot of programming in UIKit feels. I'm only scratching the surface so there's a lot more to be explored and probably there's many things that aren't as easy and straightforward as what I've done so far.

Slide out menu

CoreData

If you need a database to store objects in, then CoreData is what you need. This week I have used CoreData to save a list of names and birth dates. CoreData uses a database model that you can query. You access the models from CoreData through an NSManagedObject. This object is obtained through the AppDelegate which seems strange but it's just how it works.

Actually using CoreData for something simple as this was not too hard and quite easy to understand. In the CoreData example I did, I actually found that using user input is very strange actually. When a user selects a text input field a keyboard pops up, which makes sense. But when the user taps outside of the text input, essentially taking the focus away from it, you'd expect the keyboard to disappear. But it doesn't, because you have to manually tell the keyboard to stop responding.

No more daily projects

Starting this week I will finish one thing a day anymore. I do intent to push something to github every day but it's my goal to make more useful things that are hard to squeeze into a single day. So my intent is to make the daily Swift something I do every other day. That way I can try to make more interesting projects that are a bit more complex than the ones I'm doing right now.

This week's repositories

As always, if you want to follow my progress you can do so on Twitter and Github.