title: How can I create a wrapper to use blocks for a class that uses callbacks?
body: <p>I'm diving into iOS programming and I'm learning how to use blocks. I have a sucky, over-engineered library that I'm using in my project and it uses a single callback method to handle all data requests...</p>
  
  <pre><code>@protocol SuckyClassDelegate &lt;NSObject&gt;
  -(void)returnedSuckyData:(NSMutableDictionary*)data;
  @end
  
  @interface SuckyClass: NSObject
  @property (nonatomic, weak) id&lt;SuckyClassDelegate&gt; delegate;
  -(void)getSuckyData;
  @end
  
  @interface MyViewController: UIViewController &lt;SuckyClassDelegate&gt;
  -(void)requestDataFromSuckyClass;
  @end
  </code></pre>
  
  <p>I'd like to create a wrapper class for the SuckyClass that allows me to use blocks when I need to access data from the SuckyClass, but I don't know how to do this.  I'd like to have something like this...</p>
  
  <pre><code>@interface SuckyClassWrapper
  - (void)requestDataWithSuccessBlock:(void(^)((NSMutableDictionary*)data))successBlock;
  @end
  
  @implementation MyViewController
  -(void)requestDataFromSuckyClass {
     SuckyClassWrapper *wrapper = [[SuckyClassWrapper alloc] init];
     [wrapper requestDataWithSuccessBlock:^(NSMutableDictionary *data) {
         NSLog(@"%@", data);
     }
  }
  @end
  </code></pre>
  
  <p>...but I can't figure out how to convert the callback process into blocks. Can anyhow give me some direction here?</p>
  
  <p>Thanks in advance for your wisdom!  </p>
  
  <p>By the way, I just whipped up the code without testing it, so I apologize if there are any typos.</p>