这是我的代码,它在 iOS 12 中完美运行,但对于 iOS 13,代码无法准确给出值
let pdfViewGestureRecognizer = PDFViewGestureRecognizer()
pdfView.autoScales = true
pdfView.displayMode = .singlePage
pdfView.displayDirection = .horizontal
pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20])
pdfView.addGestureRecognizer(pdfViewGestureRecognizer)
pdfView.document = pdfDocument
这是第一个问题不是去这里我为手势和其他细节添加了很好的代表在这里找到但也不起作用!不去 func touchesBegan 也不去 if (String(describing: subVws).range(of:"UIView") != nil)
class PDFViewGestureRecognizer: UIGestureRecognizer {
var isTracking = false
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
isTracking = true
print ("but not iOS 13.2.3")
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
isTracking = false
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent) {
isTracking = false
}
}
这是第二部分
let pdfSubVws = pdfView.subviews
print("subVws ",pdfSubVws)
for subVws in pdfSubVws
{
if (String(describing: subVws).range(of:"UIPageViewControllerContentView") != nil)
{
let pageVc = subVws.subviews
for subVws in pageVc
{
if (String(describing: subVws).range(of:"UIQueuingScrollView") != nil)
{
let QueueVc = subVws.subviews
// print("QueueVcQueueVc ", QueueVc)
for subVws in QueueVc
{
if (String(describing: subVws).range(of:"UIView") != nil)
{
let viewVc = subVws.subviews
// print("\n\nviewVcVcQueueVc ", viewVc)
for subVws in viewVc
{
if (String(describing: subVws).range(of:"UIView") != nil)
{
let SubviewVc = subVws.subviews
// print("\n\nSubviewVcSubviewVc ", SubviewVc)
for subVws in SubviewVc
{
if (String(describing: subVws).range(of:"UIScrollView") != nil)
{
let finalVw = subVws.subviews
// print("\n\nfinalVw ", finalVw)
//
for subVws in finalVw
{
if (String(describing: subVws).range(of:"UIView") != nil) //here is ok iOS 12 It's ok but not iOS 13.2.3
{