0
我想将数据从一个UIView传递到另一个UIView,以便访问根据用户选择的UITabBarItem而不同的网站。我该怎么做?以segue形式传递数据UITabBarItem不起作用
func pathButton(dcPathButton: DCPathButton!, clickItemButtonAtIndex itemButtonIndex: UInt) {
switch itemButtonIndex {
case 0:
// working but can’t send data with it
self.performSegueWithIdentifier("goto", sender: self)
// not working as function is not trigger
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if segue.identifier == "goto" {
let vc = segue.destinationViewController as! WebMainViewController
vc.goURL = "http://google.com“
dcPathButton.delegate = self
println(“go to http//google.com”)
}
case 1:
println(“go to http://apple.com”)
case 2:
println(“go to http://imbd.com”)
case 3:
println(“go to http://facebook.com”)
default:
println(“go to http://cnn.com”)
}