내가 예를 들어 내 ViewController.swift에서이 클래스 ... 신속한 액세스 변수
class Person {
internal let name: String
init(name: String) {
self.name = name
}
}
class ViewController: UIViewController {
}
내 SecondViewController에 내가
override func viewDidLoad() {
super.viewDidLoad()
let person = Person(name: "")
println(person.name)
}
이가 어떻게 값 a를 할당 할 수있다 보기 컨트롤러 클래스의 내부 이름?
이것은 당신이 ([1]이 질문을 게시하는 3 시간 http://stackoverflow.com/questions/26980929/ swift-take-a-second-file-buttonviewcontroller-swift) [2] (http://stackoverflow.com/questions/27048766/swift-access-controll-example). 지금 내가 두 번째 질문에 대답하려고했지만 실제로 무엇을 요구하는지 파악할만큼 충분한 세부 정보를 제공하지 않는다는 것을 깨닫는다. – Antonio
내 Class ViewController에서 이름에 값을 지정하기 만하면된다 .please –