Swift: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
==If Statements==
==If Statements==
No surprises
No surprises
<syntaxhighlight lang="swf">
<syntaxhighlight lang="swift">
if a < 4 {
if a < 4 {
   print("we are here 1")
   print("we are here 1")
}
}
else if {
else if a == 4 && a < 3 {
   print("we are here 2")
   print("we are here 2")
}
}

Revision as of 00:02, 24 June 2022

Introduction

Here is my first dip into Apple and swift Swift Cheat Sheet

Data Types

Here we have the following Primatives

  • Int
  • Float
  • Double
  • Str
  • Bool

Control

If Statements

No surprises

if a < 4 {
  print("we are here 1")
}
else if a == 4 && a < 3 {
  print("we are here 2")
}
else {
  print("we are here 3")
}