objective c - How to navigate from UIView to UIViewController -
I know that uiview does not have navigation controls. In this way, I can not push uiview into the next uiviewcontroller .
Here is the code of my method, please help. Thanks!
- (zero) ScrollviewPlayed: (UITapGestureRecognizer *) Identifier {CGPoint pointInView = [identifier location: view: self]; NSLog (@ "% f,% f", pointInView.x, pointInView.y); If ((pointInView.x> = (231.0) and PointInView.x & lt; = (293) & PointInView.y & gt; = (193) & amp; Amp; PointInView.y & lt; = (218))) // How to push the next viewing controller here? UIView * View = [UIGestureRecognizer view]; // What should I do for this code? [View Yourself Controller]; }} - (TestViewViewController *) viewController {for (UIView * next = [self supervisor]; next; next = next. Supervive) {UIResponder * nextResponder = [next next responder]; If ((Next Respondent, HackandoffClass: [Test Viewview Controller Class]]) {Return (Test WeaveView Controller *) Next Respondent; }} Return zero; } If you want to see the viewcontroller, then you NextResponder method First you get the view from the gesture converter:
UIView * view = [gesture identifier];
Edit:
if ((pointInView.x> = (231.0) and PointInView.x & lt; = (293) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; & Gt; = (193) & amp; Amp; PointInView.y & lt; = (218))) // How to push the next viewing controller here? UIView * View = [Identifier view]; // What should I do for this code? UIViewController * viewController = [Self getViewControllerFromView: view]; If (viewController) {// whatever you want ... UIViewController * newViewController = ... [viewController.navigationController pushViewController: newViewController Animated: Yes]; }} ... I can see the method again in ViewController in my case. To get it from some view:
- (UIViewController *) getViewControllerFromView: (UIView *) View {if ([[next viewer viewer] iskindoff class: [UIViewController class]]) { Return (UIViewController *) [see nextResponder]; } Else {for (UIView * next = [view superview]; next; next = next. Supervive) {UIResponder * nextResponder = [next next responder]; If ((Next Respondent is Kind of Class: [UIViewController Class]]) {Return (UIViewController *) nextResponder; }}} Return zero; } UIViewController * viewController; Add @ synthesis view controller = _viewController; .m file from CoreMotionAppDelegate :: MainViewController * itemsViewController = [[[Main View Controller Alloc] init]; UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController: itemsViewController]; GlView.viewController = ItemView Controller; [GlView Startup Permission]; [[Self window] Setupview controller: Nine controllers]; and from your scrollViewDoubleTapped method EAGLView * v = (EAGLView *) [identifier view]; UIViewController * viewController = v.viewController;
Comments
Post a Comment