My Account Log in

1 option

SwiftUI Cookbook : A Guide for Building Beautiful and Interactive SwiftUI Apps / Juan C. Catalan.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Catalan, Juan C., author.
Language:
English
Subjects (All):
Application software--Development.
Application software.
Swift (Computer program language).
Physical Description:
1 online resource (799 pages)
Edition:
Third edition.
Place of Publication:
Birmingham, England : Packt Publishing Ltd., [2023]
Summary:
SwiftUI is the modern way to build user interfaces for iOS, macOS, and watchOS. It provides a declarative and intuitive way to create beautiful and interactive user interfaces. The new edition of this comprehensive cookbook includes a fully updated repository for SwiftUI 5, iOS 17, Xcode 15, and Swift 5.9. With this arsenal, it teaches you everything you need to know to build beautiful and interactive user interfaces with SwiftUI 5, from the basics to advanced topics like custom modifiers, animations, and state management. In this new edition, you will dive into the world of creating powerful data visualizations with a new chapter on Swift Charts and how to seamlessly integrate charts into your SwiftUI apps. Further, you will be able to unleash your creativity with advanced controls, including multi-column tables and two-dimensional layouts. You can explore new modifiers for text, images, and shapes that give you more control over the appearance of your views. You will learn how to develop apps for multiple platforms, including iOS, macOS, watchOS, and more. With expert insights, real-world examples, and a recipe-based approach, you’ll be equipped to build remarkable SwiftUI apps that stand out in today’s competitive market.
Contents:
Cover
Copyright
Contributors
Table of Contents
Preface
Chapter 1: Using the Basic SwiftUI Viewsand Controls
Technical requirements
What's new in SwiftUI
Laying out components
Getting ready
How to do it…
How it works…
There's more…
Dealing with text
See also
Using images
Adding buttons and navigating with them
Beyond buttons: using advanced pickers
Applying groups of styles using ViewModifier
Separating presentation from content with ViewBuilder
Simple graphics using SF Symbols
Integrating UIKit into SwiftUI: the best of both worlds
Adding SwiftUI to a legacy UIKit app
Exploring more views and controls
Chapter 2: Displaying Scrollable Content with Lists and Scroll Views
Using scroll views
Creating a list of static items
Using custom rows in a list
Adding rows to a list
Deleting rows from a list
Creating an editable List view
How it works….
There's more…
Moving the rows in a List view
Adding sections to a list
Creating editable collections
Using searchable lists
Using searchable lists with scopes
Chapter 3: Exploring Advanced Components
Using LazyHStack and LazyVStack
Displaying tabular content with LazyHGrid and LazyVGrid
Scrolling programmatically
Displaying hierarchical content in expanding lists
Using disclosure groups to hide and show content
Creating SwiftUI widgets
Chapter 4: Viewing while Building with SwiftUI Preview in Xcode 15
Using the live preview canvas in Xcode15
Previewing a view in a NavigationStack
Previewing a view with different traits
Previewing a view on different devices
Using previews in UIKit
Using mock data for previews
There's more...
Chapter 5: Creating New Components and Grouping Views with Container Views.
Technical requirements
Showing and hiding sections in forms
Disabling and enabling items in forms
Filling out forms easily using Focus and Submit
Creating multi-column lists with Table
Using Grid, a powerful two-dimensional layout
Learn more on Discord
Chapter 6: Presenting Views Modally
Presenting alerts
iOS 15 and later
iOS 13 and 14
Adding actions to alert buttons
Presenting confirmation dialogs
Presenting new views using sheets and full-screen covers
Displaying popovers
Creating context menus
Chapter 7: Navigation Containers
Simple navigation with NavigationStack
Typed data-driven navigation with NavigationStack
Untyped data-driven navigation with NavigationStack
Multi-column navigation with NavigationSplitView
Navigating between multiple views with TabView
Getting ready.
How to do it…
Programmatically switching tabs on a TabView
Chapter 8: Drawing with SwiftUI
Using SwiftUI's built-in shapes
Drawing a custom shape
Drawing a curved custom shape
Drawing using the Canvas API
Implementing a progress ring
Implementing a Tic-Tac-Toe game in SwiftUI
Rendering a gradient view in SwiftUI
Chapter 9: Animating with SwiftUI
Creating basic animations
Transforming shapes
Creating a banner with a spring animation
Applying a delay to an animation view modifier to create a sequence of animations
Applying a delay to a withAnimation function to create a sequence of animations
Applying multiple animations to a view
Chained animations with PhaseAnimator
Custom animations with KeyframeAnimator
Creating custom view transitions
Creating a hero view transition with .matchedGeometryEffect
Implementing a stretchable header in SwiftUI
Implementing a swipeable stack of cards in SwiftUI
Chapter 10: Driving SwiftUI with Data
Using @State to drive a view's behavior
Using @Binding to pass a state variable to child views
Implementing a CoreLocation wrapper as@ObservedObject
Using @StateObject to preserve the model's life cycle
How it works...
Sharing state objects with multiple Views using@EnvironmentObject
Using Observation to manage model data
Chapter 11: Driving SwiftUI with Combine
Introducing Combine in a SwiftUI project
Publishers in Combine
Subscriptions in Combine
Managing the memory in Combine to build a timer app
Validating a form using Combine
Fetching remote data using Combine and visualizing it in SwiftUI
Debugging an app based on Combine
Unit testing an app based on Combine
Chapter 12: SwiftUI Concurrency with async await.
Notes:
Includes index.
Description based on print version record.
ISBN:
9781805129844
1805129848
OCLC:
1416369443

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account