Silver Solution


#1

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) {
    return;
}

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) {
    return;
    // Else remove menu.
} else {
    [self.menu setMenuVisible:NO animated:YES];
}

It is worked properly. Thanks you.