         if let delimiter = delimiter {
             trimmingCharacters += delimiter
         }
-        return age.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: trimmingCharacters))
+        return age.trimmingCharacters(in: CharacterSet(charactersIn: trimmingCharacters))
     }
     
 }

        var age = ""
        
        if years != 0 {
            var formattedString = langBundle.localizedStringForKey("yy", value: "%d years", table: "YLMomentRelativeTimeLocalizable")
            if years == 1 {
                formattedString = langBundle.localizedStringForKey("y1", value: "%d year", table: "YLMomentRelativeTimeLocalizable")
            }
            if maxComponents > 0 {
                age = NSString(format: formattedString, years) as String
                age += (delimiter != nil) ? (delimiter! as String + " ") : " "
                maxComponents--
            }
        }
        
        if months != 0 {
            var formattedString = langBundle.localizedStringForKey("MM", value: "%d months", table: "YLMomentRelativeTimeLocalizable")
            if months == 1 {
                formattedString = langBundle.localizedStringForKey("M1", value: "%d month", table: "YLMomentRelativeTimeLocalizable")
            }
            if maxComponents > 0 {
                age += NSString(format: formattedString, months) as String
                age += (delimiter != nil) ? (delimiter! as String + " ") : " "
                maxComponents--
            }
        }
        
        if age.characters.count == 0 || days != 0 {
            var formattedString = langBundle.localizedStringForKey("dd", value: "%d days", table: "YLMomentRelativeTimeLocalizable")
            if days <= 1 {
                formattedString = langBundle.localizedStringForKey("d1", value: "%d day", table: "YLMomentRelativeTimeLocalizable")
            }
            if maxComponents > 0 {
                age += NSString(format: formattedString, days) as String
            }
        }
        

    }
    
    public func ageFromNow(withDelimiter delimiter: String? = nil) -> String {
        return ageFromDate(Date(), withDelimiter: delimiter)
    }

    /// Return the age, as a pretty string, between date and this moment
