Josh Kahane
Josh Kahane

Reputation: 17169

Best Way to Add Object Via Other Class?

In my iPhone app, I have a custom UIViewController class setup which adds some UIImageViews and things.

How can I access this class via my main UIViewController and, for example, call a method from that outside class and have it add those UIImageViews to the view?

Upvotes: 1

Views: 36

Answers (1)

beryllium
beryllium

Reputation: 29767

Make property and public methods, after that you can call them in target viewcontroller.

p.s. But I never used this approach because it breaks controller's logic. Instead of I usually use some managers which has all required methods. (DBManager, NetworkManager, etc)

Upvotes: 1

Related Questions