diff --git a/DEV-Simple.xcodeproj/project.pbxproj b/DEV-Simple.xcodeproj/project.pbxproj index 4492e9e..9e59cfd 100755 --- a/DEV-Simple.xcodeproj/project.pbxproj +++ b/DEV-Simple.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 73D7676B2190D88B00BD13B6 /* PushNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73D7676A2190D88B00BD13B6 /* PushNotifications.framework */; }; 73E8ACC72192165E009CE057 /* BrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73E8ACC62192165E009CE057 /* BrowserViewController.swift */; }; BA7610B322E20FB9004DBB9E /* MarqueeLabel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA7610B222E20FB9004DBB9E /* MarqueeLabel.framework */; }; + BD2103FE2345A5B000F1F6FB /* WKWebView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2103FD2345A5B000F1F6FB /* WKWebView+Extensions.swift */; }; + BD2104002345A66B00F1F6FB /* Notification+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2103FF2345A66B00F1F6FB /* Notification+Extensions.swift */; }; BD5C906C21B63CCC000D9F79 /* NetworkReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD5C906B21B63CCC000D9F79 /* NetworkReachability.swift */; }; BD5C906F21B6436F000D9F79 /* NotificationBanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD5C906E21B6436F000D9F79 /* NotificationBanner.framework */; }; BD5C907321B645CD000D9F79 /* SnapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD5C907221B645CD000D9F79 /* SnapKit.framework */; }; @@ -63,6 +65,8 @@ 73D7676A2190D88B00BD13B6 /* PushNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PushNotifications.framework; path = Carthage/Build/iOS/PushNotifications.framework; sourceTree = ""; }; 73E8ACC62192165E009CE057 /* BrowserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserViewController.swift; sourceTree = ""; }; BA7610B222E20FB9004DBB9E /* MarqueeLabel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MarqueeLabel.framework; path = Carthage/Build/iOS/MarqueeLabel.framework; sourceTree = ""; }; + BD2103FD2345A5B000F1F6FB /* WKWebView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKWebView+Extensions.swift"; sourceTree = ""; }; + BD2103FF2345A66B00F1F6FB /* Notification+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+Extensions.swift"; sourceTree = ""; }; BD5C906B21B63CCC000D9F79 /* NetworkReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkReachability.swift; sourceTree = ""; }; BD5C906E21B6436F000D9F79 /* NotificationBanner.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationBanner.framework; path = Carthage/Build/iOS/NotificationBanner.framework; sourceTree = ""; }; BD5C907021B645BE000D9F79 /* MarqueeLabelSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MarqueeLabelSwift.framework; path = Carthage/Build/iOS/MarqueeLabelSwift.framework; sourceTree = ""; }; @@ -161,6 +165,7 @@ 73D7673A218BA66700BD13B6 /* DEV-Simple */ = { isa = PBXGroup; children = ( + BD2103FC2345A59900F1F6FB /* Extensions */, 1BA17C8B220C84C3007A8EF5 /* assets */, 1BA17C8A220C84A2007A8EF5 /* core */, 1BA17C89220C848B007A8EF5 /* storyboards */, @@ -192,6 +197,15 @@ path = "DEV-SimpleUITests"; sourceTree = ""; }; + BD2103FC2345A59900F1F6FB /* Extensions */ = { + isa = PBXGroup; + children = ( + BD2103FD2345A5B000F1F6FB /* WKWebView+Extensions.swift */, + BD2103FF2345A66B00F1F6FB /* Notification+Extensions.swift */, + ); + path = Extensions; + sourceTree = ""; + }; BD5C906D21B6436E000D9F79 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -398,8 +412,10 @@ 73D7673E218BA66700BD13B6 /* ViewController.swift in Sources */, 73E8ACC72192165E009CE057 /* BrowserViewController.swift in Sources */, 73D7673C218BA66700BD13B6 /* AppDelegate.swift in Sources */, + BD2104002345A66B00F1F6FB /* Notification+Extensions.swift in Sources */, 1B032B1821E409FE00A2108A /* Globals.swift in Sources */, BD5C906C21B63CCC000D9F79 /* NetworkReachability.swift in Sources */, + BD2103FE2345A5B000F1F6FB /* WKWebView+Extensions.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/DEV-Simple/Extensions/Notification+Extensions.swift b/DEV-Simple/Extensions/Notification+Extensions.swift new file mode 100644 index 0000000..d409500 --- /dev/null +++ b/DEV-Simple/Extensions/Notification+Extensions.swift @@ -0,0 +1,15 @@ +// +// Notification+Extensions.swift +// DEV-Simple +// +// Created by Daniel Chick on 10/2/19. +// Copyright © 2019 DEV. All rights reserved. +// + +import Foundation + +extension Notification.Name { + static let didReceiveData = Notification.Name("didReceiveData") + static let didCompleteTask = Notification.Name("didCompleteTask") + static let completedLengthyDownload = Notification.Name("completedLengthyDownload") +} diff --git a/DEV-Simple/Extensions/WKWebView+Extensions.swift b/DEV-Simple/Extensions/WKWebView+Extensions.swift new file mode 100644 index 0000000..780a2c1 --- /dev/null +++ b/DEV-Simple/Extensions/WKWebView+Extensions.swift @@ -0,0 +1,18 @@ +// +// WKWebView+Extensions.swift +// DEV-Simple +// +// Created by Daniel Chick on 10/2/19. +// Copyright © 2019 DEV. All rights reserved. +// + +import WebKit + +extension WKWebView { + func load(_ urlString: String) { + if let url = URL(string: urlString) { + let request = URLRequest(url: url) + load(request) + } + } +} diff --git a/DEV-Simple/views/ViewController.swift b/DEV-Simple/views/ViewController.swift index 06c674f..3777df0 100755 --- a/DEV-Simple/views/ViewController.swift +++ b/DEV-Simple/views/ViewController.swift @@ -12,12 +12,6 @@ import UserNotifications import PushNotifications import NotificationBanner -extension Notification.Name { - static let didReceiveData = Notification.Name("didReceiveData") - static let didCompleteTask = Notification.Name("didCompleteTask") - static let completedLengthyDownload = Notification.Name("completedLengthyDownload") -} - struct UserData: Codable { enum CodingKeys: String, CodingKey { case userID = "id" @@ -398,12 +392,3 @@ extension ViewController: WKScriptMessageHandler { } } } - -extension WKWebView { - func load(_ urlString: String) { - if let url = URL(string: urlString) { - let request = URLRequest(url: url) - load(request) - } - } -}