Swift uses ARC (Automatic Reference Counting) similar to Objective-C to track and manage application memory. In most cases, we don’t need to bother about memory management by ourselves, the swift compiler will take care of it. But there are some cases where we need to deal with it by ourselves. I am going to discuss some of the common cases from those.
Using delegates in iOS and Cocoa is a very basic and fundamental part and we use them very frequently in our codes. As like in business, cocoa uses delegates as a formal way to pass work/data from one object to another. In business, you want to do make something but you need raw materials to do so. So you ask the supplier to give you raw materials and you sign a contract for that. Same goes in cocoa, a class that wants to perform a task that depends on the response of another class acts as the delegate to the later. The first class wants to be the contractor of the later one by signing a contract called protocols (as defined in cocoa).
It has been almost or, more than 2 years I had created this controller called SHViewPager. And to my utmost surprise a lot of people actually got benefited from it. Some of them requested for the support for screen orientation and iPad. I was a bit busy (actually lazy! sorry guys, truly!) to keep the request. Finally after a long wait, I was thinking, why am I not doing it?
For a recent project of mine, I had created this custom controller. This is quite similar to the ViewPager control used in Android. I’ve named this controller SHViewPager, here is the gitHub link. Continue reading
Hi everyone and welcome again to my blog. Today I am going to discuss a quick fix with you guys. Recently I was working in one my projects and came to a point where I had to use a formatter, which will put spaces after every three digit of a decimal number. For example, if the number is 20000, it will make it look like 200 000. Simple and it is vastly used, isn’t it?Continue reading