mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-24 14:00:03 +00:00
Merge pull request #12854 from Florin9doi/ios_share
iOS : Share PPSSPP button
This commit is contained in:
commit
900316aeba
@ -535,7 +535,7 @@ void CreditsScreen::CreateViews() {
|
||||
root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg);
|
||||
root_->Add(new Button(cr->T("Privacy Policy"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnPrivacy);
|
||||
root_->Add(new Button(cr->T("Twitter @PPSSPP_emu"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, rightYOffset + 84, false)))->OnClick.Handle(this, &CreditsScreen::OnTwitter);
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||
root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, rightYOffset + 158, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
|
||||
#endif
|
||||
if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
|
||||
|
@ -12,6 +12,7 @@
|
||||
@interface ViewController : GLKViewController <iCadeEventDelegate,
|
||||
LocationHandlerDelegate, CameraFrameDelegate>
|
||||
|
||||
- (void)shareText:(NSString *)text;
|
||||
- (void)shutdown;
|
||||
|
||||
@end
|
||||
|
@ -148,6 +148,14 @@ static LocationHelper *locationHelper;
|
||||
- (void)subtleVolume:(SubtleVolume *)volumeView didChange:(CGFloat)value {
|
||||
}
|
||||
|
||||
- (void)shareText:(NSString *)text {
|
||||
NSArray *items = @[text];
|
||||
UIActivityViewController * viewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self presentViewController:viewController animated:YES completion:nil];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)viewSafeAreaInsetsDidChange {
|
||||
if (@available(iOS 11.0, *)) {
|
||||
[super viewSafeAreaInsetsDidChange];
|
||||
|
@ -114,6 +114,9 @@ void System_SendMessage(const char *command, const char *parameter) {
|
||||
// [sharedViewController shutdown];
|
||||
// exit(0);
|
||||
// });
|
||||
} else if (!strcmp(command, "sharetext")) {
|
||||
NSString *text = [NSString stringWithUTF8String:parameter];
|
||||
[sharedViewController shareText:text];
|
||||
} else if (!strcmp(command, "camera_command")) {
|
||||
if (!strncmp(parameter, "startVideo", 10)) {
|
||||
int width = 0, height = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user