3

I've created an extension, in fact a Today Widget, using Xcode 6 and run it on my iOS 8 beta device (I am a registered iOS developer).

However, being new to development, I've encountered this issue with the SLComposeViewController being 'stuck' inside its view (shown below), deeming the user to be unable to interact with it and not be able to consequently post a tweet.

Image for reference:

Is there any way to fix this and bring the SLComposeViewController to the front, in front of the Notification Centre pane? Any help would be appreciated.

Edit: (yay, fixed that "Hello World" text)

2nd Edit: Here's my SLComposeViewController code:

- (IBAction)TwitterShare:(id)sender; {

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController
                                               composeViewControllerForServiceType:SLServiceTypeTwitter];
        [self presentViewController:tweetSheet animated:YES completion:nil];
    }

    else

    {

        UIAlertView *twitterAlert = [[UIAlertView alloc] initWithTitle:@"Uh oh!" message:@"Ensure you have setup a valid Twitter account and/or you have allowed access for Twitter in this application." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];


        [twitterAlert show];
        twitterAlert = nil;
    }

}
Kampai
  • 22,848
  • 21
  • 95
  • 95
iPwnTech
  • 545
  • 2
  • 5
  • 20
  • Can you please share your SLComposeViewController code? – David Gölzhäuser Jun 09 '14 at 07:33
  • Shared as above, any help would be great! – iPwnTech Jun 09 '14 at 07:37
  • FYI IIRC you can't use the keyboard from a Today extension. Let me try and find the reference on that. – Yazid Jun 09 '14 at 11:43
  • 3
    Found it. From the [App Extensions Programming Guide](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/NotificationCenter.html#//apple_ref/doc/uid/TP40014214-CH11-SW1): "Because user interaction with widgets is quick and limited, you should design a simple, streamlined UI that highlights the information users are interested in. In general, it’s a good idea to limit the number of interactive items in a widget. In particular, **note that iOS widgets don’t support keyboard entry.**" – Yazid Jun 09 '14 at 11:48
  • Looks like you really need to [adjust the height](http://stackoverflow.com/a/24042262/2446155) – Andrew Jun 09 '14 at 14:56

1 Answers1

2

According to Apple's documentation SLComposeViewController is not allowed to be shown in NC. They want anything that requires keyboard entry to happen in-app.

Stephen
  • 1,427
  • 1
  • 17
  • 42