Paul Hudson Profile Banner
Paul Hudson Profile
Paul Hudson

@twostraws

Followers
97,528
Following
255
Media
4,751
Statuses
58,759

Learning and sharing at Hacking with Swift, author of Swift, SwiftUI, and iOS books @twostraws @mastodon .social

Bath, UK
Joined July 2009
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@twostraws
Paul Hudson
4 years
Learn SwiftUI for free: Find solutions to common Swift problems: Watch my free Swift videos: Download my free iOS app: Subscribe to Hacking with Swift+:
Tweet media one
180
234
1K
@twostraws
Paul Hudson
2 months
The most “European mind cannot comprehend this” thing around 🇺🇸
Tweet media one
826
801
20K
@twostraws
Paul Hudson
3 years
My M1 MacBook Pro arrived today. Chances are you have various questions, but I think a whole lot is summed up in this 50-second video. (Alt text, because Twitter still doesn't make this easy: Xcode 12.3 beta unzips in 5 minutes on an M1, vs 13 minutes 22 seconds on an Intel i9)
222
1K
7K
@twostraws
Paul Hudson
11 months
So, I tried Vision Pro, and no matter how good you think it is… it's better. Just astonishing immersion backed by mind-boggling audio fidelity, and the UI has been polished and polished until it's almost invisible. Zero friction; I was a confident user in minutes. #WWDC23
79
427
5K
@twostraws
Paul Hudson
4 years
simctl is a great tool for controlling the iOS simulator, but I find it a little hard to use. So, I wrote Control Room: a SwiftUI macOS that lets you manipulate simulator settings easily. I'd be happy to post the code on GitHub if other folks would find it useful.
153
690
4K
@twostraws
Paul Hudson
3 years
Normalize saying "I don't know." Normalize saying "I was wrong." Normalize saying "I just learned that." It's not that hard, folks.
44
783
4K
@twostraws
Paul Hudson
3 years
You know #AppleEvent is getting close when Twitter activates a custom ❤️ animation – like this tweet to see it for yourself!
Tweet media one
23
79
3K
@twostraws
Paul Hudson
3 years
Developers: "I need a quiet environment to work." Also developers: ✅ World's loudest mechanical keyboard ✅ Twitter open 24/7 ✅ iPhone, iPad, and Apple Watch with notifications buzzing every 30 seconds
90
260
3K
@twostraws
Paul Hudson
4 years
Next time you're hiring a senior iOS developer, how about you skip the algorithmic whiteboard questions and instead hand them an iPhone with VoiceOver on and ask them to turn it off – a one-minute test to tell you who has actually bothered to handle accessibility in their apps.
52
331
2K
@twostraws
Paul Hudson
2 years
But how? What kind of impressive code could deliver a 2-3x speed boost? “Redesigned using native components.” I’ve been building native apps for ~12 years now, all the time having folks try to tell me web-based technologies will beat native. They continue to be wrong.
@NotionHQ
Notion
2 years
Your mobile app just got a (well-deserved 😅) upgrade. It’s now: - faster — 2× on iOS, 3× on Android - redesigned using native components - easier to navigate, with a new home tab And we’re just getting started!
218
520
6K
55
402
2K
@twostraws
Paul Hudson
3 years
A love letter to Xcode 13, in 5 GIFs. Part one: it will automatically import frameworks as needed. #WWDC21
32
462
2K
@twostraws
Paul Hudson
2 years
For folks coming to today’s Developer Center open house at #WWDC22 , coffee and donuts from Caffè Macs 😋
Tweet media one
28
126
2K
@twostraws
Paul Hudson
2 years
Pro tip for all you iOS developers: did you know Swift comes with built-in support for translating English into French? 🇬🇧🇫🇷
Tweet media one
75
123
2K
@twostraws
Paul Hudson
1 year
I'm trying to gauge how much of the iOS / Swift community moved to Mastodon. I crosspost everything there ( @twostraws @mastodon .social) but: - If you're reading this on Twitter could you please hit Like on this - If you're reading on Mastodon press Favorite there Thank you! 🙇‍♂️
35
15
2K
@twostraws
Paul Hudson
2 years
It’s been a difficult few weeks at the Hudson household, and I’m sad to say that today my father passed away. He was a good man, and loved his family very much - he’ll be missed by all of us ❤️
Tweet media one
428
7
2K
@twostraws
Paul Hudson
4 years
Neat! This tweet uses the #AppleEvent hashflag, so if you like it you get a cute little animation. (Go on, try it! 😂)
12
56
2K
@twostraws
Paul Hudson
5 years
It sucks watching Reddit dump on someone who tried writing their first blog post about coding. I don't care what mistakes you made or however many ways you can improve, hitting Publish and making something public takes guts and should be applauded.
Tweet media one
32
224
2K
@twostraws
Paul Hudson
3 years
🔥 BOOM! Control Room 2.0 is out now, providing a fantastic, free way to control the iOS simulator: - Record movies and GIFs of your app - Use the menu bar icon or its global keyboard shortcuts - Edit UserDefaults with one click - New Big Sur design
65
284
2K
@twostraws
Paul Hudson
11 months
Apologies for the interruption on r/swift, but Reddit needs a change in management. See for the huge number of other subreddits going dark in support of @ChristianSelig 💪
Tweet media one
19
88
2K
@twostraws
Paul Hudson
4 years
My daughter @PinkerStraws started learning coding five years ago, using Scratch, Python, and Swift. Today she joined me in delivering the opening keynote at @UIKonf and I couldn't be prouder – she worked so hard to write, practice, and deliver her lines, and did an awesome job ❤️
Tweet media one
61
69
2K
@twostraws
Paul Hudson
11 months
Using SwiftUI feels like cheating sometimes 👀
18
83
1K
@twostraws
Paul Hudson
3 years
When I was younger I used to think being clever was the most important thing in the world, and that smart people could solve any problem. Now I'm older, I realize how wrong I was: being kind is far more important than being clever – I'd rather be kind than clever every time.
33
201
1K
@twostraws
Paul Hudson
3 months
After enough of you messaged asking if I was going to do it… fine, I’ll be that guy, and wear Vision Pro on my flight home. It certainly ought to make it pass a lot faster! 😂
Tweet media one
37
18
1K
@twostraws
Paul Hudson
4 years
Manage to totally lose track of time today while having fun with SwiftUI and Core Motion, so today's Hacking with Swift+ article will be late. But, come on – it's fun! 😅
36
122
1K
@twostraws
Paul Hudson
4 years
Behold my mighty Hammer of Apple Design Mistakes!
Tweet media one
38
138
1K
@twostraws
Paul Hudson
11 months
We're less than two hours in, and I think there are already more visionOS developers than Meta ever had 😅
26
96
1K
@twostraws
Paul Hudson
4 years
🎂 Today is my 40th birthday. If you want to give me a gift, find someone in the iOS community who has inspired you through a blog post, a conference presentation, a video, or somehow else, and send them an encouraging tweet. If we build each other up we all rise together 🚀
295
78
1K
@twostraws
Paul Hudson
5 years
Xcode 11 is out, so let me take this chance to remind you that a ton of Apple folks work hard to make it the best they can, and our jobs would look very different without their effort. It deserves more than a 2.8 on the App Store – stop for a moment and write something nice 🙌
Tweet media one
66
245
1K
@twostraws
Paul Hudson
4 years
Pro tip: if you downloaded Xcode straight from Apple, you can use "xip -x Xcode_12.1_GM_seed.xip" to skip the validation step and save approximately a billion tons of CO².
19
193
1K
@twostraws
Paul Hudson
5 years
🚨🚨🚨 Xcode 11 has a mini-map in the source editor! I repeat, Xcode 11 has a mini-map in the source editor! This is not a drill! 🚨🚨🚨
Tweet media one
38
264
1K
@twostraws
Paul Hudson
11 months
Once you have the visionOS SDK installed you can really see how the idea of light and dark mode just doesn't make sense with Vision Pro – click the mountain icon in the bottom-right corner to try different environments, and also different times of day 🌄
14
99
1K
@twostraws
Paul Hudson
5 years
For you curious folks: the #WWDC19 jacket isn’t denim. Instead it’s a lightweight, reversible thing that comes in a variety of colours. One side is black, the other is packed with icons. Here’s yours truly acting as model 😛
Tweet media one
Tweet media two
Tweet media three
60
102
1K
@twostraws
Paul Hudson
11 months
#WWDC23 swag!
Tweet media one
20
38
1K
@twostraws
Paul Hudson
3 years
👋 Senior Apple folks! Forcing staff back into the office no matter their circumstances, and even asking for access to their medical records, is a really lousy look. We're all watching, and want to see you do better. Please think different 🙇‍♂️
25
122
1K
@twostraws
Paul Hudson
2 years
🎉 We've been approved to host a Ukrainian refugee family in our home here in Bath! Now we are diving head first into the admin side – finding a school for the child, getting set up with a local doctor, etc. I hope we can make them feel welcome ❤️
49
15
1K
@twostraws
Paul Hudson
2 years
You know I’m avoiding important work when I’m back to having fun with SwiftUI’s inner shadow – such a pleasing depth effect with so little work! (Alt: as I tip my iPad, the inner shadow in an icon moves to match, as if there were a real light source.)
35
67
1K
@twostraws
Paul Hudson
4 years
I just realized: Hacking with Swift has now passed five million page views a month, serving 700,000 unique visitors 🤯 An average visitor comes back seven times a month, which means a lot to me – folks don't come by only once or twice, but keep coming back for more 🙇‍♂️
80
24
1K
@twostraws
Paul Hudson
2 months
@anumness Expires in 18 months! About one dose a day over the period, which in a house of four seems quite likely.
85
8
1K
@twostraws
Paul Hudson
3 years
Petition to have Apple add a "Default simulator" option to Xcode. One like = one signature 😛
26
83
1K
@twostraws
Paul Hudson
3 years
Tweet media one
19
137
1K
@twostraws
Paul Hudson
22 days
My grandmother passed away today. I feel so privileged to have known her, and for my children – her great-grandchildren! – to have known her too. 98 is a fantastic age, and I’ll always remember her love and kindness ❤️
Tweet media one
139
6
1K
@twostraws
Paul Hudson
3 years
If you’ve ever thought about writing an article about coding, this video is for you.
40
161
1K
@twostraws
Paul Hudson
5 years
UIImage has a new initializer, UIImage(systemName:) that takes a string and returns one of over 1500 different system icons. Download the SF Symbols app and see them all here:
Tweet media one
16
348
1K
@twostraws
Paul Hudson
3 months
Packing for the flight home 😂
Tweet media one
18
25
1K
@twostraws
Paul Hudson
5 years
Alright, iOS developers: it's time to settle this once and for all. Retweet this if you prefer building your user interfaces programmatically; favorite this if you prefer building them using Interface Builder. I'll write a new article for whichever option is ahead in 24 hours 🚀
66
361
1K
@twostraws
Paul Hudson
3 months
I’m ready for action! 🥽
Tweet media one
10
27
1K
@twostraws
Paul Hudson
2 years
It’s happening! #WWDC22
Tweet media one
21
22
1K
@twostraws
Paul Hudson
4 years
My new course launches in 24 hours 😱 ✅ 100% SwiftUI ✅ Testing ✅ Architecture ✅ Localization ✅ Core Data ✅ CloudKit ✅ App Clips ✅ Widgets ✅ StoreKit ✅ Apple Pay ✅ Sign in with Apple ✅ iOS, macOS, tvOS, and watchOS And more! Subscribe here:
Tweet media one
45
124
1K
@twostraws
Paul Hudson
4 years
Using print() for debugging isn't ideal, but if you're like me and use it at least once a day can I suggest you add this trivial debugPrint() SwiftUI modifier? It lets you print arbitrary values as part of a chain of view modifiers.
Tweet media one
28
94
978
@twostraws
Paul Hudson
2 years
You might know Hacking with Swift has no trackers/analytics, so you learn privately. Two things you might not know: – Every visit you make is carbon neutral using renewable power and offsets – I donate a portion of monthly income to two food banks, to help folks who need it most
20
54
963
@twostraws
Paul Hudson
6 months
I'm really pleased to announce my new open-source project, Inferno. It's a big collection of Metal shaders built for SwiftUI, allowing you to add fantastic special effects and transitions to your apps with almost no code. Get it here:
Tweet media one
40
166
954
@twostraws
Paul Hudson
5 years
🧐What if I said I was thinking of writing a book about all the SwiftUI techniques I've learned? 😳What if I said I'd ALREADY written it? 🤩What if I said I was making videos too? 🤯What if I said it was online NOW, free? Wonder no more, folks: #WWDC19
96
265
949
@twostraws
Paul Hudson
2 years
Part 5 of my tutorial remaking the iOS 15 Weather app is out, and it's so much fun! When you add this into the day/night cycle, clouds, and twinkling stars, the effect is really quite magical ✨ (Video: light/heavy rain and snow effects in SwiftUI)
19
66
945
@twostraws
Paul Hudson
2 months
@ChristophBauer Officially it’s just 18 months! (I’m not a big fan of throwing medication away; some people in the replies posted research about efficacy of medication after the expiry date.)
16
1
948
@twostraws
Paul Hudson
3 years
Part four: it autocompletes all the cases for enums when you use `switch`. #WWDC21
11
78
938
@twostraws
Paul Hudson
11 months
Ready to try SwiftData? It's just a picker away 🙌
Tweet media one
28
72
921
@twostraws
Paul Hudson
2 years
Connecting some new AirPods… did they always show the inscription and I was just oblivious? Very cool.
Tweet media one
27
44
912
@twostraws
Paul Hudson
3 years
If you wrote some code today, congratulations: you’re a programmer. Don’t let other folks try to push you away with talk of CS degrees and more – what matters is you wrote some code and got a step closer to your goals. Great job! 🙌
21
107
902
@twostraws
Paul Hudson
3 years
Tweet media one
15
168
903
@twostraws
Paul Hudson
4 years
I don’t know who needs to hear this, but just because you’re struggling it doesn’t mean you’re failing ❤️
30
111
884
@twostraws
Paul Hudson
4 years
18 years today! @MrsTwoStraws continues to be the perfect life partner for me ❤️
Tweet media one
78
2
867
@twostraws
Paul Hudson
3 years
As the iPhone 13 starts arriving for folks who ordered one, I hope we can all take a moment to appreciate that iOS 15 is supported all the way back to iPhone 6S – that launched six years ago, with iOS 9! 👏
27
77
851
@twostraws
Paul Hudson
2 years
Today is the 7th anniversary of Hacking with Swift! I started planning and writing a few months earlier, but today in 2014 I decided to register the domain and make it official. It's already been an incredible ride, and I'm really grateful for all your support! 🙌
53
25
858
@twostraws
Paul Hudson
1 year
When my dad died in April it left my mum in a rather difficult position, and a four-hour drive away too. It took a lot of work and careful planning, but I was able to help her buy a retirement apartment here in Bath just a 15-minute walk away, and today she moved in! 🎉
Tweet media one
29
5
858
@twostraws
Paul Hudson
4 years
In all my Swift videos you see me and the Hacking with Swift logo behind me, but if you've ever wondered what *I* see while recording here you go. I'm happy to take questions if you have any 😅 What does *your* desk look like?
Tweet media one
128
12
841
@twostraws
Paul Hudson
2 years
What’s new in SwiftUI for iOS 16? I’m glad you asked! Here’s everything I’ve learned so far, including bottom sheets, fixed grids, share sheets, and 40 all-new sample projects you can download and try in Xcode 14. #WWDC22
23
160
840
@twostraws
Paul Hudson
3 years
I just published a huge article plus a 53-minute video(!), covering what I think it takes to become an iOS developer in 2021 – the core skills to learn, extension skills to tackle, common mistakes, free resources, folks to follow on Twitter, and more!
25
170
830
@twostraws
Paul Hudson
5 years
Oh, don’t mind me – I’m just running Xcode 11. ON MY iPAD 🤩 #WWDC19
34
114
821
@twostraws
Paul Hudson
3 years
One thing I’ve learned in 25 years of coding: never write sloppy code in order to build a prototype faster. I used to think prototypes go ahead 20% of the time, but honestly it’s closer to 80% – that “quick hack” will be with you for years, so take the time to get it right now.
33
113
826
@twostraws
Paul Hudson
2 years
I ran 5km (3 miles) for the first time this morning. I know that's nothing for a lot of you, but I'm really *not* much of a runner so I'm feeling pleased. And also tired. (But mostly pleased.) 🏃‍♂️
72
6
822
@twostraws
Paul Hudson
5 years
My new app for learning Swift is now live on the App Store! It's completely free with no in-app purchases, and includes 100 videos, 1200 review questions, practice activities, daily challenges, and more. Launch video: Download:
47
261
805
@twostraws
Paul Hudson
3 years
Xcode tip #1 : Swift can synthesize memberwise initializers for structs, but not for classes. Fortunately, Xcode can generate the code for us: select your class name, then go to the Editor menu and choose Refactor > Generate Memberwise Initializer. Done!
31
91
800
@twostraws
Paul Hudson
5 years
Whole SwiftUI programs fit into tweets 🤯 #WWDC19 struct ContentView: View { @State var celsius: Double = 0 var body: some View { VStack { Slider(value: $celsius, from: -99, through: 99, by: 0.1) Text("\(celsius)C is \(celsius * 9 / 5 + 32)F") } } }
21
124
794
@twostraws
Paul Hudson
8 months
This is from the Apple Store app, so I think you all now have permission to write xCode and IOS 😅
Tweet media one
18
16
778
@twostraws
Paul Hudson
3 years
Most of these "offend a programmer with a single tweet" messages are weird. What's a good Swift/Xcode tip you can fit in a single tweet? I'll start: if you have a method that returns a tuple, you can destructure it like this: let (username, password) = getCredentials()
103
107
785
@twostraws
Paul Hudson
2 years
I know this is like screaming into the void, because somehow we are still getting this wrong: if you’re an iOS developer using a string format to create dates, then - Do not use “YYYY” - Do not use “yyyy” either - Use “y”, which will be correct in all locales
15
110
777
@twostraws
Paul Hudson
2 years
I'm pleased to announce I'm putting the finishing touches to a new book that has been three years in the making: Pro SwiftUI! Not only does it cover a wide range of advanced SwiftUI techniques, but it will also include videos for every chapter so you can learn however you prefer!
Tweet media one
33
87
765
@twostraws
Paul Hudson
1 year
My top advice for anyone learning to code: 1. Don't try to remember everything; it won't help. 2. You're going to screw up a lot, and that's okay. 3. After learning something, write some code using it to make sure you've understood. 4. It's never, *never* too late to start.
23
122
765
@twostraws
Paul Hudson
2 years
All the room names are from macOS releases! #WWDC22
Tweet media one
Tweet media two
Tweet media three
Tweet media four
19
69
761
@twostraws
Paul Hudson
3 years
Keep in mind this comparison is deeply unfair: my 16-inch MacBook Pro was literally maxed out just a year ago – 8 cores, 64GB RAM, and much more, costing $6000. In comparison the M1 costs just $2000 and manages to hammer the Intel machine with a quarter of the RAM.
12
61
750
@twostraws
Paul Hudson
3 years
I'm not going to lie: I don't think I deserve 60,000 followers on Twitter. But I am really grateful you're here, and I hope my tweets help you, inspire you, or even just make you smile sometimes ❤️
59
9
756
@twostraws
Paul Hudson
2 years
They went to *extraordinary* lengths to add fun little things throughout the building, including Easter eggs to unlock, classic pieces of equipment, and more. A fun tour! #WWDC22
Tweet media one
Tweet media two
Tweet media three
Tweet media four
19
54
746
@twostraws
Paul Hudson
3 months
I built a visionOS app, and it's been approved in time for launch on Friday. It's called Spatial Symphony, and it's a synthesizer controlled entirely through hand gestures 🤏🤌 I wrote about building the prototype, attending Apple's labs, and more here:
23
53
758
@twostraws
Paul Hudson
2 years
If you know, you know. #WWDC22
Tweet media one
42
14
740
@twostraws
Paul Hudson
2 years
I feel like it should have taken 100x the code it did to make this work, but here you go: SwiftUI + Virtualization + macOS Ventura all together 🚀
Tweet media one
17
48
741
@twostraws
Paul Hudson
5 years
SwiftUI, folks. #WWDC19 #Pride
Tweet media one
Tweet media two
15
140
736
@twostraws
Paul Hudson
3 years
What's new in Swift 5.5? It's easier to ask what *isn't* new in Swift 5.5, because so much is changing – async/await, concurrency, actors, throwing properties, CGFloat/Double bridging, local lazy, property wrappers for function parameters, and more 🤯
32
158
741
@twostraws
Paul Hudson
5 years
Even Display P3 would struggle to capture how vibrant the #WWDC19 sign is 👌
Tweet media one
17
104
723
@twostraws
Paul Hudson
5 years
This morning I had an email from a reader asking whether 27 is too old to learn Swift. Let me be clear: 27 isn’t too old, and neither is 87. You’re welcome in this community regardless of your age or background – anyone can make brilliant apps that help change the world ⚡️
50
113
719
@twostraws
Paul Hudson
4 years
🤷‍♂️
Tweet media one
16
95
715
@twostraws
Paul Hudson
7 months
At some point I need to stop screwing around with SwiftUI and Metal and go to sleep. This is a dramatically enhanced version of the WaveView we built in HWS+ a few years ago: (Description: Glowing lines move in waves, twisting as they change color.)
12
35
716
@twostraws
Paul Hudson
2 years
I made it to Apple Park! Where are all you #WWDC22 people at? 😅
Tweet media one
31
9
712
@twostraws
Paul Hudson
2 years
This is one of the smallest changes in SwiftUI this year, but I am going to use the heck out of it – append `.gradient` to your colors to get a very gentle linear gradient 🙌 #WWDC22
Tweet media one
Tweet media two
21
81
716
@twostraws
Paul Hudson
3 years
It's clear why Apple mentioned coding in the keynote – M1 is screamingly fast for developers. I almost feel sorry for Intel! My Unwrap project (13k lines Swift, 10k Obj-C, more) was 19.5s on Intel vs 11.7 on M1. AudioKit (39k C, 27k Swift, 12k C++) was 73s on Intel vs 31 on M1.
20
70
710
@twostraws
Paul Hudson
5 years
Instant new meme pic. You're welcome. #WWDC19
Tweet media one
7
126
706
@twostraws
Paul Hudson
3 years
And part five: when you loop over an array, it automatically completes using a singular version of the array name. #WWDC21
4
68
704
@twostraws
Paul Hudson
3 years
Part two: it spots when you're trying to unwrap an optional and completes it for you. #WWDC21
4
60
704
@twostraws
Paul Hudson
8 months
Here's a little sneak peek of what's coming later this month 👀 (Yes, it will be completely free online for everyone to read ❤️)
Tweet media one
27
87
696
@twostraws
Paul Hudson
3 years
A couple of months ago I made 24 quick videos of Xcode tips, and I finally got around to putting them together into one video + article for easier access. Enjoy!
18
119
693