What are some of the major differences between objective c and swift?
Answer Posted / Pankaj Mishra
"Objective-C is a superset of C, originally developed in the early 1980s by Brad Cox and Tom Love. Swift, on the other hand, is a newer language developed by Apple since 2014 as a replacement for Objective-C. Some major differences between them include:
- Syntax: Swift has a more modern syntax, focusing on readability and safety with features like optionals, error handling, closures, and generics, whereas Objective-C uses C-like syntax.
- Runtime: Swift is built on a newer foundation called Swift Standard Library (Swift SL) rather than the Objective-C runtime library used by Objective-C. This makes Swift faster and more efficient.
- Error Handling: In Swift, errors are handled with do-catch blocks, whereas in Objective-C, errors are usually passed around as NSException objects.
- Memory Management: Swift manages memory automatically through ARC (Automatic Reference Counting), while Objective-C developers have to manually manage memory using retain/release or ARC.
"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category