Open jacks205 opened 9 years ago
Hi jack,
Did you import the .bundle folder into your project? It was also returning an empty string for me before I do it.
No I just added the pod. That could be the issue.
Under Cocoapods and Swift you are likely using use_frameworks. The currently released version on Cocoapods uses the main bundle as the location for the resource bundle, which will be broken when frameworks are used.
This issue seems to be fixed in the most recent master branch, so as a workaround until it's released, try a git repo line in your Podfile
@jacks205 is empty string issue resolved? As i am still getting it. Thanks
@shafqat-muneer I'm not sure about the state of the pod, but I opted using this fuction someone put into a gist.
let dateFormatter: NSDateFormatter = NSDateFormatter() dateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") dateFormatter.timeZone = NSTimeZone(abbreviation: "UTC") dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSX" if let date = dateFormatter.dateFromString(dateString) { // I get valid a NSDate object }
I am calling timeAgo from NSDate and it returns an empty string.
I tried to debug the Swift extension and found it gets an empty string there.
This is how I am creating my NSDate if it is important: