Ever felt the need to use a two dimensional array in you iOS project? Well, I have. So here is what I had done:
- Created a NSObject subclass.
- Taken two private NSMutableArray instances, one for row and one for column.
- Created a nested for loop to traverse those arrays, and fill them with NSNull objects.
- Created a method to insert value/object on the [row][column] index.
So this is fairly easy and straightforward. But wouldn’t it be nicer if you didn’t have to do all these steps and figure out how to write those monotonous codes all by yourself?
My good friend, I have good news for you! I have created a simple CocoaPod to minimize your task!
We all know the three basic principles of OOP: Encapsulation, Inheritance and Polymorphism. And there is also this fourth principle: Data Abstraction; though it’s not always mentioned as a standalone principle, as it is closely tied with encapsulation. Today I am going to discuss a simple case to display the power and necessity of Inheritance.
Let’s assume a scenario: you are working on an application, which has to perform a server call asynchronously and has no direct impact on the UI. But when the server returns a response, you have to make some modification to your application regardless of the present UI.
Now a days it is fairly common to use CocoaPods to your project as the dependency manager for your iOS and MacOs projects. I have been using it for quite some time now; and to my utter delight, oh boy, I am glad I got to know how to use this masterpiece!
Now to a fairly uncommon scenario, what if you want to create your own pod?
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.
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
Hello guys and welcome to the third and final part of our discussion on Objective-C protocols and delegation. On the last part we had finished our code and left the discussion for this part. Well, what are we waiting for? Open the project and run it on the simulator, you’ll see something like this: Continue reading
Hello again, welcome to the second part of the discussion on iOS protocol and delegates. On the previous part I left on the theoretical discussion about what are Objective-C protocol and delegates. Here is the link to first part of this discussion. Moving forward, I am going to give a practical example and explain more on this topic. Continue reading