Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import Foundation
  2.  
  3. class SearchItem {
  4. var attributedCityName: NSMutableAttributedString?
  5. var attributedCountryName: NSMutableAttributedString?
  6. var allAttributedName : NSMutableAttributedString?
  7.  
  8. var cityName: String
  9. var countryName: String
  10.  
  11. public init(cityName: String, countryName: String) {
  12. self.cityName = cityName
  13. self.countryName = countryName
  14. }
  15.  
  16. public func getFormatedText() -> NSMutableAttributedString{
  17. allAttributedName = NSMutableAttributedString()
  18. allAttributedName!.append(attributedCityName!)
  19. allAttributedName!.append(NSMutableAttributedString(string: ", "))
  20. allAttributedName!.append(attributedCountryName!)
  21.  
  22. return allAttributedName!
  23. }
  24.  
  25. public func getStringText() -> String{
  26. return "\(cityName), \(countryName)"
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement