In the storyboard, you had an option when you select the tab bar and change the tint color to your selection color in the tab bar.
The above screenshot will show you the options to change the background color of the tabbar as well as the selection color(it was displayed as tintcolor) in the tabbar.
We cannot convert string directly to NSNumber. So we will convert string to Int then convert Int to NSNumber. Code: NSNumber (value: Int ( "String" )!)
Problem: I want to store CGPoint in userdefaults.How can i achieve that? Solution: You have to convert the cgpoint to string then save it in userdefaults. // MARK: - set and get the Add button frame func getBtnBounds ()-> CGPoint ? { if let obj = self . userDefaults . object ( forKe y : "BtnBounds" ) as ? String { let point = NSCoder . cgPoint ( for :obj) return point } else { return nil } } func setBtnBounds ( value : CGPoint ) { let pointValue = NSCoder . string ( for : value) ...
Comments
Post a Comment