
Hacking with Swift - Swift Developer News
596 FOLLOWERS
A blog shares News, tips, and tutorials from Hacking with Swift. Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and Mario Kart world champion.
Hacking with Swift - Swift Developer News
1M ago
Bring your apps into the age of AI with AppIntents, image playgrounds, and more ..read more
Hacking with Swift - Swift Developer News
5M ago
Your complete Swift journey: from first job to leadership, all in one powerful program ..read more
Hacking with Swift - Swift Developer News
6M ago
Tired of making mistakes while learning to code? You're not alone ..read more
Hacking with Swift - Swift Developer News
8M ago
This is another good year for SwiftUI, with another batch of scrollview improvements, some welcome macOS features, remarkable control over text rendering, and more – the team at Apple have a lot to be proud of, and many developers will breathe a sigh of relief as API such as fine-grained subview control is now public for all of us to use.
But there's also one major architectural change you need to be aware of, so let's start with that…
View is now on the main actor
For a long time, the View protocol looked a bit like this:
protocol View {
@MainActor var body: some View
}
That meant code ..read more
Hacking with Swift - Swift Developer News
9M ago
2024 is Swift's 10th anniversary, and for the last five of those years we've had no major-version Swift updates – literally half of Swift's life has been 5.0 through to 5.10.
This is more common than you might think. In fact, several major programming languages have some kind of release that takes significantly longer than all others: Python 3 took years to arrive, PHP 6 took so long the team bailed out and jumped straight to PHP 7, and Perl 6 dragged on so much that it ended up evolving into a different language called Raku.
Swift last had major breaking changes back in Swift 3, but when enab ..read more
Hacking with Swift - Swift Developer News
9M ago
WWDC24 is here, which means all-new upgrades for Swift, SwiftUI, SwiftData, and more. If you want to stay ahead of the pack, you'll be pleased to know that all Hacking with Swift books and bundles are half price for WWDC – including my all-new Everything Pack, which means you can buy every book I've ever published at one unbeatable price.
All Hacking with Swift books come with:
A lifetime free Swift update policy, meaning that you get updates for the books you purchase at no cost, protecting your investment.
A 30-day No Questions Asked refund policy. Not learning fast enough? Did life take a ..read more
Hacking with Swift - Swift Developer News
9M ago
A huge swathe of features, changes, and adjustments are planned Swift 6, but before then we have Swift 5.10: an interim release mostly focused on fixing up data race checking at compile time, hopefully clearing the decks for Swift 6.
Let's take a look at what's changing…
Tip: You can also download this as an Xcode playground if you want to try the code samples yourself.
Data races are now clearly diagnosed
Swift concurrency was introduced back in Swift 5.5, but had a bit of a rocky adoption both in Apple's own frameworks and our own projects. However, with Swift 5.10 the team made a rather d ..read more
Hacking with Swift - Swift Developer News
9M ago
Swift's result builders are a powerful language feature that let us create domain-specific languages right inside our Swift code. With a little thinking, this means we can actually create whole websites in Swift, with our code automatically being converted to valid, accessible Swift, and we can even sprinkle in a little SwiftUI magic to complete the effect.
Let's get to it…
Starting from scratch
For over 30 years, HTML has been a great language for describing the structure of web pages.
For example, we can write HTML like this:
<h1>Wise words</h1>
<p>"If you don't take risks ..read more
Hacking with Swift - Swift Developer News
1y ago
We're now just a few days away from the launch of Apple Vision Pro, and like many other developers I've built and shipped a visionOS app ready for launch day.
Doing this took quite a few steps, so I wanted to walk you through the whole process: coming up with an idea, building a prototype, visiting Apple's Vision Pro labs, fixing problems, and more. Hopefully this is useful to anyone else who is thinking about shipping for visionOS!
If you have an Apple Vision Pro, you can download the app here
There's a press kit with screenshot, text, and an app preview video here
About the app
The app I b ..read more