SlideShare a Scribd company logo
Swift
Objective C
Objective C without the C
C# with Cocoa
C# vs Swift – Arrays
●
Objective C
NSArray *myArray = [[NSArray alloc]
init];
NSArray *myArray = [[NSArray alloc]
initWithObjects:@"one", @"two",
@"three", nil];
●Swift
var myArray = String[]();
var myArray = [“one”, “two”, “three”];
●C#
var myArray = new string[];
var myArray = new []{“one”, “two”,
“three”};
C# vs Swift - Functions
●
Objective C
- (string)sayHello:(string)name
{
// do something
}
●C#
st ri ng sayHello(st ri ng name) {
// do something
}
●Swift
func sayHello(name: String) -> String {
// do something
}
Playgrounds
What next?
How to get it
Further Resources
●
Swift Language website.
●
Swift Programming Language: iBook or PDF
●
Using Swift with Cocoa and Objective C: iBook
or PDF
●
Reddit or Medium communities
●
Swift at WWDC
●
Playground demo at WWDC

More Related Content

What's hot

Yokohamagrouppp 1031
Yokohamagrouppp 1031Yokohamagrouppp 1031
Yokohamagrouppp 1031
Yukari Ohno
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
Dr. Loganathan R
 
Wcbpijwbpij new
Wcbpijwbpij newWcbpijwbpij new
Wcbpijwbpij new
Hanokh Aloni
 
Jan Pustelnik - Curry-Howard w praktyce
Jan Pustelnik - Curry-Howard w praktyceJan Pustelnik - Curry-Howard w praktyce
Jan Pustelnik - Curry-Howard w praktyce
SegFaultConf
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
Dr. Loganathan R
 
GCD in Action
GCD in ActionGCD in Action
GCD in Action
Nigel Barber
 
Why my Go program is slow?
Why my Go program is slow?Why my Go program is slow?
Why my Go program is slow?
Inada Naoki
 
week-4x
week-4xweek-4x
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
Dr. Loganathan R
 
Snow
SnowSnow
คำสั่ง For
คำสั่ง Forคำสั่ง For
คำสั่ง For
kramsri
 
Circular queue
Circular queueCircular queue
Circular queue
ShobhaHiremath8
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
Toshiyuki Terashita
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
Hitesh Kumar
 
Ignite es6
Ignite es6Ignite es6
Ignite es6
jstack
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
ilsamaryum
 
Why MacRuby Matters
Why MacRuby MattersWhy MacRuby Matters
Why MacRuby Matters
importantshock
 

What's hot (17)

Yokohamagrouppp 1031
Yokohamagrouppp 1031Yokohamagrouppp 1031
Yokohamagrouppp 1031
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Wcbpijwbpij new
Wcbpijwbpij newWcbpijwbpij new
Wcbpijwbpij new
 
Jan Pustelnik - Curry-Howard w praktyce
Jan Pustelnik - Curry-Howard w praktyceJan Pustelnik - Curry-Howard w praktyce
Jan Pustelnik - Curry-Howard w praktyce
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
GCD in Action
GCD in ActionGCD in Action
GCD in Action
 
Why my Go program is slow?
Why my Go program is slow?Why my Go program is slow?
Why my Go program is slow?
 
week-4x
week-4xweek-4x
week-4x
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
Snow
SnowSnow
Snow
 
คำสั่ง For
คำสั่ง Forคำสั่ง For
คำสั่ง For
 
Circular queue
Circular queueCircular queue
Circular queue
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
Ignite es6
Ignite es6Ignite es6
Ignite es6
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
Why MacRuby Matters
Why MacRuby MattersWhy MacRuby Matters
Why MacRuby Matters
 

Similar to Swift Lunch & LEarn

Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
Mindfire Solutions
 
RubyMotion
RubyMotionRubyMotion
RubyMotion
Mark
 
Core Java Programming Language (JSE) : Chapter V - Arrays
Core Java Programming Language (JSE) : Chapter V - ArraysCore Java Programming Language (JSE) : Chapter V - Arrays
Core Java Programming Language (JSE) : Chapter V - Arrays
WebStackAcademy
 
How to Write Node.js Module
How to Write Node.js ModuleHow to Write Node.js Module
How to Write Node.js Module
Fred Chien
 
Objective-Cひとめぐり
Objective-CひとめぐりObjective-Cひとめぐり
Objective-Cひとめぐり
Kenji Kinukawa
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
Tunvir Rahman Tusher
 
Swift for-rubyists
Swift for-rubyistsSwift for-rubyists
Swift for-rubyists
Michael Yagudaev
 
iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)
David Truxall
 
Working with Cocoa and Objective-C
Working with Cocoa and Objective-CWorking with Cocoa and Objective-C
Working with Cocoa and Objective-C
Kazunobu Tasaka
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
sagaroceanic11
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
Jussi Pohjolainen
 
Swift와 Objective-C를 함께 쓰는 방법
Swift와 Objective-C를 함께 쓰는 방법Swift와 Objective-C를 함께 쓰는 방법
Swift와 Objective-C를 함께 쓰는 방법
Jung Kim
 
