你怎样将数据对象从 Objective C 文件传递到 Swift 文件?
在 Swift 视图中:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([[segue identifier] isEqualToString: @"details"]){
//create the swift file and set the property I want to pass here
}
}
在 Swift 视图中:
import Foundation
import UIKit
import CoreLocation
public class SwiftViewController: UIViewController{
var passedObject:NPSCustomObject!
public override func viewDidLoad() {
}