|
@@ -34,7 +34,7 @@ extension KMToolbarItemView {
|
|
|
return self._itemIdentifier
|
|
|
}
|
|
|
}
|
|
|
- var pdfView : CPDFListView = CPDFListView()
|
|
|
+ weak var pdfView: CPDFListView?
|
|
|
|
|
|
lazy var clickButton: KMToolbarClickButton = {
|
|
|
let view = KMToolbarClickButton()
|
|
@@ -831,11 +831,11 @@ extension KMToolbarItemView: KMCustomButtonPopMenuViewControllerDelegate, KMCust
|
|
|
func itemEnable(at index: Int) -> Bool {
|
|
|
if self.itemIdentifier == KMToolbarToolFormAlignIdentifier {
|
|
|
if index <= 6 {
|
|
|
- if self.pdfView.activeAnnotations.count >= 2 {
|
|
|
+ if let cnt = self.pdfView?.activeAnnotations.count, cnt >= 2 {
|
|
|
return true
|
|
|
}
|
|
|
} else {
|
|
|
- if self.pdfView.activeAnnotations.count >= 3 {
|
|
|
+ if let cnt = self.pdfView?.activeAnnotations.count, cnt >= 3 {
|
|
|
return true
|
|
|
}
|
|
|
}
|