I am a new iOS programming. I am creating a simple which integrate with Firestore. In Firestore i created collection and each documents contains many fields.
I have added Timestamp field in my document. And when i create model in xcode how can i declare my variable as Timestamp because i need to sort data on tableView base on Timestamp.
This is how Timestamp in Firestore looks like:
September 17, 2018 at 3:37:43 PM UTC+7
So, How can i write program and get current Timestamp like showing in Firestore
This is in programming:
struct RecentCallModel {
var call_answered: Bool?
var call_extension: String?
var call_type: String?
var details: String?
var duration: String?
var title: String?
// How can i declare as Timestamp
var timestamp: ???
init(call_answered: Bool, call_extension: String, call_type: String, details: String , duration: String, timestamp: String, title: String) {
self.call_answered = call_answered
self.call_extension = call_extension
self.call_type = call_type
self.details = details
self.title = title
}
}