mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
29 lines
649 B
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)
|
|
}
|
|
}
|
|
""")
|
|
]
|
|
}
|