[CHANGE] Overhaul of the AppDetailView with version history, reviews & ratings, and app information

This commit is contained in:
Fabian Thies
2023-01-31 22:38:42 +01:00
parent 3f06a53058
commit e85876cd24
10 changed files with 395 additions and 69 deletions

View File

@@ -16,6 +16,20 @@ struct DateFormatterHelper {
dateComponentsFormatter.collapsesLargestUnit = false
return dateComponentsFormatter
}()
private static let relativeDateFormatter: RelativeDateTimeFormatter = {
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .abbreviated
return formatter
}()
private static let mediumDateFormatter: DateFormatter = {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .none
return dateFormatter
}()
static func string(forExpirationDate date: Date) -> String {
@@ -32,10 +46,11 @@ struct DateFormatterHelper {
self.appExpirationDateFormatter.unitsStyle = .full
self.appExpirationDateFormatter.allowedUnits = [.day]
}
return self.appExpirationDateFormatter.string(from: startDate, to: date) ?? ""
}
return self.appExpirationDateFormatter.string(from: startDate, to: date) ?? ""
}
static func string(forRelativeDate date: Date, to referenceDate: Date = Date()) -> String {
self.relativeDateFormatter.localizedString(for: date, relativeTo: referenceDate)
}
}