mirror of
https://github.com/ypresto/SwiftLintXcode.git
synced 2026-03-28 09:25:53 +00:00
🔧 Add @objc to selectors
This commit is contained in:
parent
a4e91ad5e3
commit
782cbe71de
2 changed files with 5 additions and 5 deletions
|
|
@ -41,7 +41,7 @@ final class SaveHook {
|
|||
// https://github.com/travisjeffery/ClangFormat-Xcode/blob/a22114907592fb5d5b1043a4919d7be3e1496741/ClangFormat/NSDocument+TRVSClangFormat.m
|
||||
extension NSDocument {
|
||||
|
||||
dynamic func swiftLintXcodeSaveDocument(delegate: AnyObject?, didSaveSelector: Selector, contextInfo: UnsafeMutableRawPointer) -> Void {
|
||||
@objc dynamic func swiftLintXcodeSaveDocument(delegate: AnyObject?, didSaveSelector: Selector, contextInfo: UnsafeMutableRawPointer) -> Void {
|
||||
if SaveHook.tryOnSaveDocument(self) {
|
||||
// NOTE: Call original method
|
||||
swiftLintXcodeSaveDocument(delegate: delegate, didSaveSelector: didSaveSelector, contextInfo: contextInfo)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SwiftLintXcode: NSObject {
|
|||
center.removeObserver(self)
|
||||
}
|
||||
|
||||
func onApplicationDidFinishLaunching() {
|
||||
@objc func onApplicationDidFinishLaunching() {
|
||||
SaveHook.swizzle()
|
||||
createMenuItems()
|
||||
}
|
||||
|
|
@ -66,18 +66,18 @@ class SwiftLintXcode: NSObject {
|
|||
updateMenuVisibility()
|
||||
}
|
||||
|
||||
func doAutoCorrect() {
|
||||
@objc func doAutoCorrect() {
|
||||
let sourceCodeDocument: IDESourceCodeDocument = SwiftLintXcodeTRVSXcode.sourceCodeDocument()
|
||||
guard Formatter.isFormattableDocument(sourceCodeDocument) else { return }
|
||||
Formatter.sharedInstance.tryFormatDocument(sourceCodeDocument)
|
||||
}
|
||||
|
||||
func doEnableFormatOnSave() {
|
||||
@objc func doEnableFormatOnSave() {
|
||||
SaveHook.enabled = true
|
||||
updateMenuVisibility()
|
||||
}
|
||||
|
||||
func doDisableFormatOnSave() {
|
||||
@objc func doDisableFormatOnSave() {
|
||||
SaveHook.enabled = false
|
||||
updateMenuVisibility()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue