A Journey From Objective C to Swift

24
OBJECTIVE C TO SWIFT

Transcript of A Journey From Objective C to Swift

Page 1: A Journey From Objective C to Swift

OBJECTIVE C TO SWIFT

Page 2: A Journey From Objective C to Swift

Objective-C was created at the Stepstone company in the early

1980s by Brad Cox and

Tom Love

Page 3: A Journey From Objective C to Swift

25 years oldNever Ending Pride…..

Page 4: A Journey From Objective C to Swift

Best Programming LanguageThat Turns to Trend…..

Page 5: A Journey From Objective C to Swift

“Change is the law of life”

– John F. Kennedy

Page 6: A Journey From Objective C to Swift

That Left Everything Behind……….

Huge surprise at WWDC 2014

Page 7: A Journey From Objective C to Swift

An announced made by Apple for change in

programming language for iOS and OS X

Page 8: A Journey From Objective C to Swift

Change Ahead………

New programming language

Page 9: A Journey From Objective C to Swift

Quality is much better than

quantity. One home run is

much better than two doubles

Page 10: A Journey From Objective C to Swift

For iOS and OSX.........

Swift- For Beinginners

Page 11: A Journey From Objective C to Swift

Shift to SWIFT – The need for something new

Why Apple chose to adopt swift as new change?

Page 12: A Journey From Objective C to Swift

Shift to SWIFT for better results………….

Advantages of swift over Objective C

Page 13: A Journey From Objective C to Swift

EASIER TO READ

Objective C

Introduced new keywords

using the @ symbol

Follow legacy conventions

Ugly duckling used

Swift

It isn’t built on C, it can unify

all the keywords and remove

the numerous @ symbols

Drops legacy conventions

Readability makes it easier

Page 14: A Journey From Objective C to Swift

Objective C Swift

EASIER TO MAINTAIN

Maintain two code files

requirement

Manually synchronize method

between files, but this isn’t

guaranteed unless the team has

rules and code reviews in place.

Drops the two-file

requirement

Programmers do less

bookkeeping and can spend

more time creating app

logic

Page 15: A Journey From Objective C to Swift

Objective C Swift

SAFER

Pointers interesting aspect –

particularly nil (null) pointers

Swift code generate a

compiler error

-Write bad code creating a short feedback loop

-Allowing the person to fix

the problem

Page 16: A Journey From Objective C to Swift

Objective C Swift

MEMORY MANAGEMENT

ARC is supported within the

Cocoa APIs and object-

oriented code, It is not

available, for procedural

C code and APIs like Core

Graphics

Low Performance in different

case

Support for Automatic

Reference Counting is

complete across the procedural

and object-oriented code paths

Automatic and high-

performance memory

management

Page 17: A Journey From Objective C to Swift

Objective C Swift

ERASE TO CODE

Requires many steps to

combine two pieces of

information i.e. in String

Missing in Objective-C

Reduces the amount of

code that is required for

repetitive statements and

string manipulation

Adopts modern programming

language features like adding

two strings together with a “+”

operator

Page 18: A Journey From Objective C to Swift

Objective C Swift

Memorize special string tokens

(%s, %d, %@)

Objective C is established

Supports string interpolation,

which eliminates the need to

memorize tokens

SWIFT language that is

available today isn’t the

finished product

CONT….

Page 19: A Journey From Objective C to Swift

Similarities between Swift and Objective C

Page 20: A Journey From Objective C to Swift

- There is interoperability between Swift and Objective C and both can be mixed and matched in the same app

- You can have typed collections on account of the introduction of Generics

- Dynamic evaluation in the development environment, in real time

- Default Parameter Values

- Difference between struct and class

- Type Inference

Page 21: A Journey From Objective C to Swift

ABOUT Us

We are ChromeInfo Technologies, a Mobile App

Development, Web Development and Software

Testing company with development center in India.

Page 22: A Journey From Objective C to Swift

REACH US @

For More…..

MOBILE : US : + 1.408.786.5369

INDIA : +91.783.800.9900

+91.981.188.2994

EMAIL : [email protected]

SKYPE : nidhi_chrome

chromeinfotech

www.chromeinfotech.com