我使用accessoryButtonTappedForRowWith
:
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let popoverContent = storyboard.instantiateViewController(withIdentifier: "Test")
popoverContent.modalPresentationStyle = .popover
if let popover = popoverContent.popoverPresentationController {
let viewForSource = self.createCharacterView as UIView
popover.sourceView = viewForSource
// the position of the popover where it's showed
popover.sourceRect = viewForSource.bounds
// the size you want to display
popoverContent.preferredContentSize = CGSize(width: 200,height: 200)
popover.delegate = self
}
self.present(popoverContent, animated: true, completion: nil)
弹出窗口工作正常,只是我呈现的viewController需要tableViewCell的标签。我能够获得变量,但是我不确定如何将变量传递给popover,因为没有调用segue我不认为我能够使用prepare(for segue: UIStoryboardSegue, sender: Any?)
。
答案 0 :(得分:0)
太简单了:
[Int]() is [String] // true
[1] is [String] // false
答案 1 :(得分:0)
您可能需要将popOvercontent转换为特定的viewController
$ANDROID_HOME/tools/