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

How to Build an iOS Unit Converter App with Swift – Part 2

Hello World! This is the 2nd and final part of our Unit Converter post. In this post, we’re going to finish our Unit Converter app and see it working in our emulator! We’ll delve into UIPickerView and learn about delegates and data sources! Let’s get started! Since we’re finished with the UI and model, we need to wire everything in our UIViewController subclass. … Read moreHow to Build an iOS Unit Converter App with Swift – Part 2

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

How to Build an iOS Unit Converter App with Swift – Part 1

Hello world! In this post, we’re going to start building our first real-world app: a unit converter! With it, we hope to quickly convert between different units of length. This is Part 1 of the Unit Converter app post. In this part, we’ll learn about the Model-View-Controller pattern of iOS, UIPickerView, Swift enumerations, and static methods. We’ll also finish our UI and … Read moreHow to Build an iOS Unit Converter App with Swift – Part 1

Tutorials on game, web and mobile app development