1
0
mirror of https://github.com/yattee/yattee.git synced 2025-01-07 18:10:33 +05:30
yattee/Model/SearchQuery.swift

23 lines
615 B
Swift
Raw Normal View History

2021-07-08 04:09:18 +05:30
import Foundation
final class SearchQuery: ObservableObject {
@Published var query: String
2021-07-08 20:44:54 +05:30
@Published var sortBy: SearchSortOrder = .relevance
@Published var date: SearchDate? = .month
2021-07-08 04:09:18 +05:30
@Published var duration: SearchDuration?
@Published var page = 1
init(query: String = "", page: Int = 1, sortBy: SearchSortOrder = .relevance, date: SearchDate? = nil, duration: SearchDuration? = nil) {
self.query = query
self.page = page
self.sortBy = sortBy
self.date = date
self.duration = duration
}
2021-07-12 02:22:49 +05:30
var isEmpty: Bool {
query.isEmpty
}
2021-07-08 04:09:18 +05:30
}