SwiftUI For Dummies

SwiftUI For Dummies
Автор книги: id книги: 1887810     Оценка: 0.0     Голосов: 0     Отзывы, комментарии: 0 2824 руб.     (28,71$) Читать книгу Купить и скачать книгу Купить бумажную книгу Электронная книга Жанр: Программы Правообладатель и/или издательство: John Wiley & Sons Limited Дата добавления в каталог КнигаЛит: ISBN: 9781119652700 Скачать фрагмент в формате   fb2   fb2.zip Возрастное ограничение: 0+ Оглавление Отрывок из книги

Реклама. ООО «ЛитРес», ИНН: 7719571260.

Описание книги

The simplest way to create world-class apps   Have a unique app idea but worried you don’t quite have the coding skills to build it? Good news: You can stop fretting about someone beating you to market with the same idea and start work right now using SwiftUI. SwiftUI is a gateway app development framework that has become one of the best ways for fledgling developers to get iOS apps off the ground without having to become a coding expert overnight.  SwiftUI  For Dummies  makes that process even faster, providing a friendly introduction to the SwiftUI and Swift programming language and helping you feel right at home creating and building with playgrounds. The book also covers the frameworks and APIs that make it so easy to create smooth, intuitive interfaces—just dive right in and have fun!  Combine projects into workspaces Employ Xcode editing tools Use constants and variables Test your code on iOS Simulator Time is of the essence, and with  SwiftUI For Dummies , it’s also on your side. Get going with this friendly guide today, and you’ll be celebrating the successful launch of your app way before you thought possible!

Оглавление

Wei-Meng Lee. SwiftUI For Dummies

SwiftUI™ For Dummies® To view this book's Cheat Sheet, simply go to www.dummies.com and search for “Swift UI For Dummies Cheat Sheet” in the Search box. Table of Contents

List of Illustrations

Guide

Pages

Introduction

About This Book

Foolish Assumptions

Icons Used in This Book

Beyond the Book

Where to Go from Here

Getting Started with Swift and SwiftUI

Introducing SwiftUI

Understanding What SwiftUI Is

Getting the Tools

Hello, SwiftUI

Automatically previewing your user interface using the canvas

Working with Live Preview

Generating different previews

The Gory Details

Info.plist

AppDelegate.swift

SceneDelegate.swift

Basics of the Swift Programming Language

Basic Swift Syntax

Constants

Variables

Strings

Comments

Basic Data Types

Integers

Floating-point numbers

Booleans

Tuples

Arrays

Retrieving elements from an array

Inserting elements into an array

Modifying elements in an array

Appending elements to an array

Removing elements from an array

Dictionaries

Retrieving elements from a dictionary

Modifying an item in a dictionary

Removing an item from a dictionary

Optional Types

Working with implicitly unwrapped optionals

Using optional binding

Unwrapping optionals using “?”

Using the nil coalescing operator

Functions

Understanding input parameters

Returning a value

Flow Control

If-Else statement

Ternary conditional operator

Switch statement

Looping

For-In loop

While loop

Repeat-While loop

Control transfer statements

Range operators

Structures

Memberwise initializers

Structures as value types

Classes

Defining a class

Understanding properties

Stored properties

Computed properties

Using methods in classes

Trying out the self property

Closures

Understanding closures

Using functions as closures

Assigning closures to variables

Writing closures inline

Understanding type inference

Using shorthand argument names

Working with the operator function

Using trailing closures

Protocols

Defining and using a protocol

Conforming to a protocol

Using the Codable protocol

Using the some keyword

Understanding the Basics of SwiftUI

Getting Started with the Basics of SwiftUI

Taking a Look at SwiftUI Views

Conforming to the View protocol

Using modifiers

Stacking modifiers

Using the Inspector

Displaying an Image

Using modifiers on the Image view

Resizing images

A WORD ABOUT THE iOS COORDINATE SYSTEM

Displaying a Button

Customizing the button

Adding actions

Stacking the Views

VStack

HStack

Putting on the Finishing Touches

Handling User Inputs and Custom Views

Looking at Input Views

TextField

SecureField

Toggle

Slider

Stepper

Picker

Composing Custom Views

Composing the custom view

Using the custom view

Displaying Lists of Items

Using the List View to Display Items

Customizing the rows

Adding rows programmatically

Alternative way to generate rows in a List view

Displaying the List within a NavigationView

Making the items tappable

Adding rows

Using the Identifiable protocol

Deleting rows

Editing rows

Moving rows

Displaying Sections

Displaying sections from a dictionary

Changing the style of the List view

Previewing in Light and Dark Modes

During runtime

During design time

Creating Navigation and Tabbed Applications

Creating Navigation Apps

Working with the two key views in navigation-style apps

NavigationView

NavigationLink

Navigating to a page

Navigating programmatically

Creating a news reader application

