A tiny log console to display information while using your iOS app. Written in Swift 3.
Create a TinyConsoleController
-Instance and pass your App-ViewController as a rootViewController
parameter.
TinyConsoleController(rootViewController: MyMainViewController())
TinyConsole.shared.print(text: "hello")
TinyConsole.shared.addMarker()
TinyConsole.shared.clear()
- Swipe from Left to Right:
Add marker
- 2 Finger Tap:
Add custom log entry
- 3 Finger Tap: Show Action Sheet to
Clear Console
andSend Mail
- Shake to toggle the console view. If you’re using the Simulator, press ⌃ ctrl-⌘ cmd-z.
Instead of
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = MainViewController()
self.window?.makeKeyAndVisible()
return true
}
write
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = TinyConsoleController(rootViewController: MainViewController())
self.window?.makeKeyAndVisible()
return true
}
or checkout the example project included in this repository.
Add this to your Cartfile:
github "Cosmo/TinyConsole"
Just drag the source files into your project.
- Devran "Cosmo" Uenal
- Twitter: @maccosmo
TinyConsole is released under the MIT License.