在Apple TV宣布期间,Crossy Road的开发人员使用iPhone作为Apple电视游戏的第二控制器:
http://www.macrumors.com/2015/09/09/cooperative-play-for-crossy-road/
我的第一个想法是使用Multipeer Connectivity Framework实现这一点.但是,它不支持tvOS.有没有一种很好的方法可以在没有Multipeer Connectivity的情况下将iPhone连接到Apple TV?
更新:似乎我不能使用GameKit,因为GKPeerPickerController已从tvOS上的GameKit中删除.
I'm trying to store a time of day in a Date:
let calendar = NSCalendar.init(identifier: .gregorian)
let components = NSDateComponents()
components.hour = 7
components.minute = 0
var newDate = calendar?.date(from: components as DateComponents)!
print(newDate!)
Run Code Online (Sandbox Code Playgroud)
However, this yields some bizarre results when I try to print or otherwise use the value. Here's a Swift Playground of the results:
How can newDate be both 7:00AM and 11:56AM at the same time?