title: How can I get my UISwitch to do something?
body: <p>How can I get my UISwitch to call this function: <a href="https://ghostbin.com/paste/y2xrc" rel="nofollow">https://ghostbin.com/paste/y2xrc</a> when turned on, and return FALSE; when it is turned off. </p>
  
  <p>(I got the switch to show inside "CKTranscriptCollectionViewController" in the Messages.app (MobileSMS.app), and now I want it to do something when turned on or off which is what I posted in the link above).</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;ChatKit/CKConversation.h&gt;
  
  @interface CKTranscriptCollectionViewController : UIViewController
  @property (nonatomic, strong) UISwitch *mySwitch;
  - (void)loadView;
  @end
  
  %hook CKTranscriptCollectionViewController
  
  - (void)viewDidLoad {   
      %orig;
      UISwitch *mySwitch = [[UISwitch alloc] initWithFrame:CGRectMake(10, 10, 51, 31)];
      [mySwitch setOn:NO animated:YES];
      [self.view addSubview:mySwitch];
  }
  
  %end
  </code></pre>