SWIFT Basic Syntax – Data Type

Common Swift data types

value type enum Optional
structure (Struct) Bool, Int, Float, Double, Character
String, Array, Dictionary, Set
reference type class class

Share a picture

Swift flow control

  • The () after the flow control if, while, for in Swift can be omitted, and the brace after the condition cannot be omitted
  • Starting from Swift3, the increment and decrement operators are removed
  • repeat-while is equivalent to do-while in C language

if-else

Share a picture

while

Share a picture

for

Sw The use of ift’s for loop is combined with the interval type. Interval type in Swift

share picture

< p>for loop use

share picture

If the variable i is not used in the for loop body, you can use _omit

share picture

The interval operator is used on the array for loop traversal

< img alt="share picture" src="/wp-content/uploads/images/mobile/swift/1626792707727.png" width="700" >

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4135 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.