Structs and Enums in Swift

 Structures We’ve discussed classes in Swift and how they are the foundation of object-oriented programming. In addition to classes, we also have structures that provide similar functionality. A structure is similar to a class since it can also have methods, properties, and initializers, but a structure is a value type where classes are reference types. Every type in Swift is either a value type … Read moreStructs and Enums in Swift

Working with Closures in Swift

Closures Closures are small, self-contained blocks of code that can be used in our code, not unlike a function. (The reason these are called closures is because they’re said to “close” over constants and variables.) Let’s first get some context for closures. Suppose we have an array of names that we want to sort. Well it turns … Read moreWorking with Closures in Swift

Tutorials on game, web and mobile app development