Is there any way that could send the value in Class of ViewController to Class of View? Because I want to make a drawing board and I made a modal scene to set values about color, width . I know how to send the value in modal scene to my ViewController , but now I need use those value in Class of View , or not Class of ViewController.
2 Answers
Sounds like you need to devise a protocol to open a delegation channel between the two classes. Then when the modal VC wants to send data to its delegate (its presenter, in this case), it can of its own volition.

- 1,340
- 1
- 12
- 25
The View Controller can have a reference to the View, therefore the View Controller can simply pass the values to View by calling a View's method or updating View's properties. This is a common pattern: View defines a Protocol and data/requests from View to ViewController go through this Protocol (the ViewController acts as delegate of View); and ViewController owns the View.
For inspiration on how to implement a farily decoupled design applying this pattern, you can have a look at documentation on UICollectionView
and UICollectionViewController
.
Other options, depending on what design you need, are Key-Value Observing or Notifications.

- 1,235
- 10
- 23