Silver Solution


Here is my solution for silver challenge.

At first, I declare a property for our menu.

@property (nonatomic, weak) UIMenuController *menu;

And Then, added the following statments at the top of every touch/event methods.

if (self.selectedLine) {

At the last, updated the moveLine method as follow.

// If we have not selected a line, we do not do anything here
if (!self.selectedLine) {
    // Else remove menu.
} else {
    [ setMenuVisible:NO animated:YES];

It is worked properly. Thanks you.