UI Design Ios App Development Swiftui - Programming Ebook

Latest

Download Programming Ebook

Monday, February 1, 2021

UI Design Ios App Development Swiftui

UI Design Ios App Development Swiftui
UI Design Ios App Development Swiftui




Book Details 
             TitleUI Design Ios App Development Swiftui
      ISBN-10978-1-4842-6448-5
         Author: Bear Cahill
     Publisher: Apress
    Language: English
        SubjectSwift / Computers & Technology / Programming / Apple Programming
No. of pages: 321
         Format: PDF, EPUB

Introducing SwiftUI

First, thank you for reading at least this much of the first chapter. It’s tempting to skip it. However, I’m the type of person that reads the foreword, the preface, and so on. Someone thought it important enough to write and include it; maybe it’s worth it.

When learning a new IDE, language, or user interface design tool, it can be hard to know where to start. I’ll say this: if you don’t know Swift, learning SwiftUI will be very tough. In fact, if you don’t know about Xcode, iOS development, and the various frameworks related to it, learning SwiftUI isn’t the best place to start (see Figure 1-1).

Figure 1-1. SwiftUI Interface Example
This isn’t a book on Swift, Xcode, iOS frameworks, or UIKit. Being

familiar with those is important if not required.

© Bear Cahill 2021
B. Cahill,
UI Design for iOS App Development, https://doi.org/10.1007/978-1-4842-6449-2_1

1

Chapter 1 IntroduCIng SwIftuI

Exercises

I’ve included one or more exercises per chapter. Some are shorter and some are longer. In each case, there is also one or more End of Chapter (EOC) zip file of the code for you to review.

Many chapters build on the same code throughout the chapter. So there’s only one EOC file with the full result.

The point of each exercise is practice. I want you to go through
the process of employing what you’re learning. I highly recommend experimenting with variations of the exercises as your curiosity prompts you.

I also strongly encourage repetition. If you repeat an exercise a handful of times to the point that you can just knock it out with familiarity, you’ll be better off when you’re done with this book.

Concepts

Much of SwiftUI will feel like Swift. That’s good if you know Swift. You’ll feel somewhat comfortable passing closures, chaining calls, handling optionals, and so on.

However, SwiftUI has a very state-driven concept to the UI. The user interface is a display of the state. If a value (the state) changes, the UI should reflect that so it needs to render again.

If the value displayed in a TextField is updated, the interface should display the new value. This is done automatically in SwiftUI with binding. We’ll use property wrappers (similar to how Optional is a type with a wrapped value) to pass these values into controls like the TextField.

The TextField will be updated if the value changes. But also changes in the TextField will be stored in the same place as the item passed in. No more getting the text property and storing – SwiftUI cuts out the middle step and just changes the property!

Source of Truth

Advanced Swift Learn At Home Bundle By Ray Wenderlich

The concept of these property wrappers is tied to the idea of the “source of truth.” If we have the username or email address stored in a property, that can be the source of truth. If the property changes, the UI is updated. If the user types in a new value, it’s stored in that same property.

There are different ways of using this concept on value types (e.g., structs) vs. reference types (e.g., classes). We’ll explore these in detail in this book.

Old Friends

We’ll also look at how to use an existing UI in a SwiftUI-based app. You may have some existing code that works great, and you want to reuse it. No sense in throwing it away if it’s still good.

Or you may just not have time to re-create the whole UI in one effort.

New Friends

Of course, we’ll look at developing interface designs in SwiftUI. But we’ll also look at how to use SwiftUI in Storyboard projects. You may want to migrate to SwiftUI starting in your current UIKit app.

However you decide or need to start using SwiftUI, I hope this book helps get you there.

Combine

If you haven’t used the Combine framework yet, you will in this book. This is not a book on Combine, but parts of it are tightly integrated in things we need to do in SwiftUI.

There are Combine aspects sprinkled throughout this book. There’s also a chapter specifically intended to go a little deeper into Combine. That framework probably deserves its own book, but we’ll dig a bit deeper at times to understand what we’re doing and using. 

No comments:

Post a Comment