我在Main.storyboard
中有一个条形按钮项目,单击时添加了一些操作,我的代码审阅者希望我将UIAlertAction
放入Main.storyboard
中,而不是将其添加到代码中,我想知道这是否合适吗?如果是,有什么办法可以做到?我找不到UIAlertAction
对象。
- (IBAction)openFileUIBarButtonItem:(UIBarButtonItem *)sender {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *pickFileButton = [UIAlertAction actionWithTitle:@"Pick A File"
//......
}
最佳答案
不,您不能在UIAlertController
中添加UIAlertAction
和Main.storyboard
...。只需像上面所做的那样,尝试通过编程方式将其添加。
关于ios - 是否可以在Main.storyboard中添加UIAlertController和UIAlertAction,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44780129/