小编Aar*_*ker的帖子

在tvOS应用程序中使用iPhone作为游戏控制器?

在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中删除.

objective-c ios apple-tv multipeer-connectivity tvos

21
推荐指数
3
解决办法
4669
查看次数

Swift - Date from components is incorrect when printed. Date has 2 values?

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?

nscalendar nsdatecomponents swift

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