title: ios pass data between custom view and view controller
body: <p>I'm a beginner in iOS development. I have a custom view:</p>
  
  <pre><code>@interface MyView : UIView {
  </code></pre>
  
  <p>In the ViewController, I add this view as a subview (would be better to do in another way, maybe in the Storyboard?):</p>
  
  <pre><code>MyView *myView = [[MyView alloc]initWithFrame:myFrame];
  [self.view addSubview:myView];
  </code></pre>
  
  <p>in it, I follow the touches on screen, and I have a touchesEnded method:</p>
  
  <pre><code>-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
  {
      // myValue is a class variable of MyView
      myValue = doSomething();
  }
  </code></pre>
  
  <p>Now, how can I get the value of <code>myValue</code> in the ViewController? Maybe a listener or a callback that can be invoked inside <code>touchesEnded</code> in MyView?</p>