Day 1
Day 1Day 1
OpenCVの基礎
OpenCVの基礎OpenCVの基礎
OpenCVの基礎
領一 和泉田
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
Pascal Rettig
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!
Scott Gardner
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
S Akai
 
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders TeamIntroducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
Touchwonders
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
jeffz
 
Modernizes your objective C - Oliviero
Modernizes your objective C - OlivieroModernizes your objective C - Oliviero
Modernizes your objective C - Oliviero
Codemotion
 

Similar to Swift Lunch & LEarn (20)

Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
RubyMotion
RubyMotionRubyMotion
RubyMotion
 
Core Java Programming Language (JSE) : Chapter V - Arrays
Core Java Programming Language (JSE) : Chapter V - ArraysCore Java Programming Language (JSE) : Chapter V - Arrays
Core Java Programming Language (JSE) : Chapter V - Arrays
 
How to Write Node.js Module
How to Write Node.js ModuleHow to Write Node.js Module
How to Write Node.js Module
 
Objective-Cひとめぐり
Objective-CひとめぐりObjective-Cひとめぐり
Objective-Cひとめぐり
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
 
Swift for-rubyists
Swift for-rubyistsSwift for-rubyists
Swift for-rubyists
 
iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)
 
Working with Cocoa and Objective-C
Working with Cocoa and Objective-CWorking with Cocoa and Objective-C
Working with Cocoa and Objective-C
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
Swift와 Objective-C를 함께 쓰는 방법
Swift와 Objective-C를 함께 쓰는 방법Swift와 Objective-C를 함께 쓰는 방법
Swift와 Objective-C를 함께 쓰는 방법
 
Day 1
Day 1Day 1
Day 1
 
OpenCVの基礎
OpenCVの基礎OpenCVの基礎
OpenCVの基礎
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
 
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders TeamIntroducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
 
Modernizes your objective C - Oliviero
Modernizes your objective C - OlivieroModernizes your objective C - Oliviero
Modernizes your objective C - Oliviero
 

Recently uploaded

The Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdfThe Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdf
mohitd6
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
Alina Yurenko
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
Luigi Fugaro
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
WebConnect Pvt Ltd
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
KrishnaveniMohan1
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
confluent
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 

Recently uploaded (20)

The Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdfThe Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdf
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
bgiolcb
bgiolcbbgiolcb
bgiolcb
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 

Swift Lunch & LEarn

  • 5. C# vs Swift – Arrays ● Objective C NSArray *myArray = [[NSArray alloc] init]; NSArray *myArray = [[NSArray alloc] initWithObjects:@"one", @"two", @"three", nil]; ●Swift var myArray = String[](); var myArray = [“one”, “two”, “three”]; ●C# var myArray = new string[]; var myArray = new []{“one”, “two”, “three”};
  • 6. C# vs Swift - Functions ● Objective C - (string)sayHello:(string)name { // do something } ●C# st ri ng sayHello(st ri ng name) { // do something } ●Swift func sayHello(name: String) -> String { // do something }
  • 10. Further Resources ● Swift Language website. ● Swift Programming Language: iBook or PDF ● Using Swift with Cocoa and Objective C: iBook or PDF ● Reddit or Medium communities ● Swift at WWDC ● Playground demo at WWDC

Editor's Notes

  1. The new language from Apple for iOS and MacOS development In closed development since 2010 Influences: C#, Ruby, Rust, ML, ObjC ObjC without the C? Or is it C#/Java with the Cocoa framework
  2. ObjC is really just C, with a thin layer over the top. C puts a target on your foot, and then puts your foot against your head It looks weird with the square brackets notation instead of dot notation in c#/Java It feels weird because of the messaging-passing system vs the method calling system in c#/Java And this is how you get Xamarin, a wildly overpriced product that saves c# devs having to learn something new.
  3. Swift sets out to avoid the more notoriously destructive qualities of c Memory management by default No pointers Assignments don't return a value No fall through in switch statements, so no need for break Variables are always initialized Array bounds checked, overflows cause exceptions No integer overflows All blocks require braces
  4. This is nothing new, almost all third gen c-like languages have all or most of these restrictions. Memory management and pointers So perhaps it is better to say it is Java/C# with some ObjC makeup and Cocoa binds For much of the core language, Swift is indistinguishable from c#
  5. Playground is a visual, interactive Read-Eval-Print Loop Allows the developer to view the state of the variables in their code For loops a visual view displays the changing values of variables over time Visual view can also display UI elements http://www.youtube.com/watch?v=w87fOAG8fjk#t=6460
  6. Not the dawn of some golden age of Apple development Still in beta. Language is still having rough edges buffed off Objective C won't go away overnight: Years of existing software The flipside of familiarity for C#/Java devs is unfamiliarity for ObjC developers Cocoa designed for Objective C Xamarin.iOS should lose market share
  7. Requires Mac OS Requires XCode 6, which is still in beta And totes can only be acquired by fully paid up members of the iOS or Mac Developer Programs