Swift Language Reference Day 120 part 2 Let’s now delve into the Language Reference. It should not be too long before I can start building apps again! Lexical Structure The lexical structure of Swift describes what sequence of characters form valid tokens of the language. These valid tokens form the lowest-level building blocks of theContinue reading “Learning Swift — Days 120-122”
Category Archives: Swift
Learning Swift — Days 117-120
Review of the Swift Programming Language Day 117 part 2 Generics Generic code enables us to write flexible, reusable functions and types that can work with any type, subject to requirements that we define. We can write code that avoids duplication and expresses its intent in a clear, abstracted manner. The Problem That Generics SolveContinue reading “Learning Swift — Days 117-120”
Learning Swift — Days 114-117
Review of the Swift Programming Language Day 114 Type Methods: we indicate type methods by writing the static keyword before the method’s func keyword. Classes can use the class keyword instead, to allow subclasses to override the superclass’s implementation of that method. Subscripts Subscript Syntax: subscripts enable you to query instances of a type byContinue reading “Learning Swift — Days 114-117”
Learning Swift — Days 111-113
Review of the Swift Programming Language Day 111 Repeat-while loops Conditional Statements If (in case conditions are not complete, no action will be taken and this is fine) Switch (this has to be exhaustive instead) No Implicit Fallthrough Tuples: when using tuples inside switch blocks we can use the wildcard pattern (_ in place ofContinue reading “Learning Swift — Days 111-113”
Learning Swift — Days 108-110
Review of the Swift Programming Language Day 108 Crazy, crazy day today… I can’t find the time to do extra things… I am mentally exhausted. Nevertheless… here is what I could review today: Numeric Type Conversion Type Aliases Booleans Tuples Optionals Error Handling Assertions and Preconditions (I would like to see more practical examples ofContinue reading “Learning Swift — Days 108-110”
