i have a uiview file that i embedded into my tableview header
(class TopHeader: UIView, UICollectionViewDelegate, UICollectionViewDataSource)
If I use present(_:animated:completion:) i am getting: Value of type TopHeader has no member 'present'
( self.present(MyOtherViewController(doModes: [.photo]), animated: true, completion: nil))
How can I use the present method from there? Can I call a function that is in my uiviewcontroller from this uiview file?
You can't call present(_:animated:completion) because it is a method of UIViewController, not UIView.
You shouldn't be presenting view controllers from views directly. If you need this behavior, it would be better to use a UIViewController instead of a UIView since the view controller will contain a view within it anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With