czwartek, 17 grudnia 2015

"MVVM is not very good" - How do you make it better ?

Soroush has created a blog post that describes my funny feelings when using MVVM. MVVM is an evolution of MVC. It's "better" than MVC, because it reorganizes the way you layout your logic between the modules. View and Model are very clear in their purpose, so where did all the rest of the logic go...

piątek, 11 grudnia 2015

Things you need to know about Swift's runtime

When learning advanced features of Objective-C I learned how much power does knowing about it's runtime give you. I've decided to start my adventure with Swift with studying it's runtime. This way you know exactly what you're telling the computer to do.  Class vs Struct Ahh, the famous "class...

czwartek, 3 grudnia 2015

Dependency Carrying in Swift (with storyboards)

Every programmer must've struggled with Dependency Carrying, even though he might've not known that it has it's own name. Dependency Carrying is extremely uncomfortable, when you have a lot of dependencies and you have to pass them deeper through the object tree. You have to define the same code for...

środa, 25 listopada 2015

Things I've learned while building an iOS SDK

There are times in programming when you think "I wish I knew that from the beginning". Building an SDK is quite different from making an app. You have more things to remember about and the distribution is more tricky. It's also a big responsibility, because if you screw something up, you can't just update right away - you might have a lot of users, and you don't control when they update your library...

czwartek, 1 października 2015

UITableView animations cautionary tale

I want this to be a quick post to make people aware of a certain bug/feature in iOS UITableView. For example Skype people are either not aware of it, or just don't know how to fix that. My guess is that they are aware, as you can see that the cells are fading in as if they wanted to hide that: Even though the cells are being faded in you can see as the top cells get recycled and transformed/animated...

wtorek, 11 sierpnia 2015

The Clean Code Trap

   Often times instead of just smoothly bashing away at the keyboard to produce fresh lines of code I hit the creative block. I sit in front of the screen with one thought in my mind "this isn't clean... I can't do that". After dozens of such incidents I've came to agree with one obvious conclusion:...

piątek, 19 czerwca 2015

What's new in iOS9 and Xcode 7 - WWDC 2015

Objective C Nullability This was actually introduced in XCode 6.3, but it's a failry new feature presented at WWDC 2015. You can set your parameter to be nonnull or nullable: This code will produce a warning while building, and crash in runtime if the code that passes nil to name is executed.It...

Cocoa Touch Best Practices - WWDC 2015

Launch quickly The first thing you learn is that you shouldn't do process extensive tasks on UI thread. People sometimes forget that if you do the same in the delegate callbacks you'll freeze UI. Always return quickly from applicationDidFinishLaunching to launch the app as quickly as possible. Your...

Clang compiler under the hood

When you build an iOS application you're not really interested with how does it all work under the hood most of the times. You just place some layout, hit "Run" or "Archive" and that's it. It just works. It's when you start building your own library you start wondering: how does it all work? Static...

czwartek, 23 kwietnia 2015

Demystifying decoupling and cohesion in Software Architecture

Decoupling and cohesion are phrases that are thrown around in software very often. You kind of know what they mean, but do you really?  Decoupling Coupling in software architecture usually applies to modules in OOP. It measures how dependent are modules from each other - how strong is the connection...

sobota, 18 kwietnia 2015

Solving the NSNumber mystery

Ignorance is bliss. I used NSNumber and didn't really care how it really works. One day when I had to find out what's inside NSNumber (bool, float or integer) that bubble burst. It turned out that you can't really find out what NSNumber is holding with simply calling a method on the object, which...

wtorek, 24 lutego 2015

When to use dependency injection ?

Dependency injection is a great pattern that implements Inversion Of Control. I wrote about it in my first post.Overusing a pattern is as bad as not using any architecture at all. It's called overengineering. As I mentioned before, it's hard to draw the line between no architecture and too much architecture.How do we know when to use dependency injection and when don't ? As mentioned here, this...

poniedziałek, 26 stycznia 2015

Why you should use MVVM instead of MVC

The View-Controller in MVC is responsible of interpreting the Model (business logic) and managing UI. See that "and" in the middle ? It's a sign that a class might be breaking the Single Responsibility Principle.  In theory, MVC sounds pretty nice, in practice it usually ends up the same:...