Code Monkey home page Code Monkey logo

navi's Introduction

Navy

Version Liscence Platform Swift4.2

This is a tool which could easily observe and visualize each route and flow we are tracking on the real time.

There will display a tips view when your cursor is floating on a node text if you have configured the info that you want to show.

Intent

For a big App, sometime it's hard to check and debug which route we are using. what reaction will be happened once we click somewhere. in order to easily check those scenario whether or not meet the expectation, this tool is created to tackle this requirement.

Getting Started

This Navy framework has a demo app that you can run it directly following the below steps to see what it looks like and how it runs. But if you want to integrate it into your project, you have to replace the BundleId with your project BundleId in run-navy.sh script and move this script into your project folder.

Prerequistes

  1. Install npm
brew install node
  1. Install Browsersync
npm install -g browser-sync

Running Demo App

If you want to run demo app, you just need to cd to the Navy project path and execute pod install Then you have to run demo app first before you execute the command below.

./run-navy.sh

Integration

Cocoapods

Navy is on Cocoapods! After setting up Cocoapods in your project, simply add the folowing to your Podfile:

pod 'Navy'

then run pod install from the directory containing the Podfile!

Don't forget to import Navy when you use it.

Conform the NaviProtocol

class Navigation: NaviProtocol {
    // Return root node name
    func rootNodeName() -> String {
        return "Navy"
    }
    
    // Return tabBar controllers 
    func tabBarViewControllers() -> [String] {
        return ["NavyDemo.FavoriteViewController", "NavyDemo.DownloadViewController", "NavyDemo.HistoryViewController"]
    }

    // Map the business logic document link to corresponding node
    func mapBusinessLogicDocument() -> [String: String] {
        return ["NavyDemo.FavoriteViewController": "https://en.wikipedia.org/wiki/Marie_Curie",
                "NavyDemo.ListViewController": "https://en.wikipedia.org/wiki/Albert_Einstein",
                "NavyDemo.DetailViewController": "https://en.wikipedia.org/wiki/Tu_Youyou",
                "NavyDemo.SettingViewController": "https://en.wikipedia.org/wiki/Alan_Turing",
                "NavyDemo.DownloadViewController": "https://en.wikipedia.org/wiki/Main_Page"]
    }
}

Note: if you are using custome Navigation, you have to implement the two optional protocols.

func currentController() -> UIViewController {
    // Return current controller
}

func previousController() -> UIViewController {
    // Return previous controller
}

Last, call the setup(with:) method and pass the instance has implemented NaviProtocol.

NaviHeader.shared.setup(with: Navigation())

Running Your Project

You have to run your project first before you execute the command below.

โš ๏ธ Don't forget to replace BundleId and move script into your project.

./run-navy.sh

Thanks

TODO

  • Display the code line number of the action which we are tracking
  • Display call stack on web page
  • Redirect to a new page by clicking the text on a node
  • Map business logic documents
  • Display history router paths
  • Adapt mobile screen
  • Monitor the network

Requirements

  • Swift 4.2+
  • iOS 11.0+

Contributing

Pull requests, feature requests and bug reports are welcome ๐Ÿš€

navi's People

Contributors

chaichai666 avatar chaihuoa avatar

Watchers

James Cloos avatar  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.