0
votes

In my project i have an UIView instance and attached a gesturerecognizer to it. In case that gesture is recognized i want to call its parent viewcontroller to reorganize the scene.

Here's how it's implemented

The UIViewController is called HomeViewController. It has one subview which is a UIScrollview. The UIScrollView contains several UIView instances.

To all of these UIView instances i attached a gesture recognizer. When it fires i want to disappear and call the HomeViewController's reOrganizeUI method.

My problem is that i can't reach the HomeViewController from the UIViews.

Is there a way to do this?

Sincerely, Zoli

1

1 Answers

1
votes

Surely you can. The simplest way to do this is to add a property to all your UIView subclasses and assign your HomeViewController to that property when creating the views in the view controller's initialization method. Then you'll be able to access the controller from the views directly.