1 Star 1 Fork 0

lalawue / PageEventBus

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Introduction

PageEventBus was a modular system build for page internal data exchange, UI and business logic independent.

Features

  • UI and business logic independent through view model
  • view model can receive/send event, manipulate view
  • view model can manual connect to event bus
  • events' input/output data are typed
  • business logic's input/output parameters can hide by event bus

How it works

There are 3 roles in this system:

  • page view controller
  • child view controllers
  • subviews

every role have their own view model or page model for business logic, view model can receive and send event through an event bus, view model also has an unowned view/controller reference, so it can manipulate view/controller when needed.

event bus instance was holding by view or view controller create or connect to, keep a weak ref in global manager with typed name, when no view or view controller holding an event bus, it will auto released.

Example

the example shows how page view controller, child view controllers and subviews work together using PageEventBus.

first pod install to genereate .xcworkspace

$ pod install

the InfoViewModel can change information when you type phone or email, ResultViewModel can collect input data when it show on window.

view, view controller, view model, page model, event bus are released when you leave that page.

Repository Comments ( 0 )

Sign in to post a comment

About

PageEventBus was a modular system build for page internal data exchange, UI and business logic independent. expand collapse
Swift and 2 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
1
https://gitee.com/lalawue/PageEventBus.git
git@gitee.com:lalawue/PageEventBus.git
lalawue
PageEventBus
PageEventBus
master

Search