项目作者: srea

项目描述 :
Real Time viewing attached RIBs Tree on Browser
高级语言: Swift
项目地址: git://github.com/srea/RIBsTreeViewerClient.git
创建时间: 2018-12-20T13:51:23Z
项目社区:https://github.com/srea/RIBsTreeViewerClient

开源协议:MIT License

下载



Carthage compatible

RIBsTreeViewer

Real Time viewing attached RIBs Tree on Browser

Demo

Using the Libraries

XCFramework

Add the xcframework to your project。

  1. ./Products/RIBsTreeViewerClient.xcframework

CocoaPods

This is not supported because the RIBs do not provide an up-to-date PodSpec, making it difficult to resolve dependencies.

Carthage

  1. github "srea/RIBsTreeViewerClient"
  1. $ carthage update --platform iOS --no-use-binaries

Build Phase


Carthage CopyFrameworks (ONLY DEBUG)

  1. if [ ${CONFIGURATION%%-*} == "Debug" ]; then
  2. /usr/local/bin/carthage copy-frameworks
  3. fi

Basic setup

  1. @UIApplicationMain
  2. public class AppDelegate: UIResponder, UIApplicationDelegate {
  3. private var ribsTreeViewer: RIBsTreeViewer? = nil
  4. public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  5. let window = UIWindow(frame: UIScreen.main.bounds)
  6. self.window = window
  7. let result = RootBuilder(dependency: AppComponent()).build()
  8. let launchRouter = result.launchRouter
  9. self.launchRouter = launchRouter
  10. urlHandler = result.urlHandler
  11. launchRouter.launch(from: window)
  12. startRIBsTreeViewer(launchRouter: launchRouter)
  13. return true
  14. }
  15. }
  1. // MARK: - RIBsTreeViewer
  2. #if DEBUG
  3. import RIBsTreeViewerClient
  4. extension AppDelegate {
  5. private func startRIBsTreeViewer(launchRouter: Routing) {
  6. if #available(iOS 13.0, *) {
  7. ribsTreeViewer = RIBsTreeViewerImpl.init(router: launchRouter,
  8. options: [.webSocketURL("ws://0.0.0.0:8080"),
  9. .monitoringIntervalMillis(1000)])
  10. ribsTreeViewer?.start()
  11. } else {
  12. // RIBsTreeViewer is not supported OS version.
  13. }
  14. }
  15. }
  16. #endif

Installing

  1. $ npm install yarn

Starting the websocke server

  1. $ npx yarn install
  2. $ node index.js

Open the page.

  1. $ npx yarn install
  2. $ npx webpack
  3. $ open ./public/index.html