daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top