Skip to content

vontio/XPerformSelector

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

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;

About

use performSelector in swift

Resources

Stars

Watchers

Forks

Packages

No packages published