From 072ecdf90780e50596c18908e05df87ccb765d62 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 10 Oct 2022 14:58:57 +0800 Subject: [PATCH] CtlCandidateDelegate // Remove useless "AnyObject". --- .../Sources/CandidateWindow/CtlCandidate.swift | 2 +- .../Sources/Shared/Protocols/CtlCandidateProtocol.swift | 2 +- Source/Modules/UIModules/CandidateUI/IMKCandidatesImpl.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CtlCandidate.swift b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CtlCandidate.swift index 73f3435a..3876030b 100644 --- a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CtlCandidate.swift +++ b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CtlCandidate.swift @@ -39,7 +39,7 @@ open class CtlCandidate: NSWindowController, CtlCandidateProtocol { return result.blended(withFraction: colorBlendAmount, of: blendingAgainstTarget)! } - open weak var delegate: CtlCandidateDelegate? { + open var delegate: CtlCandidateDelegate? { didSet { reloadData() } diff --git a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift index 67f5cc3d..1a013e82 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift @@ -8,7 +8,7 @@ import Cocoa -public protocol CtlCandidateDelegate: AnyObject { +public protocol CtlCandidateDelegate { func candidatePairs(conv: Bool) -> [(String, String)] func candidatePairSelected(at index: Int) func candidates(_ sender: Any!) -> [Any]! diff --git a/Source/Modules/UIModules/CandidateUI/IMKCandidatesImpl.swift b/Source/Modules/UIModules/CandidateUI/IMKCandidatesImpl.swift index 73ed646d..d24949a5 100644 --- a/Source/Modules/UIModules/CandidateUI/IMKCandidatesImpl.swift +++ b/Source/Modules/UIModules/CandidateUI/IMKCandidatesImpl.swift @@ -18,7 +18,7 @@ public class CtlCandidateIMK: IMKCandidates, CtlCandidateProtocol { public static let defaultIMKSelectionKey: [UInt16: String] = [ 18: "1", 19: "2", 20: "3", 21: "4", 23: "5", 22: "6", 26: "7", 28: "8", 25: "9", ] - public weak var delegate: CtlCandidateDelegate? { + public var delegate: CtlCandidateDelegate? { didSet { reloadData() }