我正在尝试隐藏用户名文本字段,当切换到登录时从寄存器登录并在切换回时再次显示.我正在编写UI,我想知道如何隐藏文本字段,我是swift的新手,我认为有两个地方可以插入代码来隐藏用户名文本字段.如果没有请告诉我,谢谢!
我试图隐藏的图像. 
这里是UISegmentedControl
lazy var loginRegisterSegmentControl: UISegmentedControl = {
let sc = UISegmentedControl(items: ["Login", "Register"])
sc.translatesAutoresizingMaskIntoConstraints = false
sc.tintColor = UIColor.white
sc.selectedSegmentIndex = 1
sc.addTarget(self, action: #selector(handleLoginRegisterChange), for: .valueChanged)
return sc
}()
Run Code Online (Sandbox Code Playgroud)
或者在HeightAnchor Change中
nameTextFieldHeightAnchor?.isActive = false
nameTextFieldHeightAnchor = nameTextField.heightAnchor.constraint(equalTo: inputContainerView.heightAnchor, multiplier: loginRegisterSegmentControl.selectedSegmentIndex == 0 ? 0 : 1/3)
nameTextFieldHeightAnchor?.isActive = true
Run Code Online (Sandbox Code Playgroud) 我正试图运行这个......
platform :ios. '9.0'
use frameworks!
pod 'Firebase', '>= 2.5.0'
Run Code Online (Sandbox Code Playgroud)
但我一直在pod安装上得到这个
[!] Invalid `Podfile` file: syntax error, unexpected tSTRING_BEG, expecting '('
platform :ios. '9.0'
^. Updating CocoaPods might fix the issue.
Run Code Online (Sandbox Code Playgroud)