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 )
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) ...
Website Development Service
ReplyDeleteMobile App Development Service
E-Commerce Website Development Service
Android App Development Service
Website Designing Service
iOS App Development Service
All Country Flags
Flags of all Countries
National Flags
Ahir Rishabh