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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Blissful UI programming with ReactiveCocoa

22 点作者 benzguo将近 11 年前

4 条评论

nickalewis将近 11 年前
I&#x27;ve recently developed a renewed interest in iOS development particularly because of ReactiveCocoa. The idea of declaratively describing the intent of an action, rather than how it should work, has helped things &quot;click&quot; for me and I&#x27;m looking forward to using FRP and ReactiveCocoa in building a few personal iOS projects. I&#x27;m continuing to read more about it and this post was very helpful, thanks for sharing. I have a couple additional questions for any seasoned iOS &#x2F; ReactiveCocoa &#x2F; FRP devs that would definitely help me along as I progress:<p>1) Are there any performance gotchas or things to look out for when embracing ReactiveCocoa? One thing thats stuck with me as I read is making sure to understand and keep and eye on memory management, even after embracing ARC. Is debugging ReactiveCocoa code any different than the normal imperative way?<p>2) What parts of an app shouldn&#x27;t be handled with FRP? Should everything fit into the framework or is a code smell to handle things both ways?<p>3) I&#x27;m a Ruby Dev and I&#x27;m looking hard at RubyMotion as a good toolchain for iOS Dev. It looks like ReactiveCocoa and Rubymotion can play well together[1], but is this a hack? Is there any issue with using Rubymotion and ReactiveCocoa together. Seems like a great fit, but perhaps my inexperience isn&#x27;t aware of a deeper issue.<p>[1] <a href="http://spin.atomicobject.com/2013/06/18/reactivecocoa-rubymotion/" rel="nofollow">http:&#x2F;&#x2F;spin.atomicobject.com&#x2F;2013&#x2F;06&#x2F;18&#x2F;reactivecocoa-rubymo...</a>
al_gore将近 11 年前
I&#x27;m not crazy about referencing self within the block to create changes. On OS X, NSObject supports keypath-to-keypath bindings, which can be processed with NSValueTransformer (a relic of the pre-blocks era, I suppose). Something like that, using blocks instead of value transformers would keep the processing functions pure (transformation functions, then) would be ideal, I think.<p>In the second part they do something like this, but the syntax is just strange to me, compared to: <a href="https://developer.apple.com/library/mac/documentation/cocoa/reference/ApplicationKit/Protocols/NSKeyValueBindingCreation_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/bind:toObject:withKeyPath:options" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;mac&#x2F;documentation&#x2F;cocoa&#x2F;...</a>:
jonsterling将近 11 年前
Just a friendly reminder that ReactiveCocoa is not FRP! For an explanation of Conal&#x27;s conception of FRP, please see here: <a href="http://stackoverflow.com/questions/5875929/specification-for-a-functional-reactive-programming-language" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;5875929&#x2F;specification-for...</a><p>I use ReactiveCocoa very heavily at work, and find it very useful. Just want to avoid confusing the terminology with an existing concept which is well-defined and totally different.
jrjarrett将近 11 年前
I&#x27;m a fan of having unit tests with apps (maybe not full-on TDD but still). How would you create a unit test for something like this? Got any examples?