我想打开一个Tweetbot动作控制器,它在XLActionController中作为示例显示:
let actionController = TweetbotActionController()
actionController.addAction(Action("View Details", style: .default, handler: { action in
// do something useful
}))
actionController.addAction(Action("View Retweets", style: .default, handler: { action in
// do something useful
}))
actionController.addAction(Action("View in Favstar", style: .default, handler: { action in
// do something useful
}))
actionController.addAction(Action("Translate", style: .default, executeImmediatelyOnTouch: true, handler: { action in
// do something useful
}))
actionController.addSection(Section())
actionController.addAction(Action("Cancel", style: .cancel, handler:nil))
present(actionController, animated: true, completion: nil)
我创建了TweetbotActionController
的实例,但提示以下错误:
Use of unresolved identifier 'TweetbotActionController'
答案 0 :(得分:0)
根据docs,确保您拥有Podfile,如:
use_frameworks!
target '<Your App Target>' do
pod 'XLActionController'
pod 'XLActionController/Tweetbot'
end
以使用提供的示例。