TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

SwiftUI

765 点作者 fphilipe将近 6 年前

52 条评论

kylemacomber将近 6 年前
I’m one of the engineers that spearheaded this initiative inside of Apple. I just wanted to thank the HN community—I’ve been reading HN for 10 years now and it’s been formative in my development as a software engineer.<p>If you’re at WWDC stop by the labs and say hi!
评论 #20087902 未加载
评论 #20088175 未加载
评论 #20088866 未加载
评论 #20087424 未加载
评论 #20087494 未加载
评论 #20087823 未加载
评论 #20088003 未加载
评论 #20088573 未加载
评论 #20087310 未加载
评论 #20087841 未加载
评论 #20087451 未加载
评论 #20087845 未加载
评论 #20087620 未加载
评论 #20087444 未加载
评论 #20088600 未加载
评论 #20087684 未加载
评论 #20089043 未加载
评论 #20087430 未加载
评论 #20088086 未加载
评论 #20134595 未加载
评论 #20088114 未加载
评论 #20092010 未加载
评论 #20092704 未加载
评论 #20087322 未加载
评论 #20088858 未加载
评论 #20087353 未加载
评论 #20089946 未加载
archagon将近 6 年前
Lots of engineers are suggesting that SwiftUI, plus other declarative frameworks, might be &quot;the future&quot; of app development. However, I can&#x27;t help but feel that this paradigm would work best when your app is a fairly basic CRUD thing. If you&#x27;re working with highly interactive interfaces, complex animations, or dense, layered documents (DAWs, video editors), it seems that you would <i>need</i> explicit state and imperative code at the center of it all, and that a declarative approach would require hacks and workarounds at every turn. In my humble opinion, some of the most interesting, ground-breaking, and creative software has these properties; whereas this reactive stuff seems tailored to bog-standard utility software.<p>However: I&#x27;ve never used React or any of its derivatives, so this is mostly inference. Is this take accurate or not? In theory, could you scale SwiftUI to build something like Logic, Blender, or Photoshop (for example)?<p>Also, have any declarative UI frameworks been released that feature a &quot;platform&quot; layer, where you get to define how your declarative code actually turns into UI, widgets, and behaviors? It seems that SwiftUI relies on (encoded) assumptions of what an ideal UIKit or AppKit app is supposed to look and feel like, and it would be really powerful if we could mess with this foundation or even swap it out entirely.<p>(It&#x27;s very possible I&#x27;m mixing up reactive&#x2F;declarative&#x2F;reactive-UI concepts since I&#x27;m not too familiar with the territory.)
评论 #20090594 未加载
评论 #20090796 未加载
评论 #20092295 未加载
评论 #20090389 未加载
评论 #20092507 未加载
评论 #20090321 未加载
评论 #20106035 未加载
评论 #20093490 未加载
评论 #20091339 未加载
评论 #20095251 未加载
fphilipe将近 6 年前
Personally, as an iOS developer, this is by far the biggest announcement.<p>Haven’t had the chance to dig deeper, but the comparison between the UITableViewController and that snippet containing just declarative code looks absolutely promising.<p>The only downside is that we’ll have to wait one or two years before we can use it if older iOS versions still need to be supported. Let’s hope for extra quick adoption of iOS 13.
评论 #20088479 未加载
评论 #20087342 未加载
评论 #20088484 未加载
PabloSichert将近 6 年前
I&#x27;ve been working on a very similar framework[1], but wasn&#x27;t satisfied with the ergonomics enough to release it.<p>My plans were to extend the Swift compiler with JSX-like syntax[2] that makes use of the declarative framework. Of course that&#x27;s still possible, especially now with a canonical &quot;Apple&quot; way of building declarative interfaces in Swift.<p>I&#x27;m a bit sad that with the announcement of SwiftUI my implementation will not stand a chance anymore, but I definitely learned a lot along the way how declarative rendering and reconcilation works in detail.<p>Bottom line - this is very great news for native app development, declarative UI makes it vastly more easy to reason about code.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;PabloSichert&#x2F;Sx&#x2F;blob&#x2F;master&#x2F;Example&#x2F;Incrementer.swift" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;PabloSichert&#x2F;Sx&#x2F;blob&#x2F;master&#x2F;Example&#x2F;Incre...</a><p>[2] <a href="https:&#x2F;&#x2F;facebook.github.io&#x2F;jsx&#x2F;" rel="nofollow">https:&#x2F;&#x2F;facebook.github.io&#x2F;jsx&#x2F;</a>
oflannabhra将近 6 年前
This is fantastic, and I am almost upset by how little info the keynote address included. Obviously there will be a ton of detail coming out this week with the labs and documentation being released, looking forward to that.<p>As an iOS developer, this is by <i>far</i> the biggest announcement. This has huge potential to provide value to me and my team. I&#x27;m looking forward to ripping out programmatic NSLayoutConstraint and Interface Builder from my projects ASAP. This seems like it includes much more than that, however.
评论 #20087470 未加载
评论 #20087457 未加载
untog将近 6 年前
I&#x27;d be curious to know how many React Native devs work on cross-platform apps. In casual conversation I&#x27;ve had it actually isn&#x27;t that high, despite it being one of the central promises of RN.<p>Given that SwiftUI has live reloading and a sensible template interface I could absolutely see it winning over some RN devs. There&#x27;s something to be said (particularly with Apple) for using the native toolset rather than RN, Flutter and the like.
评论 #20090958 未加载
评论 #20089765 未加载
评论 #20092392 未加载
评论 #20087800 未加载
评论 #20087710 未加载
zapzupnz将近 6 年前
I&#x27;m sure SwiftUI has been in development for a long time, but it seems to me to be Apple&#x27;s response to frameworks like React Native and Electron.<p>We get a simple way to make UIs for multiple platforms, we get a nice batteries-included language, and Swift 5.1&#x27;s dynamic method offers a similar functionality to hot reloading.<p>Of course, it can&#x27;t answer everybody&#x27;s needs (no Windows, Linux, or Android support) but combine SwiftUI with Project Catalyst, and I&#x27;m really hoping to see plenty of high-quality cross-platform apps that don&#x27;t have a whole instance of Chrome underlying them.
评论 #20089628 未加载
评论 #20089449 未加载
sz4kerto将近 6 年前
To me this looks very similar to what Google is doing with Flutter.
评论 #20088531 未加载
评论 #20087350 未加载
评论 #20087377 未加载
评论 #20088776 未加载
评论 #20087409 未加载
评论 #20088875 未加载
thought_alarm将近 6 年前
I&#x27;m laughing at all the handwringing over Marzipan in the lead-up to this year&#x27;s WWDC.<p>The future of MacOS development is not Marzipan and never was. The future is SwiftUI.
评论 #20091807 未加载
评论 #20088126 未加载
评论 #20088744 未加载
thegayngler将近 6 年前
Thank you so much for this. I was learning iOS again for the fourth time. This time is different. I learned about programmatic UI from Brian LBTA guy which has been so much easier than IB. Now this update just makes my learning iOS a whole lot easier for me. I&#x27;m so thrilled. Thank you thank you thank you Apple!!!!!!!!
评论 #20089982 未加载
Pym将近 6 年前
This reminds me Visual Studio back in 2001 when I discovered programming. Everything was so easy to prototype. I&#x27;m so happy to see Apple is taking this direction. Thank you guys!
评论 #20090036 未加载
mmckeen将近 6 年前
Reminds me a bit of QML, though less declarative. Qt creator also has some pretty good IDE support.
vedantroy将近 6 年前
This is definitely an overly ambitious project idea, but now that Google has Jetpack Compose and Apple has SwiftUI, and the web has React, I wonder if it would be possible to make a &quot;meta-framework&quot; that uses a single code-base to compile user written code into source code written in those 3 frameworks respectively.<p>Then you would get truly native, cross-platform development.<p>Now, the probability this would ever work is 1%, but it&#x27;s something that has lingered in my mind anyway.
评论 #20090665 未加载
评论 #20090253 未加载
评论 #20090570 未加载
评论 #20091469 未加载
childintime将近 6 年前
I was waiting for Apple to react to Flutter. It was a threat. They couldn&#x27;t bluntly forbid Flutter apps. Now it seems this is their answer.<p>Soon you&#x27;ll be able to compile SwiftUI to Flutter and reach all platforms it reaches. Their play: to get the best experience, you&#x27;d still need to buy an iPhone.
评论 #20091898 未加载
melling将近 6 年前
there were lots of Swift holdouts. In fact, there has been a resurgence of Objective C<p>Objective C is much higher than Swift: 11 vs 18.<p><a href="https:&#x2F;&#x2F;www.tiobe.com&#x2F;tiobe-index&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.tiobe.com&#x2F;tiobe-index&#x2F;</a><p>This should reverse the rankings and might push Swift into a top 10 language.
评论 #20099687 未加载
laszlokorte将近 6 年前
Do the trailing closures implicitly return arrays of child elements? Or what kind of syntax is that?
评论 #20089034 未加载
评论 #20088154 未加载
bilal4hmed将近 6 年前
Looks a lot like Flutter
thomasjames将近 6 年前
Interesting move we see from the big players to more declarative UI toolkits. First Flutter, now this.
评论 #20093051 未加载
评论 #20087978 未加载
skohan将近 6 年前
I hope it still supports low-level control when you need it.
评论 #20087846 未加载
评论 #20089351 未加载
评论 #20089153 未加载
dvtrn将近 6 年前
Does the syntax sort of kind of remind anyone else of Shoes?[1]<p><a href="http:&#x2F;&#x2F;shoesrb.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;shoesrb.com&#x2F;</a>
评论 #20089320 未加载
评论 #20091317 未加载
jcelerier将近 6 年前
The syntax example is still not as clean as QML, which is already a ten-year-old language (examples: <a href="http:&#x2F;&#x2F;qmlbook.github.io&#x2F;ch04-qmlstart&#x2F;qmlstart.html" rel="nofollow">http:&#x2F;&#x2F;qmlbook.github.io&#x2F;ch04-qmlstart&#x2F;qmlstart.html</a>).
评论 #20087648 未加载
评论 #20087917 未加载
评论 #20087681 未加载
评论 #20089296 未加载
评论 #20088596 未加载
appliaison将近 6 年前
Now, will someone be a sweetheart and write a transpiler that will transpile AndroidXML to SwiftyUI and SwiftyUI to AndroidXML. Also, while you&#x27;re at it, please write a transpiler for Flutter to SwiftyUI and SwiftyUI to Flutter. K. Thx.
checker659将近 6 年前
One more blow to the head for objective-c. Wonder if this the final nail in the coffin.
评论 #20090526 未加载
评论 #20088554 未加载
评论 #20093078 未加载
sdegutis将近 6 年前
So React.js but native and in Swift? I&#x27;m hesitant but hopeful.<p>Tutorial: <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui&#x2F;</a>
chkgk将近 6 年前
I didn&#x27;t catch it. Is Xcode 11 (beta) available already? Do I need macOS Catalina (beta) to run it? I seem to have missed the crucial information and cannot find it on apples developers pages...
评论 #20088256 未加载
评论 #20087529 未加载
Redoubts将近 6 年前
<p><pre><code> var body: some View { </code></pre> Wait, what? When was `some` a keyword?
评论 #20087633 未加载
评论 #20089047 未加载
评论 #20088543 未加载
评论 #20087631 未加载
abalone将近 6 年前
I’m wondering what this could mean for replacing React Native. Obviously SwiftUI is geared for Apple’s platforms but overall it seems pretty high level and perhaps amenable to being adapted to Android by somebody. Swift is open source after all.<p>This would solve a problem a lot of devs have in deciding how to build a cross platform app. We don’t want to give up first class support for each platform but it’s silly to have completely separate codebases.<p>I hear even Apple has React Native dev groups.
Apocryphon将近 6 年前
Can this retroactively support apps targeting iOS 12 and older?
评论 #20087585 未加载
评论 #20087966 未加载
评论 #20087398 未加载
评论 #20087460 未加载
azhenley将近 6 年前
.color(.gray))<p>What object is .gray acting on?
评论 #20087530 未加载
评论 #20087509 未加载
评论 #20087608 未加载
评论 #20087550 未加载
评论 #20087568 未加载
评论 #20087558 未加载
OkGoDoIt将近 6 年前
For more information, there&#x27;s a much more in-depth demo in the &quot;Platforms State of the Union&quot; session, which is now posted at <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2019&#x2F;103&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2019&#x2F;103&#x2F;</a>
DelightOne将近 6 年前
Where does this leave View Controllers? Is this available for those too? How does composition of multiple custom views work?
creolabs将近 6 年前
This is exactly what we did with Creo a couple of years ago: design, preview and development in a single tool. We rewritten UIKit from scratch in order to be able to preview iOS code on MacOS. Looks like we did it right. <a href="https:&#x2F;&#x2F;creolabs.com" rel="nofollow">https:&#x2F;&#x2F;creolabs.com</a>
DanGarthwaite将近 6 年前
It doesn&#x27;t matter that it looks like flutter. It matters that flutter will be able take advantage of it.
评论 #20088705 未加载
machinesbuddy将近 6 年前
It reminded me of Scaloid <a href="https:&#x2F;&#x2F;github.com&#x2F;pocorall&#x2F;scaloid" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pocorall&#x2F;scaloid</a>
artemiszx将近 6 年前
Thinking about starting a new project over the summer. But seeing the demos it seems just starting something in UIKit now is a bad idea?
hokkos将近 6 年前
So it look like react but it doesn&#x27;t seems to be immediate mode GUI, still retained ? The body is a property not a function.
评论 #20089127 未加载
dgellow将近 6 年前
Something like this available in C++ would be so great for cross platform applications!
评论 #20095129 未加载
jpochtar将近 6 年前
fmr founder of Pagedraw here... this looks amazing. I wish we&#x27;d built it! :)
atilkan将近 6 年前
Looks nice like Flutter.
adamspb将近 6 年前
Am I the only one thinking &quot;SwiftUI compile to WASM&quot;?
let_var将近 6 年前
First-call declarative UI support is amazing!
binthere将近 6 年前
Will there be a similar API for Objective-C?
kensai将近 6 年前
OMG, has anyone noticed the device icons on the bottom of the SwiftUI page? Steve will be turning in his grave...
chadlavi将近 6 年前
The question the whole web asks now: what does this mean for React Native devs
评论 #20087292 未加载
评论 #20087737 未加载
评论 #20089802 未加载
lostmsu将近 6 年前
&gt; across all Apple platforms
lisardo将近 6 年前
It’s nice to finally see a FRP framework for iOS like React&#x2F;Elm. MVC must die already.
评论 #20087664 未加载
评论 #20087686 未加载
评论 #20087634 未加载
croxx5f将近 6 年前
It smells a little like dart UI as code(flutterish may i say)
myko将近 6 年前
So frustrating this wont be usable for most apps for at least 2 years.<p>Meanwhile Android, which yeah only 5% of users or something crazy small are on the latest version, will get to use the latest libraries on versions released 5+ years ago.
mikece将近 6 年前
I was fully expecting something along the lines of &quot;Oh, and SwiftUI will compile to WebAssembly allowing your apps to look just as awesome and run just as fast in Safari.&quot;<p>Probably still in alpha...
评论 #20087619 未加载
RantyDave将近 6 年前
Ahhh, I don&#x27;t get it. XCode already does all of this, and has done for very many years. Y&#x27;all are excited because you can see the code?
TheRealDunkirk将近 6 年前
Other than a few-hour intro seminar on building iOS apps, almost 10 years ago, I&#x27;ve never written anything in Swift. The announcements around it today got the biggest reactions from the crowd. Is is really great, blasé, or too early to tell?
评论 #20088563 未加载
评论 #20089290 未加载
评论 #20087742 未加载
stefan_将近 6 年前
Apple developers will be glad they get to rewrite their entire application with a new UI framework and paradigm or risk their apps looking garbage on the platform (and stop working by next release). This must be the .. fifth entirely new UI framework from Apple?
评论 #20087358 未加载
评论 #20087944 未加载
评论 #20087871 未加载
评论 #20087419 未加载