Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Swift 6
  • Table Of Contents Toc
Mastering Swift 6

Mastering Swift 6 - Seventh Edition

By : Jon Hoffman
5 (1)
close
close
Mastering Swift 6

Mastering Swift 6

5 (1)
By: Jon Hoffman

Overview of this book

This seventh edition of Mastering Swift 6 is your ultimate guide to harnessing the full power of Swift. Whether you're aiming to optimize the performance of your applications or looking to explore the exciting new features in Swift 6.2, this book has you covered. The author distills his 28 years of experience in the Engineering and IT fields to help you dive deep into advanced concepts and techniques, such as concurrency, memory management, and Generics, all essential for creating high-performance applications. The chapters take you on a flexible journey, covering Swift 6.2’s newest features alongside advanced programming topics such as reflection, concurrency, and Generics. Packed with best practices, testing strategies, and modern programming techniques, this book equips you with the skills to develop scalable, high-performance applications with confidence. Whether you're looking to stay competitive or simply want to excel in Swift 6, this book provides the tools and knowledge you need to succeed.
Table of Contents (25 chapters)
close
close
23
Other Books You May Enjoy
24
Index

Executing code on the main queue function

The DispatchQueue.main.async(execute:) function will execute code on the application’s main queue. We generally use this function when we want to update the UI or perform tasks that require changes to the UI.

The main queue is automatically created for the main thread when the application starts. This main queue is a serial queue; therefore, items in this queue are executed one at a time, in the order in which they were submitted. We will generally want to avoid using this queue unless we have a need to update the user interface from a background thread so that we do not block the main thread, which may make the user interface unresponsive.

The following example shows how we would use this function. For this code, it is assumed that an extension was used to add a method to the UIImage type that will resize the image:

let squeue = DispatchQueue(label: "squeue.hoffman.jon")
squeue.async {
    let resizedImage = image...
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
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon