Andrew
Andrew

Reputation: 16051

Custom cut copy and paste UI?

I want to change the buttons on the cut, copy and paste pop over UI to be my own, but i'm not sure how to go about doing this, and whether or not i'd need to design my own UI to do it.

Upvotes: 0

Views: 1018

Answers (2)

occulus
occulus

Reputation: 17014

I agree with Shaggy Frog -- this is the sort of UI element you probably shouldn't change; Apple might reject your app because of it. That aside:

You have access to the system pasteboard since iOS3.0 - this allows you access what is in the system pastebord -- but there's no way I know of to customise the UI popups that appears on default cut/copy/paste enabled UI items.

So you'd have to write custom UI code to pop up your own button, and then interface with UIPasteboard depending on what the user was doing. Note that if doing this on standard UI items, you'd want to disable the default cut/copy/paste popover as well as showing your own when appropriate.

For more info, see the second section at http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iPhoneOSv3.html

Upvotes: 3

Hamidreza Vakilian
Hamidreza Vakilian

Reputation: 860

If you want to change the menu design with yours, first you should disable copy/paste menu. Subclass the UI object and add the delegate:

-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{    
    [UIMenuController sharedMenuController].menuVisible = NO;
    return NO;    
}

The default menu is disabled, now you may design your own menu and display it over that object when a tap or double-tap is performed.

Upvotes: 2

Related Questions