【发布时间】:2018-11-08 20:40:03
【问题描述】:
我使用以下代码显示视图控制器,我使用标识符属性识别 segue。此代码在 swift3 中运行良好,但在更新到 swift4 时出现以下错误
无法转换“NSStoryboardSegue.Identifier”类型的值?到预期的参数类型“字符串”
override func prepare(for segue: NSStoryboardSegue, sender: Any?) {
if (segue.identifier == "segue") {
//get a reference to the destination view controller
let destinationVC:ProgressView = segue.destinationController as! ProgressView
//set properties on the destination view controller
destinationVC.fileArray=fileArray
destinationVC.croptype=croptype
destinationVC.outdir=outdir
destinationVC.fileformat=fileformat
destinationVC.tflag=tflag
if(resize==true)
{
destinationVC.resize=true
destinationVC.rwidth=rwidth
destinationVC.rheight=rheight
destinationVC.preserve_aspect_ratio=preserve_aspect_ratio
}
}
}
请指教
【问题讨论】:
标签: macos storyboard segue swift4