iOS click button to copy the specified content

Man of few words said, directly on the map and code:

To achieve such a click you can copy the function:

// "Copy" button click method 
- ( void ) {fuzhiBtnClick 
    NSLog ( @ " copy " ); 
    
    UIPasteboard * PAB = [UIPasteboard generalPasteboard]; 

    . PAB String = @ " what you need to copy " ; 

    IF (PAB == nil ) { 
        kSVProgressError ( @ " copy failed " ); 
        
    } the else { 
        kSVProgressSuccess ( @ " copied " ); 
    } 
}

Very simple ~

Guess you like

Origin www.cnblogs.com/liuzhi20101016/p/11778101.html