мой проект работает хорошо в iOS 12 и в последней версии, но в iOS 13 PDFKit не работает должным образом, мне нужно добавить uitexview в pdf для редактирования, но он не работает нормально
обычно, когда моя функциязапустить, и я нажимаю в pdf добавить текстовое представление, я приду к «Первому корреспонденту», но с iOS 13 функция не работает хорошо
вот мой UITapGestureRecognizer let barHideOnTapGestureRecognizer = UITapGestureRecognizer () let pdfViewGestureRecognizer = PDFViewGestureRec55*
func getPDFFrame(todo: String)
{
let pdfSubVws = pdfView.subviews
print("subVws ",pdfSubVws)
print("My" , todo)
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) //viewVcVcQueueVc []
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)
{
// print("subVwssubVws ", subVws)
let pagView = subVws.subviews
// pdfLandingView =
for subVws in pagView
{
// print("\n\n EndVwssubVws ", subVws)
if (String(describing: subVws).range(of:"PDFPageView") != nil)
{
let pageLandVw = subVws.subviews
print("\n\n WasVwssubVws ", pageLandVw)
// hideBars()
// Myedit()
for subVws in pageLandVw
{
if (String(describing: subVws).range(of:"UITextView") != nil)
{
print("dddddddd")
let txtVw = subVws as! UITextView
if todo == "firstResponder"
{
let rect = pdfView.currentPage?.bounds(for: .mediaBox)
usingHeightText = txtVw.frame.size.height
usingWidthText = txtVw.frame.size.width
let xPoint = txtVw.frame.origin.x
let yPoint = (rect?.height)! - (txtVw.frame.origin.y) - txtVw.frame.size.height
lastTextAnnoPoint = CGPoint(x: xPoint, y: yPoint)
findHavingTextAnnotation(annoPoint: CGPoint(x: xPoint, y: yPoint))
// txtVw.contentInset = UIEdgeInsetsMake(0, 10, 0, 0)
print("C_Sz ", txtVw.contentSize)
print("C_Off ", txtVw.contentOffset)
let widthMoveView = UIView(frame: CGRect(x: txtVw.frame.size.width - 20, y: 0, width: 20, height: txtVw.frame.size.height))
widthMoveView.backgroundColor = UIColor.brown.withAlphaComponent(0.0)
widthMoveView.tag = 333
let wdImgVw = UIImageView()
wdImgVw.frame.origin.x = 0
wdImgVw.frame.origin.y = 8
wdImgVw.frame.size.width = 20 // widthMoveView.frame.width
wdImgVw.frame.size.height = 20 // widthMoveView.frame.height
wdImgVw.contentMode = .scaleAspectFit
wdImgVw.image = UIImage(named: "widthLeftRight")
wdImgVw.layer.cornerRadius = 10
// wdImgVw.backgroundColor = UIColor.orange
widthMoveView.addSubview(wdImgVw)
txtVw.addSubview(widthMoveView)
//
let tapVw = UIPanGestureRecognizer(target: self, action: #selector(self.handleWidthTapVw(_:)))
widthMoveView.addGestureRecognizer(tapVw)
}
else
{
// txtVw.tag = AddTextCount
txtVw.textColor = usingFontColor
txtVw.font = UIFont(name: usingFontName, size: CGFloat(usingFontSize))
txtVw.backgroundColor = nil
txtVw.backgroundColor = usingBGFontColor.withAlphaComponent(usingBGFontAlpha)
txtVw.delegate = self
txtVw.autocorrectionType = .no
let iPadShortcut = txtVw.inputAssistantItem
iPadShortcut.leadingBarButtonGroups = []
iPadShortcut.trailingBarButtonGroups = []
print("\n\nTAG_TXTVW-->>> ",txtVw.tag)
//txtVw.text = ""
let panGest = UIPanGestureRecognizer(target: self, action: #selector(self.handleTap(_:)))
txtVw.addGestureRecognizer(panGest)
if todo == "default"
{
print("\n\n defasdasfs")
txtVw.inputView = nil
setDoneOnKeyboard(myTextView: txtVw, showButImg: UIImage(named: "editing")!, bgImg: UIImage(named: "textbgcolor")!, kboardIcon: UIImage(named: "keyboard")!, logic: "first")
hasKeyboardChanged = true
txtVw.reloadInputViews()
}
if todo == "showPickerView"
{
print("\n\n showwewrewrasfs")
txtVw.inputView = fontChangePickerView
setDoneOnKeyboard(myTextView: txtVw, showButImg: UIImage(named: "editing")!, bgImg: UIImage(named: "textbgcolor")!, kboardIcon: UIImage(named: "keyboard")!, logic: "textchange")
txtVw.reloadInputViews()
}
else if todo == "hidePickerView"
{
print("\n\n hideewrewrasfs")
txtVw.inputView = nil
setDoneOnKeyboard(myTextView: txtVw, showButImg: UIImage(named: "editing")!, bgImg: UIImage(named: "textbgcolor")!, kboardIcon: UIImage(named: "keyboard")!, logic: "first")
txtVw.reloadInputViews()
}
else if todo == "widthChange"
{
txtVw.tag = 118
txtVw.frame.size.width = usingWidthText
}
else if todo == "heightChange"
{
txtVw.frame.size.height = usingHeightText
let rect = pdfView.currentPage?.bounds(for: .mediaBox)
textVwMovedY = (rect?.height)! - (txtVw.frame.origin.y)
MovingTextViewAnnotation(forWhich: "fingerPan")
}
else if todo == "sizeChangeByFont"
{
txtVw.frame.size.height = txtVw.contentSize.height
usingHeightText = txtVw.frame.size.height
MovingTextViewAnnotation(forWhich: "height")
MovingTextViewAnnotation(forWhich: "fingerPan")
}
else if todo == "removeArrowSuviews"
{
for subVws in txtVw.subviews
{
if subVws.tag == 333
{
subVws.removeFromSuperview()
}
}
}
else if todo == "deleteTextVw"
{
txtVw.removeFromSuperview()
}
print("\n\ntxtVwFrame ", txtVw.frame)
}
return
// txtVw.inputView = fontChangePickerView
//
// setDoneOnKeyboard(myTextView: txtVw)
// print("\n\n TxtVwsubVws ", subVws)
}
}
}
}
}
}
}
}
}
}
// break
}
}
}
}
// UIQueuingScrollView
}
}
}
все проекты Time останавливаются здесь, и dismisskeyboard с
после этой строки, если (String (описывающий: subVws) .range (of: "UIView")! = Nil) мы не можемперейдите в скобки
и мы обязуемся перейти в этой строке
иначе, если todo == "removeArrowSuviews"