SwiftUI Cookbook A Guide for Building Beautiful and Interactive SwiftUI Apps

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 Swi...

Descripción completa

Detalles Bibliográficos
Otros Autores: Catalan, Juan C., author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham, England : Packt Publishing Ltd [2023]
Edición:Third edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009790332506719
Tabla de Contenidos:
  • 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
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using images
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Adding buttons and navigating with them
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Beyond buttons: using advanced pickers
  • Getting ready
  • How to do it…
  • How it works…
  • Applying groups of styles using ViewModifier
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Separating presentation from content with ViewBuilder
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Simple graphics using SF Symbols
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Integrating UIKit into SwiftUI: the best of both worlds
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Adding SwiftUI to a legacy UIKit app
  • Getting ready
  • How to do it…
  • How it works…
  • Exploring more views and controls
  • Getting ready
  • How to do it…
  • How it works…
  • Chapter 2: Displaying Scrollable Content with Lists and Scroll Views
  • Technical requirements
  • Using scroll views
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Creating a list of static items
  • Getting ready
  • How to do it…
  • How it works…
  • Using custom rows in a list
  • Getting ready
  • How to do it…
  • How it works…
  • Adding rows to a list
  • Getting ready
  • How to do it…
  • How it works…
  • Deleting rows from a list
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Creating an editable List view
  • Getting ready
  • How to do it…
  • How it works….
  • There's more…
  • Moving the rows in a List view
  • Getting ready
  • How to do it…
  • How it works…
  • Adding sections to a list
  • Getting ready
  • How to do it…
  • How it works…
  • Creating editable collections
  • Getting ready
  • How to do it…
  • How it works…
  • Using searchable lists
  • Getting ready
  • How to do it…
  • How it works…
  • Using searchable lists with scopes
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 3: Exploring Advanced Components
  • Technical requirements
  • Using LazyHStack and LazyVStack
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Displaying tabular content with LazyHGrid and LazyVGrid
  • Getting ready
  • How to do it…
  • How it works…
  • Scrolling programmatically
  • Getting ready
  • How to do it…
  • How it works…
  • Displaying hierarchical content in expanding lists
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Using disclosure groups to hide and show content
  • Getting ready
  • How to do it…
  • How it works…
  • Creating SwiftUI widgets
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 4: Viewing while Building with SwiftUI Preview in Xcode 15
  • Technical requirements
  • Using the live preview canvas in Xcode15
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Previewing a view in a NavigationStack
  • Getting ready
  • How to do it…
  • How it works…
  • Previewing a view with different traits
  • Getting ready
  • How to do it…
  • How it works…
  • Previewing a view on different devices
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using previews in UIKit
  • Getting ready
  • How to do it…
  • How it works…
  • Using mock data for previews
  • Getting ready
  • How to do it…
  • How it works…
  • There's more...
  • Chapter 5: Creating New Components and Grouping Views with Container Views.
  • Technical requirements
  • Showing and hiding sections in forms
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • See also
  • Disabling and enabling items in forms
  • Getting ready
  • How to do it…
  • How it works…
  • Filling out forms easily using Focus and Submit
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • See also
  • Creating multi-column lists with Table
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • See also
  • Using Grid, a powerful two-dimensional layout
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Learn more on Discord
  • Chapter 6: Presenting Views Modally
  • Technical requirements
  • Presenting alerts
  • Getting ready
  • How to do it…
  • How it works…
  • iOS 15 and later
  • iOS 13 and 14
  • See also
  • Adding actions to alert buttons
  • Getting ready
  • How to do it…
  • How it works…
  • Presenting confirmation dialogs
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Presenting new views using sheets and full-screen covers
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Displaying popovers
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Creating context menus
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 7: Navigation Containers
  • Technical requirements
  • Simple navigation with NavigationStack
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Typed data-driven navigation with NavigationStack
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Untyped data-driven navigation with NavigationStack
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Multi-column navigation with NavigationSplitView
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Navigating between multiple views with TabView
  • Getting ready.
  • How to do it…
  • How it works…
  • There's more…
  • See also
  • Programmatically switching tabs on a TabView
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 8: Drawing with SwiftUI
  • Technical requirements
  • Using SwiftUI's built-in shapes
  • Getting ready
  • How to do it…
  • How it works…
  • Drawing a custom shape
  • Getting ready
  • How to do it…
  • How it works…
  • Drawing a curved custom shape
  • Getting ready
  • How to do it…
  • How it works…
  • Drawing using the Canvas API
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Implementing a progress ring
  • Getting ready
  • How to do it…
  • How it works…
  • Implementing a Tic-Tac-Toe game in SwiftUI
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Rendering a gradient view in SwiftUI
  • Getting ready
  • How to do it…
  • How it works…
  • Chapter 9: Animating with SwiftUI
  • Technical requirements
  • Creating basic animations
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • See also
  • Transforming shapes
  • Getting ready
  • How to do it…
  • How it works…
  • Creating a banner with a spring animation
  • Getting ready
  • How to do it…
  • How it works…
  • Applying a delay to an animation view modifier to create a sequence of animations
  • Getting ready
  • How to do it…
  • How it works…
  • Applying a delay to a withAnimation function to create a sequence of animations
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Applying multiple animations to a view
  • Getting ready
  • How to do it…
  • How it works…
  • Chained animations with PhaseAnimator
  • Getting ready
  • How to do it…
  • How it works…
  • Custom animations with KeyframeAnimator
  • Getting ready
  • How to do it…
  • How it works…
  • Creating custom view transitions
  • Getting ready
  • How to do it…
  • How it works….
  • Creating a hero view transition with .matchedGeometryEffect
  • Getting ready
  • How to do it…
  • How it works…
  • Implementing a stretchable header in SwiftUI
  • Getting ready
  • How to do it…
  • How it works…
  • Implementing a swipeable stack of cards in SwiftUI
  • Getting ready
  • How to do it…
  • How it works…
  • Chapter 10: Driving SwiftUI with Data
  • Technical requirements
  • Using @State to drive a view's behavior
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using @Binding to pass a state variable to child views
  • Getting ready
  • How to do it…
  • How it works…
  • Implementing a CoreLocation wrapper as@ObservedObject
  • Getting ready
  • How to do it…
  • How it works…
  • Using @StateObject to preserve the model's life cycle
  • Getting ready
  • How to do it…
  • How it works...
  • Sharing state objects with multiple Views using@EnvironmentObject
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Using Observation to manage model data
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Chapter 11: Driving SwiftUI with Combine
  • Technical requirements
  • Introducing Combine in a SwiftUI project
  • Getting ready
  • How to do it…
  • How it works…
  • Publishers in Combine
  • Subscriptions in Combine
  • See also
  • Managing the memory in Combine to build a timer app
  • Getting ready
  • How to do it…
  • How it works…
  • See also
  • Validating a form using Combine
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Fetching remote data using Combine and visualizing it in SwiftUI
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Debugging an app based on Combine
  • Getting ready
  • How to do it…
  • How it works…
  • There's more…
  • Unit testing an app based on Combine
  • Getting ready
  • How to do it…
  • How it works….
  • Chapter 12: SwiftUI Concurrency with async await.