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”

Learning Swift — Day 107

Day 107 — starting with it. Basic start As Paul said, let’s start simple and build something that we are sure it is working, then move on from there. I will write down all of the passages so that it is easy to follow. The first iteration of the project is an emoji concentration cardContinue reading “Learning Swift — Day 107”