Как переопределить один вид перехода в коде?IOS

Программируем под IOS
Ответить
Anonymous
 Как переопределить один вид перехода в коде?

Сообщение Anonymous »

Просто у меня есть один переход к роду show от FirstViewController к SecondViewController . Я называю его на iPad и iPhone из двух мест моего FirstViewController . Это нормально, но в одном случае мне нужно представить SecondViewController как .popover .

Код: Выделить всё

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

if let secondViewController = segue.destinationViewController as? SecondViewController {

if let cell = sender as? UITableViewCell, indexPath = tableView.indexPathForCell(cell) {

let student = fetchedResultsController.objectAtIndexPath(indexPath) as! Student
secondViewController.schoolClass = schoolClass
secondViewController.student = student

} else {

secondViewController.modalPresentationStyle = .Popover
secondViewController.schoolClass = schoolClass

let popoverPresentationController = studentFormViewController.popoverPresentationController
popoverPresentationController!.delegate = self
popoverPresentationController?.permittedArrowDirections = .Up
popoverPresentationController?.barButtonItem = addStudentBarButtonItem
}
}
}
Это не работает.>

Подробнее здесь: https://stackoverflow.com/questions/378 ... ue-in-code
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»