我已经环顾了一下,但没有在swift 3中找到快速答案.我今天平日就像这样:
let weekday = Calendar.current.component(.weekday, from: Date())
Run Code Online (Sandbox Code Playgroud)
但相反,我想获得给定日期的工作日.这是怎么做到的?感谢名单
我有一个警报,在显示警报后,我想呈现一个不同的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)