See the entire conversation

It’s time to go on a deep dive into SwiftUI! 😀 I’m super happy to announce that my next guest on the @swiftbysundell podcast will be @joshshaffer — engineering director with the UIKit and SwiftUI team at Apple! 🍎🎉 What questions would you like me to ask Josh? Reply below 👍
129 replies and sub-replies as of Oct 10 2019

Documentation on SwiftUI is a pretty big topic that I assume you will touch on but worth reminding about. Also expected adoption by developers or even better actual adoption statistics would be neat. Keep up the great work man. Very happy for your achievements.
Waiting for the Swift web library 🥺
oh man, you're doing awesome stuff with the podcast, John!
Thanks man! I mean, after the episode with you and @terhechte, I felt like I needed to step up my game a bit 😉
(by which I mean that the episode we did was awesome 😀)
you're welcome 🤪
Are there any plans to open-source SwiftUI? In case Josh can’t answer this because of NDA, just tell him that he & all of the SwiftUI team did a great job! 😃😉🙏🏽
How do you recommend architecting a SwiftUI app? Particularly best practices for passing data and model objects between views, and controlling navigation.
React’s Redux for inspiration 😉
John could you ask him (or do you know?) if policies at Apple have changed about posting online & visibility? I love how we are seeing so many Apple staff on podcasts and even Twitter but I thought it wasn’t allowed. It’s the main reason I’ve never applied for an open role.
I would love to hear his thoughts on where they feel like they’ve succeeded and SwiftUI does what they set out to do and where they feel like it fell short and didn’t meet their expectations.
What steps are being taken to improve SwiftUI error messages? Not a moan - I’m genuinely interested how it will be technically possible. More of a moan - are we going to see more detailed documentation soon?
FWIW, the poor error messages from the type checker when using SwiftUI is not the fault of the framework. We’re addressing those in the Swift compiler, and will have a write-up describing our approach “soonish.”
Awesome! Thanks. Look forward to that 🙂
I’d also love to hear any backstory he can tell on how the project got started etc. Also It would also be cool to hear about the tech stack underneath it all. Im sure there’s some interesting things they’ve done for performance etc that would be cool to hear about.
Any target date for using attributed text in SwiftUI?
Are people supposed to be able to build Mac apps with it? (The lack of examples is bizarre.)
Will SwiftUI List implemement something like ScrollToRow method? We cannot scroll to the bottom of the List automatically as of now.
SwiftUI is a HUGE thing, so how was the decision process to justify a (probably) giant task force to make this happen?
Q: It seems that some SwiftUI types cannot be implemented in Swift alone, particularly the `AnyView` as it somehow erases the `some View` but still returns a valid `some View`. Is this only possible because of the C++ parts of SwiftUI? Would Swift someday allow implementing this?
AnyView is a typical type erasing container. Nothing magic about it.
Hah, I ran into a lot of trouble trying to re-implement it. Thanks! I'll give it another try.
I think @mikeash had type erasure article on his blog
1) What were the inspirations for the design of SwiftUI? 2) How does he view the use of more mature event driven architectures like Rx and Redux / ReSwift?
What'll be the release cycle of SwiftUI? Considering it's in such an early stage, 1 update per year can hurt its adoption and/or leave developers with "unfixable" bugs for a lot of time, therefore leading to potential bad reviews.
Yes, a faster than annual release cycle would be very helpful. I really want to be all-in on SwiftUI asap and I want to know how they are balancing improving it vs stability. Swift itself faced this challenge.
Question: Is there a long term plan to depreciate UIKit ( for new Apps may be)
I bet UIKit will be about as deprecated as Objective-C has been since the arrival of Swift
You mean, will going to stay but very few will use it for new App development?
Yeah :) although I think it took a couple of years for people to really start adopting Swift for new projects, once it became more stable.
• Is Apple dogfooding SwiftUI? Where? What new discoveries were brought on by dogfooding? • The documentation across all of iOS 13 was... lacking. SwiftUI would do well to have fully formed example apps. Is there internal interest in releasing something like that?
The Xcode Previews UI is itself using SwiftUI.
Whaaaat! When! I’m so excited!
[As broadly as necessary:] • What was the biggest miss in this release of SwiftUI? • What was the most delightful moment after WWDC week? • Error messaging is really bad, but that seems largely to fall on Swift’s shoulders. What’s the way forward to less inscrutable errors?
Excellent questions
SwiftUI + Canvas on iPad, when?
Perhaps most importantly of all: • This is a *very* different way of writing a user interface, not even thinking about Combine and all that it entails. What is it like to steward such a massive paradigm shift? What have you learned from the process?
can you share the link please?
The episode hasn’t been recorded yet, so there’s no link for it yet. You can subscribe to the show by searching for “Swift by Sundell” in your podcast app of choice. You can also find it on the web here:
Podcast | Swift by Sundell
Conversations about Swift and beyond, featuring a stellar cast of special guests.
swiftbysundell.com
As a person who is evaluating SwiftUI for a project that would launch in late-winter/spring, how stable can I expect SwiftUI to be over the next year? Are breaking changes expected to be as frequent as the first couple years of Swift?
Any plan to support Siri, or any voice command interface, over SwiftUI. Maybe something like `Speech`, `Speak` or `Ask` structs in future SwiftUI versions... Thanks.
- Like Swift, will SwiftUI be OSS? If not (or can’t disclose) what will be the SwiftUI release cycle? Yearly like UIKit? - As fast as it went since it was announced to today, will SwiftUI follow the same trail next year or will it be more stable? Thanks for an amazing API!
Ask please, if SwiftUI will have some alternatives for UICollectionView in future?
Will my app be sherlocked? In other words, will Apple release iPad app for designing & building apps with SwiftUI? (drag&drop, real-time rendering on connected device, etc) (Q-Mobile.IT/Q-Designer)
More insight into how the project got started, degree of dog-fooding going on, current recognised pain points, will we still recognise SwiftUI at wwdc next year?
1. Was there a technical barrier to implementing SwiftUI versions of Safari View Controller and Image Picker Controller? (IPC issues, perhaps?) 2. Are these coming in a future release? 3. Any plans for `IfLet` style versions of `ForEach`?
When will we have Collection Views?
What is the relationship between SwiftUI and Catalyst?
1) When will the SwiftUI tool chain error reporting improve? Right now the errors refer to the wrong line and are not understandable. 2) When will proper documentation arrive?
How frequently are you going to update SwiftUI? With WWDC only or smaller updates thoughout the year?
How are we supposed to test the UI with the SwiftUI framework. Right now we are unable to access the DOM in runtime in order to test it.
Please ask him if there’s plans to implement UICollectionView in some way!
Q: do devs at apple listen to swiftbysundell podcast?
SwiftUI & Mac catalyst, what’s the future with them together? Which one is getting more resources right now?
If I’m building a SwiftUI app and I want to bring it to the Mac should I use catalyst or AppKit? I’ve tested both and the UI results are wildly different even though the SwiftUI components are the same. Why aren’t they more similar?
Could SwiftUI for web be something in the future? 🙃
This will be a good one! - I shipped a SwiftUI app on day one and it was tons of fun to work on, so thanks! - UIViewRepresentable is extremely clever, but are there plans for more native components/controls? - Are enhancements saved for major OS updates or more frequently?
Why is SwiftUI so awful at creating macOS-first/primary UI?
- Microsoft recently made WinUI open source and has made releases available as NuGet packages. With the obvious benefits this gives developers are there any plans to do something similar with SwiftUI? - Can we look forward to more complete documentation soon?
What are the plans for the documentation? I miss the days when the documentation was complete, explained the why and how, had decent examples. No books internet sites needed. Now it is the other way around.
- Are SwiftUI animations time- or Frame based? (If the render loop is starved does the animation take longer or drop frames) - What’s the render thread? Main+Render thread, same? Composite off UI thread, but manage structure on main? Aka can we get a low level breakdown
Wohoo, exciting!! What year was SwiftUI started internally? Which Apple apps use it currenly/will use it soon? How are automated (regression) UI tests done internally? Is there private DOM access? Or snapshot testing?
+1 on testing. Also, why is there no UIHostingView?
I guess this is because you can convert an UIViewController into a View, so it could be unsafe to allow this View to be wrapped back in an UIHostingView
I see lots of questions about architecture, this is one— really I wonder what the UIKit vs SwiftUI future is. Now we need to wrap a UISearchController or if we need API access to a SplitView you revert to UIKit. Is most UIKit going SwiftUI?
Nice! What other projects inspired some of the design decisions? What was the motivation for putting so much effort into their tutorial on the web? What are some of the features/improvements to look forward to with SwiftUI?
Is there a chance to see a SwiftUI API where “back end” can be implemented not only for a Darwin? For instance SwiftUI instead of CSS, HTML and JavaScript😁
Is there a plan to add domain specific error handling instead of just falling back to cryptic Swift errors? SwiftUI DSL should have it’s own domain errors in my opinion.
“Do you have a bunch of automated tests in place, and what do they look like?”
- how did previous art like React and Elm influence SwiftUI. - why did Apple decide to indirectly recommend stream based data as opposed to a redux/state-container approach. (very common the other declarative view libs) - give us some tidbits about how the rendering engine works
Apple seem to be spending considerable effort on coming up with marketing names for their technologies, and often they’re quite interesting. What happened? 😬
Do you have dedicated team at Apple that constantly works on new paradigms research? Or it’s more taken from community like #flutter?
My biggest frustration is how everything is locked up, closed up, you don't know what's going on and Apple devs say it is "because it is deeply integrated with ios" which is also not open. Is there any plan to make it even more open/transparent? It was a punch into community.
Why is it so hard to do basic things like presenting the photo picker?
seconding this one
1. Can we get a public timeline / direction of SwiftUI? 2. Will SwiftUI be open source like Swift? 3. Will there be feature parity with UIKit? Or will we need to use UIViewRepresentable to wrap up UIKit classes that don't exist?
4. Can we get grids? I need more alignment support. I had to work with @DaveAbrahams to do more complex alignment at WWDC. At WWDC SwiftUI's lack of grid support destroyed all the pretty struct composition to have multiple alignment guides:
Paul Solt on Instagram: “Playing with SwiftUI at WWDC #wwdc #ios #iosdeveloper #swiftui #wwdc2019 @brewcoffee”
24 Likes, 3 Comments - Paul Solt (@paulsolt) on Instagram: “Playing with SwiftUI at WWDC #wwdc #ios #iosdeveloper #swiftui #wwdc2019 @brewcoffee”
instagram.com
5. Can you provide more guidance on how to work with more complex code examples? I find it very confusing to know what "Swift" code is allowed in the different parts of SwiftUI. Certain things are very hard because they're not allowed: optionals, complex if/else statements, etc.
6. What features will make SwiftUI easier to use? SwiftUI almost feels like another dialect of Swift, which makes it hard to write, hard to debug, hard to know what is allowed, hard to know what errors mean. Sometimes you need to extract to a method.
7. Can you please write a SwiftUI Programming Guide in the same style as the former multipage guides: i.e.: "Quartz 2D Programming Guide"? developer.apple.com/library/archiv…
I really miss having a linear programming guide that not only can show me how to do common things, but is something that I can read cover to cover. Right now the documentation is all a giant web of links, and discoverability for the content is very hard.
You need to drill in/drill out, and you never know what you're going to find. You never know what was added / removed / updated, because there's no document revision history.
Thank you for presenting at WWDC @JoshShaff ! I'm excited to get more insights into the development of SwiftUI. I'd love to use SwiftUI more, but it's been hard to recreate things that are easy in Auto Layout.
We're starting to plan on how to include SwiftUI in our iOS Bootcamp for @LambdaSchool now that Xcode 11 is released. I'm excited for easier to prototype UIs. The built in animations are awesome. I presented a SwiftUI interface at @tryswiftnyc
PaulSolt/TopRatedReviewsCombine
App Store Reviews using SwiftUI and Combine with Networking - PaulSolt/TopRatedReviewsCombine
github.com
This one is a limitation of function builders, which we intend to improve. We’d like to support if let/switch/all other control flow.
Instead od: State, Binding, ObservedObject, ObservableObject, Published, EnvironmentObject, could we just have access specifiers: (private, protected, public and published)?
The topic I would like to hear about: How is SwiftUI tested internally? Are there many automated tests? Or perhaps there are none? Are we supposed to test our views? If so, why nobody talked about this at dub-dub? TL;DR Is testing in SwiftUI’s DNA?
I’d love to know: What parts of UIKit do you want to see come to SwiftUI?
Some people do miss a fully fledged UICollectionView resembling SwiftUI’s List View, although I think we can do without it 😉
UITextView plzzzzz
“Use UI tests” throws out the whole notion of the test pyramid. Will you add support for unit testing?
Another +1. But I don't think Apple writes tests.
I’d be happy to help them change that culture, but only from the outside. I know some champions on the inside, if only they were unshackled.
The single biggest reason why I haven’t started playing more with SwiftUI
Why does SwiftUI support only iOS 13 devices?
It’s a bit out there, but I’d be curious in hearing about the possibility of Combine on Linux 😅
How could I structure an app now in preparation for SwiftUI adoption later? No more storyboards? Minimal View Controllers? More RxSwift? LESS RxSwift?
I’d love a deep dive on the layout system, especially around how UIHostingController works with the UIKit hierarchy. Not a lot of it is documented and I ran into a lot of challenges, especially as my SwiftUI view would occasionally need to resize and communicate that w/ UIKit.
How quickly will SwiftUI be filling in gaps in its API? For example, right now there’s no way to make a TextField first responder without dropping down into UIKit.
How SwiftUi relate to the React native.
Is Apple planning on making more views, like map views + layer backed content, like Metal and camera preview layers, available as Swift UI native components?
tell him it’s severely broken.
eagerly waiting for this episode. just make it fast😁
Can it be please be open source?
Could you imagine parts of SwiftUI becoming OpenSource? So that perhaps the Cocoa and CocoaTouch layers were kept private, but the vocabulary and part of the View diffing engine was shared? Swift would be SO powerful if SwiftUI back ends existed on Linux, Windows, Android!
• How do you see SwiftUI impacting Swift in the years to come like it already has with function builders, property wrappers, Identifiable, etc? • What’s on your personal wishlists for SwiftUI 2.0? • Was it called ShinyUI internally at any point of time?
What’s the story with styling in SwiftUI? Some elements like Buttons have public API, but for things like Lists and Pickers conforming to their styling protocols shows private API
Also really curious about the story for custom view transitions, UIKit style
Are substantial performance improvements for the Canvas environment in Xcode 11 on offer?
Ooh! 👏🏼 Q. Small question but it seems that a List view can’t disable the touch highlights like a UITableView can...is the SwiftUI goal to eventually replace the equivalent UIKit views, or to be a complement to them?
SwitUI under the hood is using UIKit objects at least in iOS13. Is it temporary and UIKit will be deprecated? New only swift UI framework is coming? New UI elements (maybe private) will be added to UIKit for SwiftUI? Thanks @johnsundell !!
What are some great apps on the App Store that Josh feels really showcase SwiftUI?
What’s the roadmap for relative layout that doesn’t involve setting explicit/desired frame sizes?
What are considered bad practices when writing apps with SwiftUI?
TESTING TESTING TESTING What new infrastructure is being added to XCTest to help build FAST & RELIABLE test suites for SwiftUI-based apps? Or, what other mechanisms are being put in place to help with testing? Curious how parts using UIKit underneath are being tested at Apple?