-1

I don't know if ReactiveCocoa can do that, or if it's one of the right use case for it, basically I want to setups 2 or more views the exact same ways, for instance

[self.photoOrVideoLabel setTextColor:[UIColor glInboxGrayTextColor]];
[self.photoOrVideoLabel setFont:[UIFont glProximaNovaRegularWithSize:12.0f]];

[self.writeSomethingLabel setTextColor:[UIColor glInboxGrayTextColor]];
[self.writeSomethingLabel setFont:[UIFont gLBaskervilRegularWithSize:12.0f]];

Is there a way with reactiveCocoa to merge them and configure them in the same block ?

Dimillian
  • 3,616
  • 4
  • 33
  • 53
  • No, you don't need Reactive Cocoa for doing such simple tasks. Reactive Cocoa is a tool to find solutions for complex asynchronous problems. Your problem is neither asynchronous nor complex, and I wouldn't take a deep look into Reactive Cocoa unless you really have a complex asynchronous problem which you cannot solve easily otherwise. ;) – CouchDeveloper Mar 19 '14 at 09:38
  • Yeah I know, I should have stated I use it for much more complicated stuff and I really like it. Now I wanted to knows if there was something I could use for that :) – Dimillian Mar 19 '14 at 09:53

1 Answers1

2

This isn't a ReactiveCocoa problem. Just factor out the common code (-setTextColor: and -setFont:) into a reusable method or block and invoke that twice.

Justin Spahr-Summers
  • 16,893
  • 2
  • 61
  • 79
  • Yeah thank you, the fact is, I was so exited when testing ReactiveCocoa on a new project that I've tried to solve everything with it, I quickly realised for what it was made for. Still awesome! – Dimillian Mar 20 '14 at 21:30
  • Justin, I am sorry for having disturbed you, but I couldn't find another way to connect. Can you please look at this question: http://stackoverflow.com/questions/24576833/what-is-a-correct-alternative-for-subscribing-to-signals-in-reactivecocoa-for-ne ? I hope you will advice some good practice for this common problem. Because I couldn't find any info about this. Great thanks in advance! – MainstreamDeveloper00 Jul 04 '14 at 18:22