Giter Site home page Giter Site logo

cosmo / tinyconsole Goto Github PK

View Code? Open in Web Editor NEW
2.0K 30.0 89.0 1.07 MB

πŸ“±πŸ’¬πŸš¦ 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.

License: MIT License

Swift 97.83% Objective-C 2.17%
console helper log ios tool events

tinyconsole's Introduction

 text

TinyConsole

Platform iOS Carthage compatible License MIT

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

 text

Requirements

  • Xcode 11
  • Swift 5
  • iOS 11 or greater

Installation

Add this to your Cartfile:

github "Cosmo/TinyConsole"

Manually

Just drag the source files into your project.

Hierarchy

 text

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.

tinyconsole's People

Contributors

cosmo avatar freegor avatar kwongfung avatar mrs- avatar ohitsdaniel avatar readmecritic avatar sebastianvarela avatar tiagomartinho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinyconsole's Issues

iOS 8 support

I noticed that iOS 8 is supported now, but in the .podspec file :

s.ios.deployment_target = '9.0'

is still 9.0...

Please update the CocoaPod repo, THX : )

new build system support, error: Multiple commands produce

Hey, just wanted to say TinyConsole is a great project!

If you're using Cocoapods and TinyConsole with the Xcode's new build system, there's a configuration problem with how the podspec specifies input sources causing this error:

Multiple commands produce '/DerivedData/Build/Products/Debug-iphoneos/TinyConsole/TinyConsole.framework/Info.plist':
1) Target 'TinyConsole' (project 'Pods') has copy command from '/Pods/TinyConsole/TinyConsole/Supporting Files/Info.plist' to '/DerivedData/Build/Products/Debug-iphoneos/TinyConsole/TinyConsole.framework/Info.plist'
2) Target 'TinyConsole' (project 'Pods') has process command with output '/DerivedData/Build/Products/Debug-iphoneos/TinyConsole/TinyConsole.framework/Info.plist'

πŸ“Ž CocoaPods/CocoaPods#8125

  s.source_files = "TinyConsole/**/*"
  s.exclude_files = "TinyConsole/**/*.plist"

If the podspec declaration for s.source_files paths only specifies *.h and *.swift, it should fix the problem. Otherwise the Info.plist is processed as source (as opposed to a resource) and causes this error.

Storyboard compatibility

Is it possible to use TinyConsole with storyboards?

Whenever I try to set UIWindow (which wasn't set before) whenever code that comes from a storyboard outlet gets run, it crashes: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) and the Xcode console says:

fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb) 

My guess is I can't use this with storyboards, but if that is possible please explain how.

Mirroring XCode Console

I am quite a beginner in swift and objc, but is there a way to completely mirror what's shown in the Xcode Console?

Installation instructions are a little unclear

Using XCode 11.4, Swift 5.2, and only either Swift Package Manager or manual framework install (we do not use Carthage nor Cocoapods), how do we install TinyConsole?

Building from source and importing the Swift module does not work, "just including the sources" as suggested in the README also does not work.

A minimal test case always throws the error No such module 'TinyConsole'. What's the correct way to include this library?

can't show console window

can't work either device or simulator, ios 10.0.3 or 11.0.0 doesn't work normal,can't show the console window

Support Cocoapods

Hello,

Nice doing here. Are you planning on creating a pod for it?

Thanks,
H.

Outdated Swift

You may want to update the Swift source for 2.3 or 3.0.

Status bar appearance

Hello!
View controller-based status bar appearance does not work if I use TinyConsoleController.
I think that TinyConsoleController should take view controller-based values from rootViewController

Coloured output

Hey there,

It would be really cool if it would support coloured text output. So for an error it'll be red, warning orange etc. Colours which I can manually define. Not sure if that would be an overkill, but I would welcome it.

Something like this would be good enough for my purposes (the 'color' parameter being optional and defaulting to nil):

TinyConsole.print("hello", color: UIColor.red)

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.