Files
SwiftLint/Source/SwiftLintBuiltInRules/Rules/Lint/NotificationCenterDetachmentRuleExamples.swift

29 lines
649 B
Swift

internal struct NotificationCenterDetachmentRuleExamples {
static let nonTriggeringExamples = [
Example("""
class Foo {
deinit {
NotificationCenter.default.removeObserver(self)
}
}
"""),
Example("""
class Foo {
func bar() {
NotificationCenter.default.removeObserver(otherObject)
}
}
""")
]
static let triggeringExamples = [
Example("""
class Foo {
func bar() {
↓NotificationCenter.default.removeObserver(self)
}
}
""")
]
}