0
您好,我正在做Udacity nanodegree,我正在使用textFields,但我需要使用以UITextField作为参数的方法来减少代码。 我其实我不知道这个方法可能是什么,我也不知道如何减少代码。 我会让你的代码,并希望你能帮助我使用方法减少代码
let memeTextAttributes = [
NSStrokeColorAttributeName : UIColor.blackColor(), NSForegroundColorAttributeName : UIColor.blueColor(), NSFontAttributeName : UIFont(name: "HelveticaNeue-CondensedBlack", size: 40)!, NSStrokeWidthAttributeName : -1.0]
override func viewDidLoad() {
super.viewDidLoad()
topText.defaultTextAttributes = memeTextAttributes
bottomText.defaultTextAttributes = memeTextAttributes
topText.textAlignment = NSTextAlignment.Center
bottomText.textAlignment = NSTextAlignment.Center
shareButton.enabled = false
你得到它的工作: 例如,文本框底部会在
viewDidLoad
的叫什么? – thegrandhi