diff --git a/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift b/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift index 8d859201..7a79b603 100644 --- a/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift +++ b/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift @@ -116,19 +116,19 @@ public class ctlCandidate: NSWindowController, ctlCandidateProtocol { public func reloadData() {} - public func showNextPage() -> Bool { + @discardableResult public func showNextPage() -> Bool { false } - public func showPreviousPage() -> Bool { + @discardableResult public func showPreviousPage() -> Bool { false } - public func highlightNextCandidate() -> Bool { + @discardableResult public func highlightNextCandidate() -> Bool { false } - public func highlightPreviousCandidate() -> Bool { + @discardableResult public func highlightPreviousCandidate() -> Bool { false } diff --git a/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift b/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift index 6a71b98e..6db136a2 100644 --- a/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift +++ b/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift @@ -123,7 +123,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { } // 該函式會影響 IMK 選字窗。 - public func showNextPage() -> Bool { + @discardableResult public func showNextPage() -> Bool { guard delegate != nil else { return false } if pageCount == 1 { return highlightNextCandidate() } if currentPageIndex + 1 >= pageCount { clsSFX.beep() } @@ -135,7 +135,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { } // 該函式會影響 IMK 選字窗。 - public func showPreviousPage() -> Bool { + @discardableResult public func showPreviousPage() -> Bool { guard delegate != nil else { return false } if pageCount == 1 { return highlightPreviousCandidate() } if currentPageIndex == 0 { clsSFX.beep() } @@ -147,7 +147,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { } // 該函式會影響 IMK 選字窗。 - public func highlightNextCandidate() -> Bool { + @discardableResult public func highlightNextCandidate() -> Bool { guard let delegate = delegate else { return false } selectedCandidateIndex = (selectedCandidateIndex + 1 >= delegate.candidateCountForController(self)) @@ -157,7 +157,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { } // 該函式會影響 IMK 選字窗。 - public func highlightPreviousCandidate() -> Bool { + @discardableResult public func highlightPreviousCandidate() -> Bool { guard let delegate = delegate else { return false } selectedCandidateIndex = (selectedCandidateIndex == 0) diff --git a/Source/Modules/UIModules/CandidateUI/ctlCandidateUniversal.swift b/Source/Modules/UIModules/CandidateUI/ctlCandidateUniversal.swift index 60008b83..f291a656 100644 --- a/Source/Modules/UIModules/CandidateUI/ctlCandidateUniversal.swift +++ b/Source/Modules/UIModules/CandidateUI/ctlCandidateUniversal.swift @@ -432,7 +432,7 @@ public class ctlCandidateUniversal: ctlCandidate { layoutCandidateView() } - override public func showNextPage() -> Bool { + @discardableResult override public func showNextPage() -> Bool { guard delegate != nil else { return false } if pageCount == 1 { return highlightNextCandidate() } if currentPageIndex + 1 >= pageCount { clsSFX.beep() } @@ -445,7 +445,7 @@ public class ctlCandidateUniversal: ctlCandidate { return true } - override public func showPreviousPage() -> Bool { + @discardableResult override public func showPreviousPage() -> Bool { guard delegate != nil else { return false } if pageCount == 1 { return highlightPreviousCandidate() } if currentPageIndex == 0 { clsSFX.beep() } @@ -458,7 +458,7 @@ public class ctlCandidateUniversal: ctlCandidate { return true } - override public func highlightNextCandidate() -> Bool { + @discardableResult override public func highlightNextCandidate() -> Bool { guard let delegate = delegate else { return false } selectedCandidateIndex = (selectedCandidateIndex + 1 >= delegate.candidateCountForController(self)) @@ -466,7 +466,7 @@ public class ctlCandidateUniversal: ctlCandidate { return true } - override public func highlightPreviousCandidate() -> Bool { + @discardableResult override public func highlightPreviousCandidate() -> Bool { guard let delegate = delegate else { return false } selectedCandidateIndex = (selectedCandidateIndex == 0)