Examining the structure of the news headline feed

Fetching the JSON string

Defining the view

Displaying images remotely

Wrapping the List view in a NavigationView

Creating the details page

Creating Tabbed Applications

Using the TabView

Selecting TabViews programmatically

Formatting Your User Interface

Laying Out Views Using Stacks

VStack

Alignment

Padding

Spacer

HStack

ZStack

Using ZStack

Animating within a ZStack

Using Container Views

Form and Section

Group

Divider

Exploring with SwiftUI in More Detail

Understanding State Management in SwiftUI

Using a Property Wrapper

Maintaining State Using State Variables

Binding State Variables

Managing State from External Objects

Using the ObservableObject protocol and @Published

Using the @ObservedObject

Sharing Objects

Accessing Built-in Environment Variables

Defining your own environment keys

Using your own environment keys

Using Legacy UIKit Views and View Controllers in SwiftUI

Using UIKit in SwiftUI

Understanding the UIKit View Controller life cycle

Understanding the SwiftUI view life cycle

Working with the onAppear and onDisappear events

Instantiating properties of a view

Using initializers in a view

Using binding variables in a view

Using the UIViewRepresentable Protocol for UIKit Views

ActivityIndicator

WebView

Using the UIViewControllerRepresentable Protocol for UIKit View Controllers

Creating the ImagePickerViewController

Handling events using coordinators

Defining the methods in the Coordinator class

Using the updated ImagePickerViewController

Performing Animations and Drawings

Drawings and Special Effects

Drawing Using the Five Built-in Shapes

Rectangles

Filling a rectangle with color and drawing a border around it

Rotating the rectangle

Scaling the rectangle

Rounded rectangles

Filling a rounded rectangle with a gradient

Drawing a rounded rectangle without fill

Drawing a rounded rectangle with a border

Circles

Filling a circle with a radial gradient

Filling a circle with an angular gradient

Capsules

Ellipses

Clipping with the Basic Shapes

Drawing Custom Shapes

Drawing lines

Filling the shape

Drawing a border

Drawing an arc

Combining fill and stroke

Using Special Effects in SwiftUI

Blend modes

Blurs

Saturation

Performing Animations in SwiftUI

Understanding How to Animate

Specifying the type of animation

Repeating the animation

Stopping the animation

Performing Your Own Animation

Rotating in 2D

Rotating in 3D

Creating a Custom Progress Indicator

Indeterminate progress indicator

Determinate progress indicator

Creating a Complete Project

Understanding What the App Does

Building the Project

Creating the layouts

Defining the news sources and observable objects

Fetching the data

Displaying the news headlines

Displaying the images

Displaying the news

Creating the share sheet

Creating the preferences view

Persisting the user’s preferences

Deploying the App

The Part of Tens

Ten SwiftUI Tips and Tricks

Resuming Live Preview

Implementing Localization

Combining Text Views

Creating Custom Modifiers

Displaying Multiple Alerts

Enabling Debug Preview

Previewing Using Different Devices

Dark Mode Only Works On NavigationView

Extracting Subviews

Displaying a Context Menu

Ten Great SwiftUI Resources

Apple

SwiftUI by Example

100 Days of SwiftUI

Gosh Darn SwiftUI

SwiftUI Hub

Awesome SwiftUI

raywenderlich.com

Swift Talk

About SwiftUI

Stack Overflow

Code Snippets for Common SwiftUI Views

Content View

Using Modifiers

Image View

Text View

Button View

VStack View

HStack View

ZStack View

TextField View

SecureField View

Toggle View

Slider View

Stepper View

Picker View

List View

NavigationView View

NavigationLink View

Section View

TabView View

Form and Section Views

Rectangle View

RoundedRectangle View

Circle View

Capsule View

Ellipse View

Index. Symbols

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

R

S

T

U

V

W

X

Z

About the Author

Dedication

Author’s Acknowledgments

WILEY END USER LICENSE AGREEMENT

Отрывок из книги

In 2019, at the Apple Worldwide Developers Conference, Apple announced SwiftUI, a declarative programming framework for developing user interfaces (UIs) for iOS and macOS applications. With SwiftUI, Apple aims to modernize the iOS development experience.

There’s no doubt that SwiftUI makes it much easier and more efficient for developers to create apps, but it also means you have to learn something new. That’s where SwiftUI For Dummies comes in. This book provides you with all the essentials that you need to learn to become a successful iOS developer using SwiftUI.

.....

Figure 1-2 shows the various views in action.

FIGURE 1-2: SwiftUI is a state-driven declarative framework.

.....

Добавление нового отзыва

Комментарий Поле, отмеченное звёздочкой  — обязательно к заполнению

Отзывы и комментарии читателей

Нет рецензий. Будьте первым, кто напишет рецензию на книгу SwiftUI For Dummies
Подняться наверх