Gentle Introduction To Swift Programming

Peter Edache
Abuja iOS Developers
3 min readSep 9, 2017

My first 2 hours on swift programming language.

  1. VARIABLE and CONSTANT
    Use the let keyword if the value you want to assign
    does not change.

    The var keyword is used to to store thing that would
    change in your program

2. ANNOTATIONS [ TYPE INFERENCE VS SAFETY]
Type Safety are use to add some kind of typing to
a variable or constant. I would not say constraint but
safety.

Type inference happens when we declare a constant
or variable, and allowing swift to infere the type
automatically

3.TRUTHS and CONDITIONS

So in swift we can define boolean and use them
for some conditional cases

4. PRINT STATEMENT and STRING INTERPOLATION
So interpolation means the insertion of something
of a different nature into something else.

5. TUPLES
So tuples in literal means
a data structure consisting of multiple parts.

6. FUNCTIONS
Function can be declared inside a swift file
or inside a class or struct.

7. CLASS and STRUCT

More info on class an struct .

8. COLLECTIONS
Swift provides three primary collection types,
known as arrays, sets, and dictionaries,
for storing collections of values.
Arrays are ordered collections of values.
Sets are unordered collections of unique values.
Dictionaries are unordered collections of key-value associations

Swift seems to be a very nice concise language, and the apple guys have done a very nice job.

More info on swift api can be found on the link below. Thanks for reading.

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-ID309

--

--