Files
SwiftLint/Source/SwiftLintFramework/Rules/NotificationCenterDetachmentRuleExamples.swift
T
Marcelo Fabri d73ee8d3d9 Remove Swift 2 support
Also removes `missing_docs` and `valid_docs` rules.

Fixes #1453.
2017-04-23 13:43:41 +02:00

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"
]
}