diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3b20e47 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Duraid Abdul + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7a47965..460f20a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Welcome to LocalConsole! This Swift Package makes on-device debugging easy with ```swift import LocalConsole -let localConsoleManager = LCManager.shared +let consoleManager = LCManager.shared ``` ## **Usage** @@ -25,30 +25,29 @@ Once prepared, the localConsole can be used throughout your project. ```swift // Show the console view. -localConsoleManager.isVisible = true +consoleManager.isVisible = true // Hide the console view. -localConsoleManager.isVisible = false +consoleManager.isVisible = false ``` ```swift // Print items to the console view. -localConsoleManager.print("Hello, world!") +consoleManager.print("Hello, world!") // Clear console text. -localConsoleManager.clear() +consoleManager.clear() // Copy console text. -localConsoleManager.copy() +consoleManager.copy() ``` ```swift // Change the console view font size. -localConsoleManager.fontSize = 5 +consoleManager.fontSize = 5 ``` ## **To-Do** -* Support for iOS 13 * Screen edge console hiding * Make console view reactive to landscape/portrait switch diff --git a/Sources/LocalConsole/Extensions.swift b/Sources/LocalConsole/Extensions.swift index ad473ab..ba00071 100644 --- a/Sources/LocalConsole/Extensions.swift +++ b/Sources/LocalConsole/Extensions.swift @@ -22,6 +22,7 @@ extension UIScreen { static var hasRoundedCorners = UIScreen.main.value(forKey: "_" + "display" + "Corner" + "Radius") as! CGFloat > 0 } +@available(iOSApplicationExtension, unavailable) extension UIApplication { var statusBarHeight: CGFloat { if let window = UIApplication.shared.windows.first { diff --git a/Sources/LocalConsole/LCManager.swift b/Sources/LocalConsole/LCManager.swift index ffbf20a..e78c082 100644 --- a/Sources/LocalConsole/LCManager.swift +++ b/Sources/LocalConsole/LCManager.swift @@ -12,6 +12,7 @@ import SwiftUI var GLOBAL_BORDER_TRACKERS: [BorderManager] = [] +@available(iOSApplicationExtension, unavailable) public class LCManager: NSObject, UIGestureRecognizerDelegate { public static let shared = LCManager() diff --git a/Sources/LocalConsole/ResizeController.swift b/Sources/LocalConsole/ResizeController.swift index ebf753d..798da30 100644 --- a/Sources/LocalConsole/ResizeController.swift +++ b/Sources/LocalConsole/ResizeController.swift @@ -7,6 +7,7 @@ import UIKit +@available(iOSApplicationExtension, unavailable) class ResizeController { public static let shared = ResizeController() @@ -329,6 +330,7 @@ class ResizeController { } } +@available(iOSApplicationExtension, unavailable) class PlatterView: UIView { override init(frame: CGRect) {