ios - UITextField customization in AppDelegate not working for Swift -
i want customise textfields @ once via appdelegate , had tested customisation working on individual viewcontrollers when add customisation through appdelegate not appears. please guide me have missed :
func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { uitextfield.appearance().layer.borderwidth = 2 uitextfield.appearance().layer.bordercolor = uicolor(red:0.094 , green:0.737 , blue:0.612 , alpha:1).cgcolor return true }
i found solution , thanx @nannav. rather customising textfield in appdelegate, should create new class :
class mycustomtextfield: uitextfield { required init(coder adecoder: nscoder) { super.init(coder: adecoder) self.layer.borderwidth = 2 self.layer.bordercolor = uicolor(red:0.094 , green:0.737 , blue:0.612 , alpha:1).cgcolor }
}
later in storyboard have assign mycustomtextfield in customclass textfields wanted customise
Comments
Post a Comment