use performSelector in swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
XPerformSelector
readme.md

readme.md

Trick to performSelector in swift

Background

performSelector is hidden from swift,can't compile if use performSelector in swift. But performSelector is valid in objective-c. With objc bridge,we can use performSelector now.

quick usage

XPerformSelector.perform(self, selector: "test")

don't know how to use objc in swift? read this first

Swift and Objective-C in the Same Project

apis

+(void) perform: (id)target selector:(SEL)selector;
+(void) perform: (id)target selector:(SEL)selector count:(int)count, ...; 

+(void) perform: (id)target selector:(SEL)selector withObject:(id)arg1;
+(void) perform: (id)target selector:(SEL)selector withObject:(id)arg1 withObject:(id)arg2;

+(void) perform: (id)target selector:(SEL)selector afterDelay:(NSTimeInterval)delay;
+(void) perform: (id)target selector:(SEL)selector withObject:(id)arg1 afterDelay:(NSTimeInterval)delay;