Understanding Model-View-Controller (MVC) on iOS

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:34 am | 5-min read

Model-View-Controller (MVC) is an exceptionally powerful software architectural pattern for creating iOS apps. MVC is the answer to the question: “How should I organize code in my iOS app?” You already know Object-Oriented Programming (OOP). OOP organizes your Swift code in classes that have properties and functions, much like bob is an instance of class Human, that has properties legs and noseSize. Model-View-Controller builds on top of Object-Oriented Programming. It structures the f [...]

Read More

Type Casting in Swift Explained

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:34 am | 5-min read

You use type casting in Swift to treat an instance of a particular class as a subclass or superclass in the same class hierarchy. But… what does that even mean? Type casting is a powerful programming concept, because it helps you to write flexible and reusable code. It’s crucial for iOS developers to master, because type casting is frequently used in practical iOS development. In this tutorial you’ll learn how to use type casting in Swift. We’ll take a look at upcasting with as, do [...]

Read More

Opaque Types and ‘some’ in Swift

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:34 am | 5-min read

Opaque types are an important feature of Swift. With the some keyword, which denotes an opaque type, you can “hide” the concrete return type of a computed property or function. And that allows us to write flexible, concise and robust Swift code. In this tutorial, we’re going to discuss how opaque types work. Here’s what we’ll get into: How do you use the some keyword? What’s an opaque type and why do we need it? How do opaque types affect SwiftUI and iOS development? 3 advan [...]

Read More

Learn Swift Programming The Simple Way

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:34 am | 4-min read

Swift is a powerful and easy to learn programming language for iOS, macOS, and more. Learning how to code Swift is simple, a lot of fun, and you can build awesome apps with it! In this tutorial, we’ll discuss simple approaches to learn Swift coding. Here’s what we’ll get into: How to get started with Swift programming – what do you need? Learning techniques that best fit your style of learning Beginner topics that are smart to master first Resources that can help you: tutorials, [...]

Read More

Promises in Swift

Aasif
By Aasif | Last Updated on December 22nd, 2021 6:34 am | 5-min read

Promises in Swift simplify your asynchronous code. Instead of “callback hell” you create a concise chain of functions, and keep your code clean. Let’s find out how! In this tutorial you’ll learn how to use promises. We’ll use PromiseKit, a great library for iOS written in Swift. Promises are part of good app architecture. Ready? Let’s go. Table of Contents The Problem Promises Solve Writing Asynchronous Code with Promises How to Make Promises with Swift Multiple Conc [...]

Read More

Most Popular Posts