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.
- Xcode 11
- Swift 5
- iOS 11 or greater
Add this to your Cartfile:
github "Cosmo/TinyConsole"
Just drag the source files into your project.
- @Cosmo, Devran "Cosmo" Uenal
- @mRs-, Marius Landwehr
- @ohitsdaniel, Daniel Peter
Many thanks to the contributors of this project.
- Devran "Cosmo" Uenal
- Twitter: @maccosmo
- LinkedIn: devranuenal
- BinaryKit β BinaryKit helps you to break down binary data into bits and bytes and easily access specific parts.
- Clippy β Clippy from Microsoft Office is back and runs on macOS! Written in Swift.
- GrammaticalNumber β Turns singular words to the plural and vice-versa in Swift.
- HackMan β Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
- ISO8859 β Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.
- SpriteMap β SpriteMap helps you to extract sprites out of a sprite map. Written in Swift.
- StringCase β Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
TinyConsole is released under the MIT License.