SlideShare a Scribd company logo
Objective C vs Swift
Objective C
● Object-oriented programming language
● Developed in the early 1980s (NeXTSTEP)
● Files have .h and .mm file extensions, C header files
● Created primarily by Brad Cox
● Messages,Interface,Implementation,Instantiation
● 2014, Apple announced plans to replace Objective-C
new Swift language
Worst things about Objective-C
● Bulky syntax,Squared brackets,Memory
management
● No Generics,No enums,No operator overloading
● Dealloc won't be called automatically
● More Complex object sort
● Publishing an Apple app is a nightmare
● No Generics
Swift
● Father is Chris Latter(july 2010)
● Functional,Fast,Funny,Happy
● Variable name,Tuples, No pointers
● Function with multiple return values
● Apple Swift has clean syntax
Similarities to Objective-C
● Curly braces are used to group statements.
● A new identity operator, ===, is provided to check if two data
elements refer to the same object.
● Square brackets are used with arrays, both to declare them and
to get a value at a given index in one of them.
● Control statements are similar.
● Class methods are inherited, just like instance methods; self in
class methods is the class the method was called on.
Differences from Objective-C
● No semicolon, Header files, Exception
handling
● Strong typing,Type inference
● Fallthrough for switch case
Differences from Objective-C
● No semicolon, Header files, Exception
handling
● Strong typing,Type inference
● Fallthrough for switch case

More Related Content

PPTX
Swift vs Objective-C
PDF
A Journey From Objective C to Swift - Chromeinfotech
PDF
iOS NSAgora #3: Objective-C vs. Swift
PDF
Migrating Objective-C to Swift
PDF
Migration Objective-C to Swift
PDF
PDF
Migrating from Objective-C to Swift
PDF
Value objects in JS - an ES7 work in progress
Swift vs Objective-C
A Journey From Objective C to Swift - Chromeinfotech
iOS NSAgora #3: Objective-C vs. Swift
Migrating Objective-C to Swift
Migration Objective-C to Swift
Migrating from Objective-C to Swift
Value objects in JS - an ES7 work in progress

What's hot (20)

PDF
Extensible Operators and Literals for JavaScript
PDF
Thinking in Functions
PDF
Cilk - An Efficient Multithreaded Runtime System
PDF
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
PDF
Getting Swifty in an Objective-C World
PDF
D programming language
ODP
The D Programming Language - Why I love it!
KEY
Objective c
PPTX
Dynamic in C# 4.0
PPTX
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
PDF
Programming Languages: some news for the last N years
PPTX
To Lombok or not to Lombok | J-Fall 2019
PDF
Categories for the Working C++ Programmer
PPTX
Dynamic languages for .NET CLR
PDF
Kotlin Crash Course
PDF
Elixir + GraphQL = Absinthe 2019.04.10
PDF
Codemotion 2015 - Akka voló sobre el nido del future
PPTX
Code for kombol - Objects and Functions in JS and NodeJS
PDF
Elliptic Curve Cryptography Message Exchange
PDF
Serving models from AWS Lambda
Extensible Operators and Literals for JavaScript
Thinking in Functions
Cilk - An Efficient Multithreaded Runtime System
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Getting Swifty in an Objective-C World
D programming language
The D Programming Language - Why I love it!
Objective c
Dynamic in C# 4.0
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Programming Languages: some news for the last N years
To Lombok or not to Lombok | J-Fall 2019
Categories for the Working C++ Programmer
Dynamic languages for .NET CLR
Kotlin Crash Course
Elixir + GraphQL = Absinthe 2019.04.10
Codemotion 2015 - Akka voló sobre el nido del future
Code for kombol - Objects and Functions in JS and NodeJS
Elliptic Curve Cryptography Message Exchange
Serving models from AWS Lambda
Ad

Similar to Objectivec vs swift (20)

PPTX
Swift programming language
ODP
Ayush oops
PPTX
Introduction to JavaScript
PPTX
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
PPT
8844632.ppt
PPT
358 33 powerpoint-slides_1-introduction-c_chapter-1
PPTX
OODP Unit 1 OOPs classes and objects
PDF
1 puc programming using c++
PDF
BSSML16 L10. Summary Day 2 Sessions
PDF
App Trainers
PDF
Smalltalk, the dynamic language
DOCX
C-sharping.docx
PDF
PDF
VSSML17 Review. Summary Day 2 Sessions
PPTX
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
PPTX
CHARACTERISTICS OF C (1).pptxtejwueghhehe
PDF
DOC-20240718-WA0006..pdf34642235632567432
PDF
Ruby is dying. What languages are cool now?
PDF
PL Lecture 01 - preliminaries
PPTX
C++ l 1
Swift programming language
Ayush oops
Introduction to JavaScript
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
8844632.ppt
358 33 powerpoint-slides_1-introduction-c_chapter-1
OODP Unit 1 OOPs classes and objects
1 puc programming using c++
BSSML16 L10. Summary Day 2 Sessions
App Trainers
Smalltalk, the dynamic language
C-sharping.docx
VSSML17 Review. Summary Day 2 Sessions
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
CHARACTERISTICS OF C (1).pptxtejwueghhehe
DOC-20240718-WA0006..pdf34642235632567432
Ruby is dying. What languages are cool now?
PL Lecture 01 - preliminaries
C++ l 1
Ad

Objectivec vs swift

  • 2. Objective C ● Object-oriented programming language ● Developed in the early 1980s (NeXTSTEP) ● Files have .h and .mm file extensions, C header files ● Created primarily by Brad Cox ● Messages,Interface,Implementation,Instantiation ● 2014, Apple announced plans to replace Objective-C new Swift language
  • 3. Worst things about Objective-C ● Bulky syntax,Squared brackets,Memory management ● No Generics,No enums,No operator overloading ● Dealloc won't be called automatically ● More Complex object sort ● Publishing an Apple app is a nightmare ● No Generics
  • 4. Swift ● Father is Chris Latter(july 2010) ● Functional,Fast,Funny,Happy ● Variable name,Tuples, No pointers ● Function with multiple return values ● Apple Swift has clean syntax
  • 5. Similarities to Objective-C ● Curly braces are used to group statements. ● A new identity operator, ===, is provided to check if two data elements refer to the same object. ● Square brackets are used with arrays, both to declare them and to get a value at a given index in one of them. ● Control statements are similar. ● Class methods are inherited, just like instance methods; self in class methods is the class the method was called on.
  • 6. Differences from Objective-C ● No semicolon, Header files, Exception handling ● Strong typing,Type inference ● Fallthrough for switch case
  • 7. Differences from Objective-C ● No semicolon, Header files, Exception handling ● Strong typing,Type inference ● Fallthrough for switch case