Ok, you might be laughing at the end of this post, but I thought it is better if I put this into a searchable form, and you might in the same situation as me. In a nutshell: I modified the signature one of my class’s initializer, this class was actually a subclass of the UIView, ...
Finally, we are here;). The road was quite long from the initial solution, where we just put all of our code into one class, and we were happy that it worked to the current situation, where our code based on the delegation pattern. In this blog post we go further, and we will apply the ...
In the first post I put the focus on the initializers, in this post I would like to put the nullability into the spotlight. I would also explain why is it a good practice, and how it will help you migrate your existing Objective-C code into Swift. Nullable/Nonnull The idea behind using the nullable/nonnull keyword ...
Let’s talk about the header (.h) files. Probably you know that what is defined in the header file has a public visibility. Any method or property declared here can be accessible all of the other classes, which are importing this file. That is one of the reason why we need to plan carefully what is ...
In the last post we changed the communication between our classes to be based on the Key-Value Observation. As we could see KVO is not the best solution for our problem, but sometimes can be helpful, if we need to observe one particular object property changes. In this post I will modify the communication to ...
If you have ever worked with SQL queries and the aggregate functions (or in worst case with spreadsheet applications like Excel or Numbers), this topic will be familiar to you. It is usually overlooked, but the Key-Value Coding can also benefit from those functions on collections, like NSArray or NSSet. Obviously the type should support ...
This post has been updated, based on quellish recommendations, made on reddit. At the previous post of this series we made some changes of the code, in order to use the NSNotificationCenter for the asynchronous communication between the different parts of our system. NSNotification centre is a great tool if you want to set up ...
Recently I was building a data structure, where I store some dates of events in an array. When i was wondering, how to create a filter based on from and to dates, my first taught was: I just need to go through each element of the array an figure out, if it should be filtered ...
In the second post of the iOS communication patterns we are going through an implementation of an NSNotificationCenter based solution. This implementation won’t follow the best practices (more about it in the conclusion), I wanted to give you a good grasp of it. First of all, let’s talk about the Notification Center. If I want ...
Have you ever felt the stress and frustration when your issue navigator is full of warnings and errors? My advice is: Leave your bad feelings behind. Believe or not, compiler warnings and errors are your best friends. Why am I saying this? Because the ability to catch bug, or a possible problem in your code ...