An iOS Developer's Guide to SwiftUI: Design and build beautiful apps quickly and easily with minimum code and harness the power of SwiftUI
معرفی کتاب «An iOS Developer's Guide to SwiftUI: Design and build beautiful apps quickly and easily with minimum code and harness the power of SwiftUI» نوشتهٔ Michele Fadda، منتشرشده توسط نشر Packt Publishing در سال 2024. این کتاب در 5 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است.
Design and build beautiful apps quickly and easily with minimum code This book teaches you about SwiftUI, a multiplatform declarative user interface framework that can be used to program all Apple devices, currently including Mac, iPhone, iPad, Apple TV, Apple Watch, and Vision Pro. Who this book is for This book is aimed at iOS developers who want to expand their knowledge of adding SwiftUI to their bag of tools and want to progress further in their professional careers. What this book covers Chapter 1, Exploring the Environment – Xcode, Playgrounds, and SwiftUI, is an introduction to the software tools used when working with SwiftUI, the new exciting, efficient, and simple-to-use Apple framework for user interfaces. Chapter 2, Adding Basic UI Elements and Designing Layouts, shows you how to properly refactor view code. Then, it describes how to combine basic views with stacks and control their visual layout. Chapter 3, Adding Interactivity to a SwiftUI View, discusses the conversion from static to dynamic SwiftUI views, with a focus on responsive design, including taps and gestures. This chapter explores mechanisms to enable views to be made interactive. It covers topics such as view creation, interactivity enhancement, property wrappers, limitations of @State, bidirectional bindings, subviews, and the use of @ObservableObject and @StateObject classes. Chapter 4, Iterating Views, Scroll Views, FocusState, Lists, and Scroll View Reader, focuses on showing lists in SwiftUI, through scrollable views such as scroll views or lists. It shows how to handle the visibility of the iOS system keyboard. It introduces NavigationView for view titles and covers iterating views, @ViewBuilder, scroll views, @FocusState for keyboard control, lists, and ScrollViewReader for element positioning within lists or scroll views. Chapter 5, The Art of Displaying Grids, moves on to creating grid structures in SwiftUI. Topics covered include displaying grids in iOS, the grid view, lazy grids, using GridItem for layout control, conditional view formatting, and responding design to device orientation changes. Cover Title Page Copyright and Credits Contributors Table of Contents Preface Part 1: Simple Views Chapter 1: Exploring the Environment – Xcode, Playgrounds, and SwiftUI Technical requirements Exploring SwiftUI with Xcode A brief tour of Xcode Your first SwiftUI project Creating a SwiftUI project Creating a multi-platform project Previews and the simulator Playgrounds The app submission process Certificates Mobile provisioning profiles The application submission process Summary Chapter 2: Adding Basic UI Elements and Designing Layouts Technical requirements Reusing views code More about Text Managing space in SwiftUI The padding modifier The .frame modifier The .alignment modifier The Spacer The Divider Digging deeper into stacks Overview of stacks HStack ZStack Summary Chapter 3: Adding Interactivity to a SwiftUI View Technical requirements Passing values at view creation Responding to a button tap Property wrappers Limitations of @State Changing a view appearance dynamically using modifiers Bidirectional binding with Picker Final notes on Subviews and @Binding, Classes, and @ObservableObject Summary Part 2: Scrollable Views Chapter 4: Iterating Views, Scroll Views, FocusState, Lists, and Scroll View Reader Technical requirements Iterating views Hiding or showing the keyboard in a form using @FocusState Scroll views Controlling scrolling programmatically using ScrollViewReader Summary Chapter 5: The Art of Displaying Grids Technical requirements Displaying grids in iOS The Grid view Creating a simple static grid Lazy grids Using GridItem to control the layout of LazyVGrid Scrolling horizontally and sizing the grid automatically Conditional formatting of a view Reacting to device rotation Summary Part 3: SwiftUI Navigation Chapter 6: Tab Bars and Modal View Presentation Technical requirements Creating a standard tab bar Creating custom tab bars Adapting your code to different versions of the operating system The hitchhiker’s guide to modal navigation Showing a modal sheet Showing alerts The popover Presentation detents Summary Chapter 7: All About Navigation Technical requirements Navigation as a concept in iOS and other platforms Showing a tab bar title with NavigationView Presenting views with NavigationLink (pre-iOS 16) Adding buttons to NavigationView and activating navigation programmatically Using navigationDestination with NavigationStack Using NavigationPath to control the navigation stack NavigationSplitView – multicolumn navigation Direct navigation stack manipulation with NavigationPath Saving and loading the navigation stack Summary Part 4: Graphics and Animation Chapter 8: Creating Custom Graphics Technical requirements Creating custom modifiers Drawing with the Canvas Using CALayers in SwiftUI Custom layout Summary Chapter 9: An Introduction to Animations in SwiftUI Technical requirements Gestures Basic gestures Creating implicit animations Explicit SwiftUI animations Transitions The .transition() modifier The matchedGeometryEffect modifier Summary Part 5: App Architecture Chapter 10: App Architecture and SwiftUI Part I: Practical Tools Diagrams Dependency inversion Clean Architecture Different ways to decouple Initializer injection Method injection Property injection A matter of state iOS 17 changes in state management Other ways to chop your code Summary Chapter 11: App Architecture and SwiftUI Part II – the Theory Keeping it light enough Conflict and the role of the architect What good software architecture is and what it is not Don’t be shy; ask an expert! The origin of software patterns Agency theory and bad architecture Clean Architecture TCA, The Composable Architecture Summary Part 6: Beyond Basics Chapter 12: Persistence with Core Data What is persistency? What is Core Data? Understanding Core Data framework classes Using Core Data with SwiftUI Creating a Core Data project Working with the data model file Core Data migrations The SQLite data file CloudKit Summary Chapter 13: Modern Structured Concurrency A brief introduction to concurrency Understanding traditional concurrency mechanisms Threads Callbacks and event loops GCD What is structured concurrency? Using the async/await syntax Understanding tasks Task groups Asynchronous streams Actors MainActor Bridging old GCD and structured concurrency Summary Chapter 14: An Introduction to SwiftData Technical requirements Understanding the differences between SwiftData and Core Data SwiftData and SwiftUI Exploring changes in the binding mechanisms Creating a data model Understanding relationships in SwiftData One-to-one relationships One-to-many relationships Many-to-one relationships Many-to-many relationships Cascading deletion rules Fetching data Filtering data with predicates Summary Chapter 15: Consuming REST Services in SwiftUI Technical requirements An overview of REST Ports Understanding REST requests in Swift Codable, Encodable, and Decodable protocols Using URLSession Implementing HTTP methods Setting headers Handling errors URLProtocol Summary Chapter 16: Exploring the Apple Vision Pro Technical requirements Tools for visionOS development An overview of Unity and RealityKit First steps with visionOS development Summary Get started with SwiftUI and develop real-world, beautiful, and robust iOS apps faster than ever using the declarative approach with key images printed in color SwiftUI has become an integral part of app development for Apple Platforms. With SwiftUI, you can develop user interfaces by just defining the UI design using Swift code. SwiftUI uses a declarative based programming approach allowing a developer to design the UI of applications for multiple Apple platforms, ranging from mobile phones, watches to computers by declaring what the app should look like and what it should do, letting the operating system do the heavy lifting. The book provides a hands-on approach to learn this framework and the associated techniques that will teach you more about SwiftUI, improving your skills in mobile development in less time. You will begin by learning basic concepts in SwiftUI by creating views and modifiers using SwiftUI, progressing gradually towards more complex and responsive user interfaces and advanced techniques, allowing you to confidently build complex apps. You will learn how to use SwiftUI completely and learn about asynchronous programming and architecture allowing you to design efficient, modern, and well-structured apps. Finally, youll gain knowledge on how to integrate UIkit and SwiftUI and how to run tests for a SwiftUI application. By the end of the book, you will be confident to build complex applications using SwiftUI professionally. This book is for iOS developers interested in SwiftUI, software developers who have had a few years of iOS experience with UIkit and intend to work with SwiftUI. They will be able to learn this framework in depth with this practical guide. The audience will also include mobile consultants and engineers. It may also be of interest to newcomers considering a career in mobile software development with iOS. They are familiar with Swift, UIkit, XCode, and Asynchronous Programming. SwiftUI has transformed app development across Apple Platforms, offering developers the power to build seamless user interfaces by just defining the UI design through intuitive Swift code. This book explores SwiftUI's revolutionary declarative programming approach to assist you in designing UI for Apple devices, ranging from iPhones to Macs, by declaring what the app should look like and what it should do, leaving the heavy lifting to the operating system.With a hands-on approach, the book immerses you in the fundamentals of SwiftUI and goes on to cover SwiftUI parts that are omitted by most introductory guides. Starting with creating views and modifiers, you'll progress to more intricate and responsive user interfaces and advanced techniques, gradually working toward building complex apps. Further, this book focuses on the new features in asynchronous programming and architecture patterns to design efficient, modern, and well-structured apps. Finally, you'll explore the integration of UIkit and SwiftUI and how to run tests for a SwiftUI application.By the end of the book, you'll have gained the confidence to harness the full potential of SwiftUI to build professional-grade applications.
دانلود کتاب An iOS Developer's Guide to SwiftUI: Design and build beautiful apps quickly and easily with minimum code and harness the power of SwiftUI