Skip to content
Permalink
Browse files

remove magic fatalError() String

  • Loading branch information...
vermont42 committed May 10, 2019
1 parent 747fa37 commit 35f8e25285a170a63c9126879682f86ac4f48a67
@@ -11,7 +11,7 @@
038E03132270A868005CFC96 /* IntExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03122270A868005CFC96 /* IntExtensionTests.swift */; };
038E03152270A9FB005CFC96 /* TestGameCenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */; };
038E03182270AC01005CFC96 /* DeviceUtilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03172270AC01005CFC96 /* DeviceUtilityTests.swift */; };
038E031A22711B76005CFC96 /* UIViewControllerExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */; };
038E031A22711B76005CFC96 /* UIViewControllerExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031922711B76005CFC96 /* UIViewControllerExtensionsTests.swift */; };
038E031C2271E239005CFC96 /* AnalyticsServiceableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031B2271E239005CFC96 /* AnalyticsServiceableTests.swift */; };
038E031E22734800005CFC96 /* URLProtocolStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031D22734800005CFC96 /* URLProtocolStub.swift */; };
038E03202273BF29005CFC96 /* RatingsFetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031F2273BF29005CFC96 /* RatingsFetcherTests.swift */; };
@@ -101,8 +101,8 @@
E1E092C021ED389300828C37 /* GetterSetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E092BF21ED389300828C37 /* GetterSetter.swift */; };
E1E092C321ED3C6900828C37 /* DictionaryGetterSetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E092C121ED3C6900828C37 /* DictionaryGetterSetter.swift */; };
E1E092C421ED3C6900828C37 /* UserDefaultsGetterSetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E092C221ED3C6900828C37 /* UserDefaultsGetterSetter.swift */; };
E1EC70F12198A10B00872787 /* UIViewControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EC70F02198A10B00872787 /* UIViewControllerExtension.swift */; };
E1EC70F22198A10B00872787 /* UIViewControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EC70F02198A10B00872787 /* UIViewControllerExtension.swift */; };
E1EC70F12198A10B00872787 /* UIViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EC70F02198A10B00872787 /* UIViewControllerExtensions.swift */; };
E1EC70F22198A10B00872787 /* UIViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EC70F02198A10B00872787 /* UIViewControllerExtensions.swift */; };
E1EC70F52198A63700872787 /* AWSCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1EC70F32198A63600872787 /* AWSCore.framework */; };
E1EC70F62198A63700872787 /* AWSCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E1EC70F32198A63600872787 /* AWSCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E1EC70F72198A63700872787 /* AWSPinpoint.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1EC70F42198A63700872787 /* AWSPinpoint.framework */; };
@@ -158,7 +158,7 @@
038E03122270A868005CFC96 /* IntExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntExtensionTests.swift; sourceTree = "<group>"; };
038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestGameCenterTests.swift; sourceTree = "<group>"; };
038E03172270AC01005CFC96 /* DeviceUtilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceUtilityTests.swift; sourceTree = "<group>"; };
038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtensionTests.swift; sourceTree = "<group>"; };
038E031922711B76005CFC96 /* UIViewControllerExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtensionsTests.swift; sourceTree = "<group>"; };
038E031B2271E239005CFC96 /* AnalyticsServiceableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsServiceableTests.swift; sourceTree = "<group>"; };
038E031D22734800005CFC96 /* URLProtocolStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLProtocolStub.swift; sourceTree = "<group>"; };
038E031F2273BF29005CFC96 /* RatingsFetcherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RatingsFetcherTests.swift; sourceTree = "<group>"; };
@@ -250,7 +250,7 @@
E1E092BF21ED389300828C37 /* GetterSetter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetterSetter.swift; sourceTree = "<group>"; };
E1E092C121ED3C6900828C37 /* DictionaryGetterSetter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DictionaryGetterSetter.swift; sourceTree = "<group>"; };
E1E092C221ED3C6900828C37 /* UserDefaultsGetterSetter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserDefaultsGetterSetter.swift; sourceTree = "<group>"; };
E1EC70F02198A10B00872787 /* UIViewControllerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtension.swift; sourceTree = "<group>"; };
E1EC70F02198A10B00872787 /* UIViewControllerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtensions.swift; sourceTree = "<group>"; };
E1EC70F32198A63600872787 /* AWSCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AWSCore.framework; sourceTree = "<group>"; };
E1EC70F42198A63700872787 /* AWSPinpoint.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AWSPinpoint.framework; sourceTree = "<group>"; };
E1EC70FC2198BA0D00872787 /* awsconfiguration.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = awsconfiguration.json; sourceTree = SOURCE_ROOT; };
@@ -367,7 +367,7 @@
E1483FC31EF7510F0052C436 /* UIApplicationExtension.swift */,
E18145DB1F2E49B20048DEE2 /* UILabelExtension.swift */,
E10178011F3F753400F0BC97 /* UIViewExtensions.swift */,
E1EC70F02198A10B00872787 /* UIViewControllerExtension.swift */,
E1EC70F02198A10B00872787 /* UIViewControllerExtensions.swift */,
E1E092C221ED3C6900828C37 /* UserDefaultsGetterSetter.swift */,
E18F7F371ECA7C9A00633200 /* Utterer.swift */,
038E031D22734800005CFC96 /* URLProtocolStub.swift */,
@@ -430,7 +430,7 @@
038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */,
038E0329227CD8B7005CFC96 /* UIAlertControllerExtensionTests.swift */,
038E0323227617FC005CFC96 /* UIApplicationExtensionTests.swift */,
038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */,
038E031922711B76005CFC96 /* UIViewControllerExtensionsTests.swift */,
038E032122760A40005CFC96 /* UIViewExtensionsTests.swift */,
);
path = Utils;
@@ -795,7 +795,7 @@
E14566BE1EC001FD00C16DC3 /* ConjugationCell.swift in Sources */,
E1483FB11EF5C4C60052C436 /* Difficulty.swift in Sources */,
E1171C9321AB387500B06342 /* TestAnalyticsService.swift in Sources */,
E1EC70F12198A10B00872787 /* UIViewControllerExtension.swift in Sources */,
E1EC70F12198A10B00872787 /* UIViewControllerExtensions.swift in Sources */,
E11BC1732004335B00494504 /* SecondSingularQuiz.swift in Sources */,
E15A18531E9199C3008455DD /* ConjugatorError.swift in Sources */,
E1E092C321ED3C6900828C37 /* DictionaryGetterSetter.swift in Sources */,
@@ -856,13 +856,13 @@
038E03182270AC01005CFC96 /* DeviceUtilityTests.swift in Sources */,
E12D06A31F5E85A200CDD54E /* VerbCellTests.swift in Sources */,
038E032222760A40005CFC96 /* UIViewExtensionsTests.swift in Sources */,
038E031A22711B76005CFC96 /* UIViewControllerExtensionTests.swift in Sources */,
038E031A22711B76005CFC96 /* UIViewControllerExtensionsTests.swift in Sources */,
038E03132270A868005CFC96 /* IntExtensionTests.swift in Sources */,
E151223121A62AE9008EF307 /* ReviewPrompterTests.swift in Sources */,
E1DC939521B5836400DD4048 /* QuizTests.swift in Sources */,
038E032A227CD8B7005CFC96 /* UIAlertControllerExtensionTests.swift in Sources */,
E198F9051F5D7CB200BAF553 /* ConjugatorTests.swift in Sources */,
E1EC70F22198A10B00872787 /* UIViewControllerExtension.swift in Sources */,
E1EC70F22198A10B00872787 /* UIViewControllerExtensions.swift in Sources */,
E14589F41F5B7BB000EEF141 /* BrowseInfoVCTests.swift in Sources */,
E14589F61F5B7E9D00EEF141 /* VerbVCTests.swift in Sources */,
038E031C2271E239005CFC96 /* AnalyticsServiceableTests.swift in Sources */,
@@ -44,7 +44,7 @@ class BrowseInfoVC: UIViewController, UITableViewDelegate, UITableViewDataSource
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -45,7 +45,7 @@ class BrowseVerbsVC: UIViewController, UITableViewDelegate, UITableViewDataSourc
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -29,7 +29,7 @@ class InfoVC: UIViewController, UITextViewDelegate {
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -31,7 +31,7 @@ class QuizVC: UIViewController, UITextFieldDelegate, QuizDelegate {
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -27,7 +27,7 @@ class ResultsVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -31,7 +31,7 @@ class SettingsVC: UIViewController {
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -1,5 +1,5 @@
//
// UIViewControllerExtension.swift
// UIViewControllerExtensions.swift
// Conjugar
//
// Created by Joshua Adams on 11/11/18.
@@ -12,4 +12,8 @@ extension UIViewController {
func fatalCastMessage(view: Any) -> String {
return "Could not cast \(self).view to \(view)."
}

static func fatalErrorNotImplemented() -> Never {
fatalError("init(coder:) has not been implemented")
}
}
@@ -30,7 +30,7 @@ class VerbVC: UIViewController {
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
UIViewController.fatalErrorNotImplemented()
}

override func loadView() {
@@ -1,5 +1,5 @@
//
// UIViewControllerExtensionTests.swift
// UIViewControllerExtensionsTests.swift
// ConjugarTests
//
// Created by Joshua Adams on 4/24/19.
@@ -10,7 +10,7 @@ import XCTest
import UIKit
@testable import Conjugar

class UIViewControllerExtensionTests: XCTestCase {
class UIViewControllerExtensionsTests: XCTestCase {
func testFatalCastMessage() {
let vc = VerbVC(verb: "maltear", settings: Settings(getterSetter: DictionaryGetterSetter()), analyticsService: TestAnalyticsService())
let view = VerbView()

0 comments on commit 35f8e25

Please sign in to comment.
You can’t perform that action at this time.