В быстром файле вашей пользовательской ячейки напишите протокол, который будет соответствовать вашему viewContoller,
// your custom cell's swift file
protocol CustomCellDelegate {
func showActionSheet()
}
class CustomTableViewCell : UITableViewCell {
var delegate: CustomCellDelegate?
// This is the method you need to call when button is tapped.
@IBAction func buttonTapped() {
// When the button is pressed, buttonTapped method will send message to cell's delegate to call showActionSheet method.
if let delegate = self.delegate {
delegate.showActionSheet()
}
}
}
// Your tableViewController
// it should conform the protocol CustomCellDelegate
class MyTableViewController : UITableViewController, CustomCellDelegate {
// other code
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("CustomCellReuseIdentifier", forIndexPath: indexPath)
// configure cell
cell.delegate = self
return cell
}
// implement delegate method
func showActionSheet() {
// show action sheet
}
}
Убедитесь, что ваш контроллер просмотра соответствует протоколу CustomCellDelegate и реализует метод showActionSheet ().
Назначьте свой viewContoller как делегат пользовательской ячейки при создании ваших ячеек в методе dataSource cellForRowAtIndexPath.
Вы можете представить свой новый контроллер представлений из метода showActionSheet в viewController.
Я смог найти ответ на этот вопрос после поиска в firebase-admin-node
выпусках GitHub :
Я добавил файл .npmrc
в корень моего проекта и добавил unsafe-perm=true
как единственная строка в файле. Развернули и все работало нормально.
Основная проблема была связана с разрешениями пользователей на установку gprc
, что подробно описано в ссылке выше.