gumbright / TinyConsole

ℹ️📱 A tiny log console to display information while using your iOS app. Written in Swift 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

 text

TinyConsole

Platform iOS

Swift 3 compatible

Carthage compatible

License MIT

A tiny log console to display information while using your iOS app. Written in Swift 3.

 text

Usage

Create a TinyConsoleController-Instance and pass your App-ViewController as a rootViewController parameter.

TinyConsoleController(rootViewController: MyMainViewController())

Actions

// TinyConsole prints NSFormattedStrings and Strings
TinyConsole.print("hello")

// print messages any color you want 
TinyConsole.print("green text", color: UIColor.green)

// prints a red error message 
TinyConsole.error("something went wrong")

TinyConsole.addMarker()
TinyConsole.clear()

Gestures

  • Swipe from Left to Right: Add marker
  • 2 Finger Tap: Add custom log entry
  • 3 Finger Tap: Show Action Sheet to Clear Console and Send Mail
  • Shake to toggle the console view. If you’re using the Simulator, press ⌃ ctrl-⌘ cmd-z.

Implementation Example

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.

Demo

 text

Installation

Carthage

Add this to your Cartfile:

github "Cosmo/TinyConsole"

CocoaPods

Add this to your Podfile:

pod 'TinyConsole'

Manually

Just drag the source files into your project.

Hierarchy

 text

Contact

License

TinyConsole is released under the MIT License.

About

ℹ️📱 A tiny log console to display information while using your iOS app. Written in Swift 3.

License:MIT License


Languages

Language:Swift 92.3%Language:Ruby 5.1%Language:Objective-C 2.6%