mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
d73ee8d3d9
Also removes `missing_docs` and `valid_docs` rules. Fixes #1453.
33 lines
806 B
Swift
33 lines
806 B
Swift
//
|
|
// NotificationCenterDetachmentRuleExamples.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Marcelo Fabri on 01/15/17.
|
|
// Copyright © 2017 Realm. All rights reserved.
|
|
//
|
|
|
|
internal struct NotificationCenterDetachmentRuleExamples {
|
|
|
|
static let nonTriggeringExamples = [
|
|
"class Foo { \n" +
|
|
" deinit {\n" +
|
|
" NotificationCenter.default.removeObserver(self)\n" +
|
|
" }\n" +
|
|
"}\n",
|
|
|
|
"class Foo { \n" +
|
|
" func bar() {\n" +
|
|
" NotificationCenter.default.removeObserver(otherObject)\n" +
|
|
" }\n" +
|
|
"}\n"
|
|
]
|
|
|
|
static let triggeringExamples = [
|
|
"class Foo { \n" +
|
|
" func bar() {\n" +
|
|
" ↓NotificationCenter.default.removeObserver(self)\n" +
|
|
" }\n" +
|
|
"}\n"
|
|
]
|
|
}
|