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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A deep dive into Swift’s function builders

64 点作者 taksintikk超过 4 年前

5 条评论

jgauth超过 4 年前
Great article. As someone new to Swift and SwiftUI, the lack of official documentation around these function builders is frustrating. The best I could find was a draft proposal [1].<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-evolution&#x2F;blob&#x2F;9992cf3c11c2d5e0ea20bee98657d93902d5b174&#x2F;proposals&#x2F;XXXX-function-builders.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-evolution&#x2F;blob&#x2F;9992cf3c11c2d5...</a>
评论 #24586278 未加载
setr超过 4 年前
I don&#x27;t understand the necessity for BuildIf&#x2F;BuildEither -- what could you possibly want to inject into a control-flow construct during initialization?
评论 #24586191 未加载
评论 #24586205 未加载
评论 #24586206 未加载
评论 #24586597 未加载
评论 #24586145 未加载
herodotus超过 4 年前
I enjoy articles like this. And I am spending a fair amount of my retirement time writing Swift. In fact I have written a reasonably complex MacOS App in Swift, and it works well. (For the 15 or so years I worked at Apple everything I wrote was in Objective-C or C). But Swift has what one of my friends calls &quot;a high surface area&quot;. In spite of using Swift almost daily, I have to say that if someone asked me &quot;Do you know how to program in Swift&quot; I would have to honestly answer &quot;No.&quot;
carlhung超过 4 年前
What is the use case except swiftUI?
LeoNatan25超过 4 年前
I must have a different idea of what “deep dive” means; this is simply going through the (relatively simple) motions of implementing a builder. “Deep dive”, to me, would look at how the compiler translates statements using these builders, for example, or reverse-engineering Apple’s builders for juicy information.<p>I’ve recently forayed into SwiftUI to see what all the fuss was. I have to say, I really feel for people just now starting to learn app development. Older Cocoa and iOS developers probably remember what actual in-depth articles look like, what “deep dives” actually are, etc. Instead, what we have is a culture of very shallow and information-light “articles”, that seems to me more like SEO bot posts trolling for clicks, rather than written for developers, by developers. And it’s not like the Sundells and Hudsons, but also NSHipster, CocoaWithLove, etc., which were traditionally where high-quality and information-rich content would come from in the past. Likewise with conferences, whereas in the past they’d invite developers to “deep dive” into and interesting development or debugging session, now they’ve devolved, for the most part, into these shallow, byte-sized “Swift” nonsenses. As if the language somehow defines the identity of the developers, and apps magically become much better as virtue of the language used, rather than the system frameworks.<p>I’m getting old.
评论 #24587255 未加载
评论 #24588732 未加载
评论 #24586459 未加载
评论 #24586817 未加载
评论 #24588264 未加载
评论 #24587041 未加载
评论 #24588735 未加载
评论 #24588687 未加载
评论 #24586394 未加载
评论 #24587802 未加载
评论 #24586350 未加载
评论 #24587465 未加载
评论 #24586779 未加载
评论 #24586525 未加载