iOS開源 - 應用信息輸出微控制臺
TinyConsole
A tiny log console to display information while using your iOS app. Written in Swift 3.
Usage
Create a TinyConsoleController -Instance and pass your App-ViewController as a rootViewController parameter.
TinyConsoleController(rootViewController: MyMainViewController())
Actions
TinyConsole.shared.print(text: "hello")
TinyConsole.shared.addMarker()
TinyConsole.shared.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.
Installation
Carthage
Add this to your Cartfile:
github "Cosmo/TinyConsole"
Manually
Just drag the source files into your project.
Hierarchy
本文由用戶 sgoc4786 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!