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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -