Skip to content
/ QOP Public

🦇 QOP : Lightweight data binding framework base on KVO.

License

Notifications You must be signed in to change notification settings

yuehengwu/QOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QOP

CI Status Version License Platform

中文文档:中文文档

QOP (Queen of pain) is a lightweight data binding solution. The bottom layer is implemented with KVO. Chained calls are elegant and simple, and users do not need to worry about circular references and memory release.

how to use?

  • Quote header files
#import <QOP.h>
  • To avoid listening to the same attribute multiple times, you can perform QOPUNObserve first, then QOPObserve
__weak typeof(self) ws = self;
QOPUNObserve(object, identifier);
[QOPObserve(object, identifier) ​​update:^(id observer, id updatedValue) {
    ws.title = updatedValue;
}];
  • Custom observer and KVO strategy
// QOPKVOPolicy is KVO policy
[QOPSPObserve(observer, target, keypath, QOPKVOPolicyInitial | QOPKVOPolicyAlways) update:^(id observer, id updatedValue) {
    NSLog(@"first exe and always exe");
}];

Installation

Just add it to Podfile:

pod'QOP'

About

🦇 QOP : Lightweight data binding framework base on KVO.

Resources

License

Stars

Watchers

Forks

Packages