|
@@ -451,7 +451,13 @@ extension KMLeftSideViewController {
|
|
|
// 更新数据
|
|
|
var models: [KMBotaAnnotationModel] = []
|
|
|
if self.noteSearchMode {
|
|
|
- models = self.noteSearchArray
|
|
|
+// models = self.noteSearchArray
|
|
|
+ for model in self.noteSearchArray {
|
|
|
+ guard let data = model as? KMBotaAnnotationModel else {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ models.append(data)
|
|
|
+ }
|
|
|
} else {
|
|
|
let selModels = self.annoListModel?.datas ?? []
|
|
|
for selModel in selModels {
|
|
@@ -795,8 +801,11 @@ extension KMLeftSideViewController {
|
|
|
func fetchAnnoModel(for anno: CPDFAnnotation) -> KMBotaAnnotationModel? {
|
|
|
if self.noteSearchMode { // 搜索模式
|
|
|
for model in self.noteSearchArray {
|
|
|
- if anno.isEqual(to: model.anno) {
|
|
|
- return model
|
|
|
+ guard let data = model as? KMBotaAnnotationModel else {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if anno.isEqual(to: data.anno) {
|
|
|
+ return data
|
|
|
}
|
|
|
}
|
|
|
} else { // 常规模式(非搜索)
|
|
@@ -1254,10 +1263,10 @@ extension KMLeftSideViewController {
|
|
|
guard let _ = item.anno else {
|
|
|
continue
|
|
|
}
|
|
|
- guard let data = item as? KMBotaAnnotationModel else {
|
|
|
- continue
|
|
|
- }
|
|
|
- self.noteSearchArray.append(data)
|
|
|
+// guard let data = item as? KMBotaAnnotationModel else {
|
|
|
+// continue
|
|
|
+// }
|
|
|
+ self.noteSearchArray.append(item)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1280,11 +1289,11 @@ extension KMLeftSideViewController {
|
|
|
if caseInsensite {
|
|
|
noteString = noteString.lowercased()
|
|
|
}
|
|
|
- guard let data = item as? KMBotaAnnotationModel else {
|
|
|
- continue
|
|
|
- }
|
|
|
+// guard let data = item as? KMBotaAnnotationModel else {
|
|
|
+// continue
|
|
|
+// }
|
|
|
if noteString.contains(stringValue) {
|
|
|
- self.noteSearchArray.append(data)
|
|
|
+ self.noteSearchArray.append(item)
|
|
|
}
|
|
|
}
|
|
|
}
|