A Journey From Objective C to Swift

Post on 18-Aug-2015

466 views 3 download

Tags:

Transcript of A Journey From Objective C to Swift

OBJECTIVE C TO SWIFT

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

1980s by Brad Cox and

Tom Love

25 years oldNever Ending Pride…..

Best Programming LanguageThat Turns to Trend…..

“Change is the law of life”

– John F. Kennedy

That Left Everything Behind……….

Huge surprise at WWDC 2014

An announced made by Apple for change in

programming language for iOS and OS X

Change Ahead………

New programming language

Quality is much better than

quantity. One home run is

much better than two doubles

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

Swift- For Beinginners

Shift to SWIFT – The need for something new

Why Apple chose to adopt swift as new change?

Shift to SWIFT for better results………….

Advantages of swift over Objective C

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

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

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

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

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

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….

Similarities between Swift and Objective C

- 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

ABOUT Us

We are ChromeInfo Technologies, a Mobile App

Development, Web Development and Software

Testing company with development center in India.

REACH US @

For More…..

MOBILE : US : + 1.408.786.5369

INDIA : +91.783.800.9900

+91.981.188.2994

EMAIL : sales@chromeinfotech.com

SKYPE : nidhi_chrome

chromeinfotech

www.chromeinfotech.com