What is the approach to shuffle an array of strings one time a day?
And not every time the app is relaunches.
struct View: View {
@ObservedObject var quotes = Quotes()
var body: some View {
List {
ForEach(quotes.shuffled()) { quote in
Text(quote.quotes)
}
}
}
}
When I try the shuffled()
method every time the view is updated the quotes are shuffled again, also when relaunching the app, I want to shuffle the array only one time a day.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…