π±π¬π¦ TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.
TinyConsole is a tiny log console to display information while using your iOS app and written in Swift.
Wrap your Main ViewController inside of a TinyConsoleController
like so:
TinyConsole.createViewController(rootViewController: MyMainViewController())
Shake your device to toggle the console.
If youβre using the Simulator, press β ctrl-β cmd-z.
// Print message
TinyConsole.print("hello")
// Print messages any color you want
TinyConsole.print("green text", color: UIColor.green)
// Print a red error message
TinyConsole.error("something went wrong")
// Print a marker for orientation
TinyConsole.addLine()
// Clear console
TinyConsole.clear()
Instead of
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = MyMainViewController()
window?.makeKeyAndVisible()
return true
}
write
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = TinyConsole.createViewController(rootViewController: MyMainViewController())
window?.makeKeyAndVisible()
return true
}
alternatively, check out the example project included in this repository.
Add this to your Cartfile:
github "Cosmo/TinyConsole"
Just drag the source files into your project.
Many thanks to the contributors of this project.
TinyConsole is released under the MIT License.