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" )!)
Code: String (describing: nsnumbervalue ) (or) String (nsnumbervalue ) The above code is used to convert the NsNumber to String. NSDate To String String (describing: Date ) Combine NsNumber and string to String Code: String ( " \ ( nsnumbervalue ) km" ) Convert Float to String Code: String (describing: floatvalue )
If you are using location based values in all the screen of apps then its a better to implement as a singleton class.First import the core location.The class will be as follows. Code: import UIKit import CoreLocation protocol LocationServiceDelegate { func tracingLocation(currentLocation: CLLocation ) func tracingLocationDidFailWithError(error: NSError ) } class LocationSingleton: NSObject , CLLocationManagerDelegate { var locationManager: CLLocationManager ? var lastLocation: CLLocation ? var delegate: LocationServiceDelegate ? static let sharedInstance: LocationSingleton = { let instance = LocationSingleton () return instance }() override init () { super . init () self . lo...
Comments
Post a Comment