Posts

Showing posts with the label Objective C

iOS: Playing with Static Libs, Fat Frameworks, Static/Dynamic Frameworks with Swift & Objective-C classes mixed up

Recently, I got to know few facts on how exactly Static Library(SL), Fat Frameworks(FF), Static/Dynamic Frameworks(SDF) actually works while I was working on a legacy code base which had a ton of all of the above stuff working altogether. This article is to log the few notes on the struggles we faced with having all these above things mixed up altogether with both Swift & Objective-C mixed up. Static Library(SL): Static Libraries was the initial(Way too Older now) way of code distribution where any project integrating the library would include .a file(Which contains the implementation classes) and all the header '.h' files separately along with the .a file in order for them to work in conjunction. Fat Frameworks(FF): Fat Frameworks are nothing but just the Static Library compressed as a framework, which was a means of distributing the code before Xcode6 when Apple introduced Static/Dynamic Frameworks(SDF). Static/Dynamic Frameworks(SDF): In Frameworks world,...

Memory Management in Objective-C

Image
Note: This article was written a very long back in the period of Xcode 6. Any application that runs on a device needs some sort of space in memory(RAM) during runtime in order to store any necessary data to be displayed or handled in the app. Any program that runs on the device needs to manage their memory based on the system resources(RAM Memory) by controlling or managing the lifetime of all the objects created for the app. iOS Applications does this through a process called 'Object Life Cycle Management' Or Otherwise called as 'Object Ownership'. This Ownership scheme is handled through a 'Reference Counting' mechanism, which uses a tracking mechanism internally to detect the number of owners for each object. Reference Counting Rules: Reference Count = 1, when an object is created and the Creator is the owner here. Reference Count +1, whenever a new owner is added. Reference Count -1, whenever an owner releases its reference. ...

Free Hand Drawing on Google's Map View

Recently, I got a chance to work on a project, where we needed to provide an ability to users of an iOS app to draw on Maps. Basically, we decided to go with Google Maps, because of its overall coverage and its popularity. Hence, we used  Google Maps SDK for iOS  and we wanted to implement "Free Hand Drawing on the Google Maps". To do so, I started searching around the internet for some good resources, but weren't able to find any good one that could just be used like Plug and Play. We had to do a lot of handling on our own and hence decided to write a blog post and a sample project just to make it useful for others, so that others in the same path don't struggle much like me. If you are only planning to draw a Polygon on the Map (As most of them do), then may be you don't have to read the entire post. Instead just follow these steps: (i) Copy & Paste these Folders into your project: "SARMapDrawView", "Categories" & "Models...

Exploring SWIFT

Should have posted this a long back, but just got the perfect time to get it done.  I got a chance to develop an e-Commerce mobile application targeted at iOS8. We decided to develop it using the latest technologies, so we chose to use the SWIFT language released by Apple in Conjunction with iOS8. SWIFT is a safe, modern and powerful Language, it has a lot of interesting, time saving features, which could allow us(Developers) to focus/work more on the Application’s logic rather than the coding itself. Swift’s shorthand syntax makes us to write less code when compared to Objective C. It was a great decision to remove the semicolons(At the end of each statement), Braces (In Control Flows), Subscripts, Enumerations, etc… Some of the very interesting stuff includes: Optionals Tuples Closures Access Control Going briefly into those interesting stuff, that mostly adds value to our code/time. Optionals: The most interesting and powerful f...