The Swift Programming Language with iOS App

2,227 views

Published on

Swift is the latest new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility.

This presentation is all about swift programming along with major iOS 8 Features and changes.

Published in: Software
3 Comments
9 Likes
Statistics
Notes
  • Programming Swift: Create A Fully Function App: Learn In A Day! --- http://amzn.to/1R7bInW
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Protocol Oriented Programming with Swift --- http://amzn.to/1RsFmGf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Swift Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides) --- http://amzn.to/1T2JQTj
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,227
On SlideShare
0
From Embeds
0
Number of Embeds
37
Actions
Shares
0
Downloads
117
Comments
3
Likes
9
Embeds 0
No embeds

No notes for slide

The Swift Programming Language with iOS App

  1. 1. IOS 8 Features and Swift Development Presenter: Vivek Chaudhary, Mindfire Solutions Date: 08/05/2013
  2. 2.  IOS 8 Features  Swift Development  Syntax and Basics  Objective C to Swift  Sample Code  Pros and Cons
  3. 3.  Battery usage indicator  Interactive Notifications  Credit Card Scanning  New keyboard  Continuity  Family Sharing
  4. 4.  Message UI and new widgets  Lock screen app suggestions  Healthkit  Improved search results
  5. 5.  Some syntax from Java Script  Smartly detects data types itself  Objective C API + Additional  No semicolon  Body Braces compulsory for If-else
  6. 6.  Single file in place of two files (.h and .m)  Declaration and implementation in the same file  Reduces the project size  Number of files reduces to half
  7. 7. 1. let someConstant : String = “constant” 2. var someVar : String = “variable”  Swift is smart enough to detect data types  Var someVar = “variable”  Var var1 = 1  Var var2 = 1.0
  8. 8.  NSString and String both are available 1. Let string = “Hello” 2. Let anotherString = string + “Mindfire” 1. For char in str 2. { 3. // Code Here 4. }
  9. 9.  Objective C  [NSString stringWithFormat:]  Swift  (expression)  Let var1 = 2  Let var2 = 3  Println( “Multiplication is : (var1 * var2)”)
  10. 10. 1. let someArray:String[] = [“A”, “B”, “C”] 2. let someArray = [“A”, “B”, “C”] 3. var someArray:String[] = [“A”, “B”, “C”] 4. SomeArray += “D” 5. SomeArray += [“D”, “E”] 6. print(“First Element :(someArray[0]) ”)
  11. 11. 1. let dict:Dictionary<String, String> = [“A”:”1”, “B”:”2”] 2. var dict:Dictionary<String, String> = [“A”:”1”, “B”:”2”] 3. var dict = [“A”:”1”, “B”:”2”] 1. dict[“C”] = “3” 2. Dict += [“D”:”4”, “E”:”5”]
  12. 12.  + and – are sliced off. func functionName(var1:String, var2:String)- >String  Functions can return more than one parameters too.  These are returned in the form of tuples.
  13. 13. Function Definition func functionName(var1:String, var2:String)- >(String, Int) Function Calling Var result : (res1:String, res2:Int) = self.functionName(var1:”Hello”, var2:”Mobile”) Print(“result is (result.res1)”;
  14. 14.  Type id changes to AnyObject  Downcast is done automatically by swift.  “as” keyword is used to typecast Var textField: UITextField = array.firstObject() as UITextField
  15. 15. One has to manually change his Objective C code to Swift  - changes to func  + changes to class func  #define changes to let  #pragma changes to // MARK :
  16. 16.  init is not used in swift.  InitWith and with is also not used.  Complex macros should be converted into functions Let myColor = UIColor(red:0.5, green:0.5,blue:0.5, alpha:1.0);
  17. 17. PLAYGROUNDS
  18. 18. REFRENCE LINKS https://developer.apple.com/library/prerelease/i os/documentation/Swift/Conceptual/BuildingCo coaApps/ http://code.tutsplus.com/tutorials/an- introduction-to-swift-part-1--cms-21389
  19. 19. Presenter: Debasish Mohanty, Mindfire Solutions Thank you 
  20. 20. www.mindfiresolutions.com https://www.facebook.com/MindfireSolutions http://www.linkedin.com/company/mindfire-solutions http://twitter.com/mindfires

×