show alertController from a custom class
问题 I'm trying to show an AlertController from a class that I've made. Since AlertController is a subclass of UIResponder I'm using the following line of code that Xcode is suggesting me superclass?.presentViewController(alertController, animated: true, completion: nil) But I cannot compile because AnyClass? does not have any member presentViewController. My class is a subclass of NSObject. Any other solution? Thanks 回答1: Well you just need to find the topmost view controller and present the