mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
Fix host long press causing duplicate menus to show up
This commit is contained in:
@@ -80,7 +80,7 @@ static const int LABEL_DY = 20;
|
|||||||
_host = host;
|
_host = host;
|
||||||
_callback = callback;
|
_callback = callback;
|
||||||
|
|
||||||
UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(hostLongClicked)];
|
UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(hostLongClicked:)];
|
||||||
[_hostButton addGestureRecognizer:longPressRecognizer];
|
[_hostButton addGestureRecognizer:longPressRecognizer];
|
||||||
[_hostButton addTarget:self action:@selector(hostClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[_hostButton addTarget:self action:@selector(hostClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
|
|
||||||
@@ -169,8 +169,10 @@ static const int LABEL_DY = 20;
|
|||||||
[self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
|
[self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) hostLongClicked {
|
- (void) hostLongClicked:(UILongPressGestureRecognizer*)gesture {
|
||||||
[_callback hostLongClicked:_host view:self];
|
if (gesture.state == UIGestureRecognizerStateBegan) {
|
||||||
|
[_callback hostLongClicked:_host view:self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) hostClicked {
|
- (void) hostClicked {
|
||||||
|
|||||||
Reference in New Issue
Block a user