期望酥料餅的輸出:編程創建酥料餅的菜單斯威夫特
我試圖教程here以下。不過,我似乎無法得到這個工作
目前代碼:
func adaptivePresentationStyleForPresentationController(
controller: UIPresentationController!) -> UIModalPresentationStyle {
return .None
}
@IBAction func UploadClicked(sender: AnyObject)
{
let menuViewController = MenuViewController()
menuViewController.modalPresentationStyle = .Popover
menuViewController.preferredContentSize = CGSizeMake(50, 100)
let popoverMenuViewController = menuViewController.popoverPresentationController
popoverMenuViewController?.permittedArrowDirections = .Any
popoverMenuViewController?.delegate = self
popoverMenuViewController?.sourceView = sender
popoverMenuViewController?.sourceRect = CGRect(
x: location.x,
y: location.y,
width: 1,
height: 1)
presentViewController(
menuViewController,
animated: true,
completion: nil)
}
使用未解析的標識符menuviewcontroller
使用未解決的標識位置的
請使用正確的大小寫的錯誤信息,是可變的丟失或類!? – luk2302