Tag: 手写笔

在模拟器中模拟苹果铅笔似乎是可能的

我想知道是否有可能在iOS模拟器中模拟Apple铅笔。 根据苹果emloyee在这里Xcode iOS模拟器:我可以使用鼠标作为假装苹果铅笔input(iPad Pro上),进行testing? 这不可能。 答案是在2017年6月。 根据https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/ (非常最后一段: Windows中的触笔支持也被转换为模拟器上的Apple Pencilinput ),使用远程iOS来自Xamarin的模拟器,可以模拟铅笔。 (他们已经有这个function已经有几个月了) 所以,我有点困惑。 据我所知,Xamarin也使用普通的iOS模拟器。 (他们只是通过Windows PC上的远程连接显示)如果他们在模拟器中有铅笔支持,那么对任何人来说都是可能的,不是吗?

如何区分用户是否用手指或苹果铅笔拍屏幕?

该应用程序支持iPad Pro,它必须使用Apple Pencil。 我想要做的是区分用户是否使用苹果铅笔或他的手指。 就像是: if( the user is pressing the screen with his finger){ do something } else if ( the user is pressing the screen with an Apple Pencil){ do something else } 我发现UITouchTypeStylus属性,但无法知道它是如何工作的。 我的主要问题是,这里只有很less的例子,它们是用快速编写的,但是我的工作是客观的,而且我不能真正理解这些例子。 看看这个,我从苹果开发者那里find一个样本,这是一个函数: func addPointsOfType(var type: LinePoint.PointType, forTouches touches: [UITouch], toLine line: Line, currentUpdateRect updateRect: CGRect) -> CGRect { var […]