TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

An Observable Pattern Implementation in Swift

10 pointsby jaxonduover 9 years ago

4 comments

mellingover 9 years ago
Just a quick note for anyone learning Swift, my collection of Swift Resources just past 2000 urls: <a href="http:&#x2F;&#x2F;www.h4labs.com&#x2F;dev&#x2F;ios&#x2F;swift.html" rel="nofollow">http:&#x2F;&#x2F;www.h4labs.com&#x2F;dev&#x2F;ios&#x2F;swift.html</a><p>The raw data is on GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;melling&#x2F;SwiftResources" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;melling&#x2F;SwiftResources</a>
autoreleasepoolover 9 years ago
Lately, I&#x27;ve seen a lot of people claiming that the Objective-C runtime is something worth avoiding. I don&#x27;t find this to be true. It is highly optimized, with hand written assembly, and it is very fast at what it does. Not to mention Apple&#x27;s entire framework is build around it.<p>The new trend favoring Swift value types often leads to reinventing the wheel for the sake of premature optimization.
Tloewaldover 9 years ago
I&#x27;m curious as to why the observable needs a reference to the subscribing object at all. The subscriber knows who it is. (Similarly, why does the update callback need to pass the old value?)l If the subscriber didn&#x27;t keep a copy of the old value then presumably it doesn&#x27;t care.
评论 #10331387 未加载
gorenaover 9 years ago
RAC does all of this and more:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ReactiveCocoa&#x2F;ReactiveCocoa&#x2F;blob&#x2F;master&#x2F;ReactiveCocoa&#x2F;Swift&#x2F;Property.swift" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ReactiveCocoa&#x2F;ReactiveCocoa&#x2F;blob&#x2F;master&#x2F;R...</a>