RAS S1E2

A tale of composition 🌳 In my mind there are two ways of thinking about composition, when we have FRP or FP in the mix. The first one is often mentioned when compared to inheritance[1]: Composition over inheritance in object-oriented programming is the principle that classes should achieve polymorphic behaviour…

Cells and ViewModels

With MVVM, each cell will have its own ViewModel from where it will get the necessary data it needs. That's pretty sweet, until you have to dequeue a cell: So, what's the identifier? The ViewModel shouldn't be aware of the View. And the reason why is: if at any point…

Why FRP?

So today I wrote this on Twitter: People still think that Reactive libs/frameworks are just an enhanced KVO. #2016— Rui Peres (@peres) January 7, 2016 Part 1 And I got some feedback from Miguel Ferreira. Since, in general, I agree with his opinions about software development, I decided…

Schedulers

When you think about ReactiveCocoa, one immediately thinks about Signals, streams of events and transformations. Although that's all there, RAC is more than meets the eye. Lately I had to do the following: Track if a user spends more than 2 seconds in a screen. I went with viewDidAppear: and…

#2 Diary of a Secret App: AutoLayout

I had a rough battle with AutoLayout these days[1]. The following notes are in the context of a UITableView with dynamic sizing cells. : If you want to change an UITableViewCell's layoutMargins, don't use Interface Builder. After some time tracking this down, it seems that if you set contentView's "…

Generic UIViewControllers

Update 1/09/2015: Code tested on Xcode 7.0 beta 5 (7A176x) Note: Kudos to Robert for lending me his brain in some of this decisions. Context Imagine you want to display some photos and videos in a UITableView. Both the photos and the videos have their own feed,…

McFlurry™

While working with RAC 3.0, I find myself in this situation a lot[1]: aSignal.flatMapLatest { v in transformation(v) } Which can be simplified into: aSignal.flatMapLatest(transformation) The problem is when our transformation, doesn't really fit what we need. func fileCreationDate(fullPath: String) -> SignalProducer<NSDate,…

POP, Signals and Dispatchers (part 2)

After a discussion about the Flux Architecture. I still wonder if it works in iOS, or just Web.— R. Peres (@RuiAAPeres) July 14, 2015 Well, it doesn't, at least for me. The thing is, with the use of Singletons, you won't be able to test a damn thing, so…