Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Swift 6

You're reading from   Mastering Swift 6 Modern programming techniques for high-performance apps in Swift 6.2

Arrow left icon
Product type Paperback
Published in Aug 2025
Publisher Packt
ISBN-13 9781836203698
Length 378 pages
Edition 7th Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jon Hoffman Jon Hoffman
Author Profile Icon Jon Hoffman
Jon Hoffman
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. The Evolution of Swift FREE CHAPTER 2. Closures and Result Builders 3. Protocols and Protocol Extensions 4. Generics 5. Value and Reference Types 6. Enumerations 7. Reflection 8. Error Handling and Availability 9. Regular Expressions 10. Custom Subscripting 11. Property Observers and Wrappers 12. Dynamic Member Lookup and Key Paths 13. Grand Central Dispatch 14. Structured Concurrency 15. Memory Management 16. Advanced and Custom Operators 17. Access Controls 18. Swift Testing 19. Object-Oriented Programming 20. Protocol-Oriented Programming 21. Functional Programming with Swift 22. Unlock Your Book’s Exclusive Benefits 23. Other Books You May Enjoy
24. Index

Bits and bytes

A computer operates using binary digits, commonly known as bits. These bits hold only two possible values: 0 or 1, representing the states of on or off in electrical circuit terms. While bits are tiny and don’t have much use on their own except for indicating true/false (Boolean) flags, they become useful when we group them together into sets of 4, 8, 16, 32, or 64 to create data that computers can understand.

In computer terminology, a byte comprises 8 bits. An example of a byte with the value of 42 is depicted as follows, with the least significant bit positioned to the right and the most significant bit to the left:

Figure 16.1: The number 42 represented in bits

Figure 16.1: The number 42 represented in bits

In Figure 16.1, the top row illustrates the state of each bit, whether it’s off (0) or on (1), within an 8-bit byte. The second row depicts the numerical value assigned to each bit within the byte. In this instance, the bits associated with the values 32, 8, and 2 are set, giving...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Swift 6
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 $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon