Giter Site home page Giter Site logo

momo-youngg / uilogview Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 255 KB

Custom UIView which provide a way to view logs not only in the Xcode console but also within the application itself

License: BSD 2-Clause "Simplified" License

Swift 100.00%
ios swift uikit

uilogview's Introduction

UILogView

Overview

UILogView is a project that aims to enhance the logging capabilities of your application. Its purpose is to provide a way to view logs not only in the Xcode console but also within the application itself. By leveraging a custom UIView called UILogView, you can easily incorporate this functionality into your project.

Description

UILogView allows you to display logs generated by your code directly within your application's user interface. It offers a convenient and visually appealing way to view and interact with logs.

Some of the key features of UILogView include:

  • Minimization and maximization: UILogView can be minimized or maximized to control its visibility within the application.
  • Positioning: You can move UILogView to different locations within the view hierarchy by adding it as a subview to your desired view or window.
  • Log copying: UILogView allows you to copy logs to the clipboard for easy sharing or reference.
  • Customization: You can customize the appearance of UILogView, including its size, colors, font, and more, through code.

Usage

There are two main ways to use UILogView in your project:

  1. Adding UILogView as a subview with parameters:
let logView = UILogView.addUILogView(
    on: self.view,
    point: nil,
    appearance: UILogViewAppearance(
        textColorAppearance: [
            .high: .red,
            .low: .white
        ]
    )
)

In this method, you add UILogView as a subview to the specified view, passing in any additional customization parameters you desire.

  1. Instantiating UILogView and adding it as a subview:
let logView = UILogView(
    point: CGPoint(x: 50, y: 50),
    appearance: UILogViewAppearance(
        textColorAppearance: [
            .high: .red,
            .low: .white
        ]
    )
)
self.view.addSubview(logView)

In this approach, you create an instance of UILogView with the desired customization options, such as the initial position, appearance, and more. Then, you add it as a subview to the desired view or window.

Also, you can simply print out the log as follows.

logView.send(log: Log(level: .high, text: "Hello world!"))

By using UILogView in your project, you can conveniently view and interact with logs directly within your application, providing a seamless debugging and monitoring experience.

Example:

UILogView Screenshot

Contact

Any comments on this project are welcome. Feel free to register for the issue.

uilogview's People

Contributors

momo-youngg avatar

Stargazers

Soll4u avatar SeungHwan Lee avatar

Watchers

 avatar

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.