All Projects → alibaba → Lokie

alibaba / Lokie

Licence: MIT license
iOS efficient AOP Library using C++ and libffi

Programming Languages

c
50402 projects - #5 most used programming language
Objective-C++
1391 projects
C++
36643 projects - #6 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Lokie

Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (-5.76%)
Mutual labels:  efficient
Selecsls Pytorch
Reference ImageNet implementation of SelecSLS CNN architecture proposed in the SIGGRAPH 2020 paper "XNect: Real-time Multi-Person 3D Motion Capture with a Single RGB Camera". The repository also includes code for pruning the model based on implicit sparsity emerging from adaptive gradient descent methods, as detailed in the CVPR 2019 paper "On implicit filter level sparsity in Convolutional Neural Networks".
Stars: ✭ 251 (+80.58%)
Mutual labels:  efficient
NCop
Composite-aspect oriented framework for .NET
Stars: ✭ 30 (-78.42%)
Mutual labels:  aop
Efficientnet
Implementation of EfficientNet model. Keras and TensorFlow Keras.
Stars: ✭ 1,920 (+1281.29%)
Mutual labels:  efficient
Amber
A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
Stars: ✭ 2,345 (+1587.05%)
Mutual labels:  efficient
controller-logger
AOP based API logging for Spring Boot
Stars: ✭ 57 (-58.99%)
Mutual labels:  aop
Kgtk
Knowledge Graph Toolkit
Stars: ✭ 81 (-41.73%)
Mutual labels:  efficient
exificient
Java Implementation of EXI
Stars: ✭ 49 (-64.75%)
Mutual labels:  efficient
Flutter commonapp
打造一款通用的AppUI结构,包括登录、注册等通用 UI 界面及各工具类和公共部分。
Stars: ✭ 227 (+63.31%)
Mutual labels:  efficient
neutron-language
A simple, extensible and efficient programming language based on C and Python
Stars: ✭ 32 (-76.98%)
Mutual labels:  efficient
Pyeco
python implementation of efficient convolution operators for tracking
Stars: ✭ 150 (+7.91%)
Mutual labels:  efficient
S2v
ICLR 2018 Quick-Thought vectors
Stars: ✭ 191 (+37.41%)
Mutual labels:  efficient
Norns
dotnet core aop static weaving on roslyn
Stars: ✭ 23 (-83.45%)
Mutual labels:  aop
Nim
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Stars: ✭ 12,270 (+8727.34%)
Mutual labels:  efficient
jazzle
An Innovative, Fast Transpiler for ECMAScript 2015 and later
Stars: ✭ 65 (-53.24%)
Mutual labels:  efficient
Stm32 Dma Uart
Efficient DMA timeout mechanism for peripheral DMA configured in circular mode demonstrated on a STM32 microcontroller.
Stars: ✭ 111 (-20.14%)
Mutual labels:  efficient
PyGLM
Fast OpenGL Mathematics (GLM) for Python
Stars: ✭ 167 (+20.14%)
Mutual labels:  efficient
Deflector.NET
A library for intercepting all method calls at runtime in nearly any .NET application.
Stars: ✭ 80 (-42.45%)
Mutual labels:  aop
langx-java
Java tools, helper, common utilities. A replacement of guava, apache-commons, hutool
Stars: ✭ 50 (-64.03%)
Mutual labels:  aop
JSON-For-Mirc
JSON parser for mIRC
Stars: ✭ 19 (-86.33%)
Mutual labels:  efficient

LOKIE

A framework for building iOS AOP.

Support iOS 8.0+

building Lokie

  • open Lokie.xcodeproj with Xcode and build it
  • defualt configuration will build Lokie.framework for you
  • you can use Lokie.framework as other normal framework in your project
  • Enjoy it.

Use Lokie

API

//! Lokie.h
#import <Foundation/Foundation.h>

typedef enum : NSUInteger {
    LokieHookPolicyBefore = 1 << 0,
    LokieHookPolicyAfter = 1 << 1,
    LokieHookPolicyReplace = 1 << 2,
    LokieHookPolicyPatchEnv = 1 << 3,
} LokieHookPolicy;

@interface NSObject (Lokie)

+ (BOOL) Lokie_hookMemberSelector:(NSString *) selecctor_name
                        withBlock: (id) block
                           policy:(LokieHookPolicy) policy;

+ (BOOL) Lokie_hookClassSelector:(NSString *) selecctor_name
                       withBlock: (id) block
                          policy:(LokieHookPolicy) policy;

+ (BOOL) Lokie_resetSelector:(NSString *) selector_name withType:(BOOL) isMember;

+ (NSArray *) LokieErrorStack;

@end

How to use

#include <Lokie/Lokie.h>

//! insert something before UIViewController::viewDidAppear:
Class cls = NSClassFromString(@"UIViewController");
[cls Lokie_hookMemberSelector:@"viewDidAppear:" withBlock:^(id target, BOOL ani){
        NSLog(@"LOKIE: before viewDidAppear");
 }policy:LokieHookPolicyBefore];

[cls Lokie_hookMemberSelector:@"viewDidAppear:" withBlock:^(id target, BOOL ani){
         NSLog(@"LOKIE: after viewDidAppear");
 }policy:LokieHookPolicyAfter];
 
//! we can insert some code before/after 
Class cls = NSClassFromString(@"MyViewController");
[cls Lokie_hookMemberSelector:@"initWithConfig:"
                    withBlock:^(id target, NSDictionary *param){
                        NSLog(@"%@", param);
                        NSLog(@"Lokie: %@ is created", target);
} policy:LokieHookPolicyAfter];
    
//! hooked selector does not has any param
[cls Lokie_hookMemberSelector:@"dealloc" withBlock:^(id target){
        NSLog(@"Lokie: %@ is dealloc", target);
} policy:LokieHookPolicyBefore];

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].