【发布时间】:2017-09-11 18:59:22
【问题描述】:
我有一个 UITextView,我需要每天为数组中的下一个“字符串”更改 2 次(每 12 小时一次)。 我这里有一些需要与 Date 和 UITextView 一起使用的数组。 我需要如何使用日历? 我的简单问题是“我需要做什么?”
@IBOutlet var ThisTextView: UITextView!
var array = ["a","b","c","d"]
var lastDate: Date?
var currentDate = Date()
override func viewDidLoad() {
super.viewDidLoad()
if currentDate == lastDate {
// we do nothing
} else {
// we change string to the next in array using some function
// or we write this function here
}
【问题讨论】: