Skip to content

Latest commit

 

History

History
69 lines (35 loc) · 7.13 KB

README.md

File metadata and controls

69 lines (35 loc) · 7.13 KB

简体中文 | English

Summary

This book provides a systematic exploration of Swift + SwiftUI development process through practical examples, offering rich and practical content aimed at helping readers quickly grasp the essentials.

Divided into 14 carefully planned chapters, the book begins with fundamental concepts of SwiftUI, gradually delving into topics such as view creation, view modifiers, layout, data binding, animations, network requests, and data persistence. It provides readers with comprehensive theoretical knowledge and practical application techniques.

Suitable for developers interested in SwiftUI application development, whether beginners or experienced developers, the book offers insights into the basics of SwiftUI and practical skills. By studying this book, readers will be able to apply SwiftUI to real projects and develop excellent iOS applications.

Preface

"Elegance" is the highest praise for a programmer, and it is also my most intuitive feeling about SwiftUI.

Four years ago, at the 2019 Worldwide Developers Conference (WWDC), Apple introduced SwiftUI, a modern development framework, to the world. It was also the year I officially started learning programming.

I'm sometimes grateful for choosing to start with SwiftUI. Its declarative language features, akin to "chatting," are very friendly to beginners who are not from a development background but are eager to learn programming. Developers only need to envision the layout and elements of the UI in their minds and tell SwiftUI, which automatically and elegantly handles UI rendering and updates. Moreover, you can easily build complex user interfaces by simply arranging and combining a series of components provided by SwiftUI, such as text, images, lists, and forms.

Learning a programming language can be a tedious task for many people. You need to understand its language features, underlying code logic, data binding and sharing, and lifecycle management. However, SwiftUI seems to have a unique charm. It seamlessly integrates these complexities into an intuitive and creative development experience, allowing developers to focus more on product interaction and logic design.

SwiftUI's design goal is to simplify the user interface development process, improve development efficiency, and achieve a higher degree of code sharing across different environments. Thanks to SwiftUI's various advantages, I went from a programming novice to an independent iOS developer capable of developing and launching apps.

As SwiftUI continues to evolve, it has become the primary user interface development framework for various Apple products.

Whether it's the desktop widgets introduced in iOS 14, the lock screen widgets in iOS 16, or the new spatial computing device Apple Vision Pro and the spatial operating system visionOS introduced at WWDC 2023, their development relies on SwiftUI.

Looking back on the entire process of learning SwiftUI, I once searched the internet for a large number of related tutorials and materials, but it was difficult to find a satisfactory systematic book, which made my learning process quite challenging.

In order to quickly organize and learn SwiftUI knowledge, I attempted to publish a series of introductory and practical original articles on technical forums. Over time and with the increasing number of published articles, I unknowingly embarked on the path of technical writing.

Rather than separately explaining each core point, this book systematically explains and shares SwiftUI usage scenarios based on practical examples.

I hope that after completing each example, you will feel excited and joyful, just like when I first started learning SwiftUI, and maintain this feeling to create your own works.

Book Structure

The book is divided into 14 chapters, each covering the following main topics:

  • Chapter 1 provides a detailed introduction to the relationship between Swift and SwiftUI, development hardware and software requirements, and project file introduction. Through this chapter, you will understand the characteristics of SwiftUI in the programming process and master the basic skills of project setup.

  • Chapter 2 explains how to quickly complete a simple case using SwiftUI and introduces the usage of common components in SwiftUI. Through this chapter, you will acquire the ability to quickly build user interfaces using built-in components.

  • Chapters 3 to 8 explain the basic knowledge of SwiftUI development, including animation, view layout, code block organization, and other basic knowledge. Through 2 project case exercises, you will experience the charm of application development process and SwiftUI native development.

  • Chapters 9 to 13 explain the core functions of project development, including parameter storage, project architecture design, hardware device invocation, data persistence storage, and other core contents. This will transform your application from a static interface stack into a beautifully interactive application.

  • Chapter 14 consolidates the SwiftUI knowledge covered in this book through a practical example and, combined with the actual project process, develops an application that can be launched and operated.

Target Audience

This book can serve as an advanced reading material for junior iOS developers. While introducing the declarative syntax style of SwiftUI, it explains how to quickly develop iOS applications using SwiftUI through practical examples.

Errata and Feedback

There may be some errors or unclear parts in the book. While asking for your understanding, I also welcome corrections and feedback. All the examples in the book can be downloaded from GitHub (https://github.com/RicardoWesleyli/SwiftUIDeveloper.git). If you have any valuable ideas and suggestions, you can also directly send an email to 16620164429@163.com. Looking forward to meeting you.

Author Bio

Li Zhiwei, an independent iOS developer, senior product manager, signed author of the Rare Earth Juejin technical community, and Huawei Harmony KOL. With 6 years of B-end SaaS product experience, he has been responsible for the product planning of data intelligence projects for domestic Top 3 listed companies from scratch. He independently developed and launched applications such as "Do Not Speak Notes" and "Linkcard" and published books such as "SwiftUI Complete Development." He won the "Kesong" AI Hackathon Big Language Model Application Innovation Challenge.

Acknowledgments

Thanks to Miss Jiang Peiqi, who has always supported me. Your Mr. Li Zhiwei has finished writing this book~

Thanks to Mr. Fu Daokun and Ms. Shan Ruiting, editors of the People's Posts and Telecommunications Press, for the encouragement and help they gave me during the writing process, which enabled me to complete all the manuscripts smoothly.

Finally, thanks to my parents, Qi Qi's parents, and my sister who is about to enter the workplace, as well as Mr. Zhang Yong, Mr. Zeng Lusi, Mr. Ye Yongcheng, and Mr. Xu Zhi, who have guided me on the road of life. Thank you for your support and help, lighting up the future path for me.

I dedicate this book to my dearest family and many friends who love iOS!