Easy to read, ObjC suffers all warts you would expect from a language build on top of C. and they introduced new keywords using @ in front of. Swift drops legacy conventions like no need to use the semi colon, parenthesis, brackets while calling functions.
East to maintain, Again legacy holds ObjC back, C requires the programmer to maintain 2 files in order to improve the build time and efficiency. Swift drops the 2 files requirements, here Xcode and LLVM compiler manage that.
Safe, ObjC handling with pointers nil, null pointers. if you calling a function with nil, the random crash will come and it will really to find. Optional makes it very easy in Swift it will generate compile time error if you are trying to write bad code.
Unified with Memory Management, ObjC supports ARC is complete across Cocoa APIs and Object-Oriented code if you are using procedural code and APIs like core graphics it will be developer responsibility to manage memory. in Swift it solved and they have proven it will improve the productivity and the other side is garbage collector running cleaning up for used memory.
Less code, Compare to ObjC, Swift reduces the amount of code for repetitive statements and string manipulation.
Fast, Dropping legacy C conventions has greatly improved performance.
Name Collisions Issues, let’s say if you are using Facebook SDK if your file and Facebook file name is same it will create linker error in ObjC so the general conventions are to used prefix like NS/CG etc. Swift provides implicit namespaces that allow same source code file to exist across multiple projects.
Dynamic libraries, the biggest change – dynamic libraries are a chuck of code that can be linked to an app. this feature allows Swift apps to link against new versions.
Computer Science Engineer interested in developing knowledge and apps for mobile devices. Started my career with Objective-C development for iPhone and iPad devices and Java Web development. I love challenges, that may extend my Knowledge and working experience. Active Apple iPhone Developer Program Membership since Jan 2012.
View all posts by Bunty Madan