uservoice / uservoice-ios-sdk

UserVoice iOS SDK
https://www.uservoice.com/mobile/
Other
335 stars 218 forks source link

Non-Modal presentation for UserVoice Interface #66

Open pulkitsinghal opened 12 years ago

pulkitsinghal commented 12 years ago

I would like the flexibility of presenting the UserVoice screen-set in a fashion other than a modal view. For example, my current usecase requires me to present it as a tab bar item in a UITabBarController

Therefore I would like to contribute some edits where a UIViewController is returned for folks to work with, as they please. In my case I can also contribute an example to the other git project, showcasing how to utilize this easily in a tab bar controller.

Before I go & fork-off to make said changes ... I would like to hear some opinions: Is this something that the maintainers of UserVoice would be willing to accept if I were to issue a pull request, at least in principle? I can understand if my coding style raises any objections :)

pulkitsinghal commented 12 years ago
+ (UIViewController *) getUserVoiceInterfaceForConfig : (UVConfig *)config
{
    UIViewController *viewController;
    if ([[UVSession currentSession] clientConfig])
        viewController = [[[UVWelcomeViewController alloc] init] autorelease];
    else
        viewController = [[[UVRootViewController alloc] init] autorelease];

    [UVSession currentSession].config = config;
    [UVSession currentSession].isModal = NO;
    // Capture the launch orientation, then store it in NSDefaults for reference in all other UV view controller classes
    [UVClientConfig setOrientation];

    UINavigationController *navigationController = [[[UINavigationController alloc] init] autorelease];
    navigationController.navigationBar.tintColor = [UVStyleSheet navigationBarTintColor];
    navigationController.viewControllers = [NSArray arrayWithObject:viewController];

    return navigationController;
}
bassrock commented 11 years ago

I agree this should definitely be added!

austintaylor commented 11 years ago

I am reviewing the pull request now. It looks really good.

austintaylor commented 11 years ago

Not yet. Now that 2.0 is out I should have some time to test this.

pulkitsinghal commented 11 years ago

Here is a diff that I applied which worked very well for me after incorporating 2.0.4 into my iPhone app: https://gist.github.com/4429396

austintaylor commented 11 years ago

Hi @pulkitsinghal

Thanks for contributing this! I tried it out with a UITabBarController and found a few issues.

Also, are you using this on the iPad in some way? Maybe in a master-detail view of some kind? I didn't test on the iPad, but I imagine there would be more problems because the views would likely have different dimensions than the regular form sheet.

pulkitsinghal commented 11 years ago

I suppose what I should have said was: "Here's a diff that at least got the nav bar rendering in my tab bar again ... once I hastily upgraded to 2.0.4 ... are there still any plans / requests-from-the-masses on taking this idea and making it into a functional enhancement?" I'm only using it on iPhone for now.

g3ntleman commented 10 years ago

We'd also like to use it in a NavigationController.

Any news on the topic?

AdamBCo commented 9 years ago

Can someone at UserVoice please address this issue? I love the product, but the inability to customize the transition style or presentation style is a major let down.