小编Mar*_*dic的帖子

从日期获得工作日 - 斯威夫特3

我已经环顾了一下,但没有在swift 3中找到快速答案.我今天平日就像这样:

let weekday = Calendar.current.component(.weekday, from: Date())
Run Code Online (Sandbox Code Playgroud)

但相反,我想获得给定日期的工作日.这是怎么做到的?感谢名单

xcode date swift3

32
推荐指数
4
解决办法
3万
查看次数

警报完成不完全正常

我有一个警报,在显示警报后,我想呈现一个不同的viewFinder.触发doSomething()函数,打印"TEST",但不显示新的取景器.我错过了什么?

警报

let alert = UIAlertController(title: "Sorry", message: "Booked out.",
preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style:
UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: self.doSomething)
Run Code Online (Sandbox Code Playgroud)

content func doSomething()

print("TEST")
let details = storyboard?.instantiateViewController(withIdentifier: "ViewLimo2")
details?.transitioningDelegate = slideAnimatorRight
present(details!, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

storyboard ios swift uialertcontroller

1
推荐指数
1
解决办法
390
查看次数

标签 统计

date ×1

ios ×1

storyboard ×1

swift ×1

swift3 ×1

uialertcontroller ×1

xcode ×1