mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Fix broken app and host taps on iOS 8
This commit is contained in:
@@ -40,7 +40,12 @@ static UIImage* noImage;
|
|||||||
[_appButton setBackgroundImage:noImage forState:UIControlStateNormal];
|
[_appButton setBackgroundImage:noImage forState:UIControlStateNormal];
|
||||||
[_appButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
|
[_appButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
|
||||||
[_appButton sizeToFit];
|
[_appButton sizeToFit];
|
||||||
|
if (@available(iOS 9.0, tvOS 9.0, *)) {
|
||||||
[_appButton addTarget:self action:@selector(appClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[_appButton addTarget:self action:@selector(appClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[_appButton addTarget:self action:@selector(appClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
|
||||||
[self addSubview:_appButton];
|
[self addSubview:_appButton];
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
|
|||||||
@@ -49,7 +49,12 @@ static const int LABEL_DY = 20;
|
|||||||
|
|
||||||
[_hostButton setBackgroundImage:[UIImage imageNamed:@"Computer"] forState:UIControlStateNormal];
|
[_hostButton setBackgroundImage:[UIImage imageNamed:@"Computer"] forState:UIControlStateNormal];
|
||||||
[_hostButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
|
[_hostButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
|
||||||
|
if (@available(iOS 9.0, tvOS 9.0, *)) {
|
||||||
[_hostButton addTarget:self action:@selector(addClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[_hostButton addTarget:self action:@selector(addClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[_hostButton addTarget:self action:@selector(addClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
[_hostButton sizeToFit];
|
[_hostButton sizeToFit];
|
||||||
|
|
||||||
[_hostLabel setText:@"Add Host"];
|
[_hostLabel setText:@"Add Host"];
|
||||||
@@ -84,7 +89,13 @@ static const int LABEL_DY = 20;
|
|||||||
|
|
||||||
UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(hostLongClicked:)];
|
UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(hostLongClicked:)];
|
||||||
[_hostButton addGestureRecognizer:longPressRecognizer];
|
[_hostButton addGestureRecognizer:longPressRecognizer];
|
||||||
|
|
||||||
|
if (@available(iOS 9.0, tvOS 9.0, *)) {
|
||||||
[_hostButton addTarget:self action:@selector(hostClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[_hostButton addTarget:self action:@selector(hostClicked) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[_hostButton addTarget:self action:@selector(hostClicked) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
|
||||||
[self updateContentsForHost:host];
|
[self updateContentsForHost:host];
|
||||||
[self updateBounds];
|
[self updateBounds];
|
||||||
|
|||||||
Reference in New Issue
Block a user