Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
An iOS Developer's Guide to SwiftUI

You're reading from  An iOS Developer's Guide to SwiftUI

Product type Book
Published in May 2024
Publisher Packt
ISBN-13 9781801813624
Pages 446 pages
Edition 1st Edition
Languages
Author (1):
Michele Fadda Michele Fadda
Profile icon Michele Fadda

Table of Contents (25) Chapters

Preface 1. Part 1: Simple Views
2. Chapter 1: Exploring the Environment – Xcode, Playgrounds, and SwiftUI 3. Chapter 2: Adding Basic UI Elements and Designing Layouts 4. Chapter 3: Adding Interactivity to a SwiftUI View 5. Part 2: Scrollable Views
6. Chapter 4: Iterating Views, Scroll Views, FocusState, Lists, and Scroll View Reader 7. Chapter 5: The Art of Displaying Grids 8. Part 3: SwiftUI Navigation
9. Chapter 6: Tab Bars and Modal View Presentation 10. Chapter 7: All About Navigation 11. Part 4: Graphics and Animation
12. Chapter 8: Creating Custom Graphics 13. Chapter 9: An Introduction to Animations in SwiftUI 14. Part 5: App Architecture
15. Chapter 10: App Architecture and SwiftUI Part I: Practical Tools 16. Chapter 11: App Architecture and SwiftUI Part II – the Theory 17. Part 6: Beyond Basics
18. Chapter 12: Persistence with Core Data 19. Chapter 13: Modern Structured Concurrency 20. Chapter 14: An Introduction to SwiftData 21. Chapter 15: Consuming REST Services in SwiftUI 22. Chapter 16: Exploring the Apple Vision Pro 23. Index 24. Other Books You May Enjoy

Creating custom tab bars

Sometimes, you must implement your take on a tab bar because what you want cannot be created with the standard one; for example, you want something that resembles a tab bar but has custom graphical requirements and is in a different position on the screen. In this section, you will also learn that going for a custom approach requires much more work than the “standard Apple way” of doing things, besides having other drawbacks.

For our customized tab bar, we want it to have round corners, to be drawn in a frame, with a shadow, and to show the title in a different bright color, say in red and in bold, when a tab is selected. We also want it to sit at the top of the user screen rather than at the bottom.

To begin, it is essential to establish the necessary information for presenting a tab, which includes an image representing the non-selected state, an image representing the selected state, and a title. For the sake of simplicity, we will limit...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}