有没有办法让我检查并查看用户在打开应用程序时是否登录到iCloud?如果他们没有登录,我希望能够将他们引导到设置页面,如果他们登录到iCloud并且之前使用过该应用程序 - 我想跳过登录页面....
我查看了Apple的iCloud和Cloudkits文档,但无法找到任何有用的东西!这甚至可能吗?
我试图UIStackViews在我的ViewController边界中分开5个.我给他们每个人一个IBOutlet,然后打电话给他们viewDidLoad使用该layer财产但无济于事.是不可能以编程方式给出堆栈视图边框?
码:
@IBOutlet weak var stackView1: UIStackView!
@IBOutlet weak var stackView2: UIStackView!
@IBOutlet weak var stackView3: UIStackView!
@IBOutlet weak var stackView4: UIStackView!
@IBOutlet weak var stackView5: UIStackView!
override func viewDidLoad() {
super.viewDidLoad()
stackView1.layer.borderWidth = 5
stackView2.layer.borderWidth = 5
stackView3.layer.borderWidth = 5
stackView4.layer.borderWidth = 5
stackView5.layer.borderWidth = 5
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用两个不可编辑的UITextField显示名称和年龄。我的导航栏中有一个“ 编辑” UIBarButtonItem,我希望它能够在UITextField按下该按钮时触发使其可编辑。
在我的界面生成器中,未选中两个UITextField的“启用用户交互”选项。我需要添加ageText.UserInteractionEnabled = true吗?我在这里茫然。
class UserProfileVC: UIViewController,
UITextFieldDelegate, UINavigationControllerDelegate {
@IBOutlet weak var infoBorder: UILabel!
@IBOutlet weak var nameText: UITextField!
@IBOutlet weak var ageText: UITextField!
var textFields:[UITextField] = []
@IBAction func editButton(sender: UIBarButtonItem) {
nameText.becomeFirstResponder()
ageText.becomeFirstResponder()
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
var currentTextField = textFields[0]
if (currentTextField == textField) {
currentTextField = textFields[1]
currentTextField.becomeFirstResponder()
} else {
currentTextField.resignFirstResponder()
}
return true
}
}
Run Code Online (Sandbox Code Playgroud)