Qiita Conference 2025

Qiita史上最多!豪華12名のゲストが登壇

特別講演ゲスト(敬称略)

ymrl、成瀬允宣、鹿野壮、伊藤淳一、uhyo、徳丸浩、ミノ駆動、みのるん、桜庭洋之、tenntenn、けんちょん、こにふぁー

2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TinyConsoleというデバイス上にコンソールを表示するライブラリを紹介します。

https://github.com/Cosmo/TinyConsole

TinyConsoleとは

TinyConsoleは、アプリ上にコンソールを表示するライブラリです。アプリを操作しながらログを確認することができます。

導入

CocoaPodsかCarthageで他のライブラリと同様に導入できます。

Carthage

github "Cosmo/TinyConsole"

CocoaPods

pod 'TinyConsole'

実装

RootViewControllerがTinyConsoleControllerになるようにします。

AppDelegateのdidFinishLaunchingWithOptionsで

window = UIWindow(frame: UIScreen.main.bounds)

let rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!

window?.rootViewController = TinyConsoleController(rootViewController: rootViewController)
window?.makeKeyAndVisible()

と実装します。

ログの出力

ログの出力には以下のようなものがあります。


// 通常のログ出力
TinyConsole.print("hoge")

// 色を指定したログ出力
TinyConsole.print("red hoge", color: UIColor.red)

// エラーメッセージ
TinyConsole.error("何かがおかしいです")

// マーカーを表示
TinyConsole.addMarker()

// コンソールクリア
TinyConsole.clear()

コンソールの表示

TinyConsoleは幾つかのジェスチャーに対応しています。

コンソール表示

デバイスをシェイクします。シミュレーターで実行している場合は「cmd + ctrl + z」です。

マーカー表示

コンソール上を左から右にスワイプします。

ログ出力

コンソール上を2本指でタップします。

クリア・メール送信

コンソール上を3本指でタップすると、メールを送れたりコンソールをクリアしたりすることができます。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?