TinyConsole

??? 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.

Github星跟蹤圖

TinyConsole

TinyConsole is a tiny log console to display information while using your iOS app and written in Swift.

Usage

Wrap your Main ViewController inside of a TinyConsoleController like so:

TinyConsole.createViewController(rootViewController: MyMainViewController())

Actions

Hide and Show

Shake your device to toggle the console.
If you’re using the Simulator, press ⌃ ctrl-⌘ cmd-z.

Console output

// 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()

Implementation Example

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.

Demo

Requirements

  • Xcode 11
  • Swift 5
  • iOS 11 or greater

Installation

Carthage

Add this to your Cartfile:

github "Cosmo/TinyConsole"

Manually

Just drag the source files into your project.

Hierarchy

Core Team

Thanks

Many thanks to the contributors of this project.

Contact

Other Projects

  • 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.

License

TinyConsole is released under the MIT License.

主要指標

概覽
名稱與所有者Cosmo/TinyConsole
主編程語言Swift
編程語言Swift (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2016-11-28 15:42:54
推送於2019-09-30 21:37:45
最后一次提交2019-09-30 17:54:54
發布數9
最新版本名稱2.0.1 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數2k
關注者數29
派生數89
提交數108
已啟用問題?
問題數19
打開的問題數5
拉請求數21
打開的拉請求數1
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?