Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitScreen support for iPhone after iOS 8. #705

Merged
merged 3 commits into from
Aug 10, 2015

Conversation

ohammersmith
Copy link
Contributor

After iOS 8 UISplitViewController is available on iPhone as well as iPad.

Tests run on iPad I wasn't able to run tests on the iPhone 6 or 6 plus simulator before or after this change.

I did test in situ in one of my applications, had no issues.

I'm open to suggestions for automated tests here.

@jamonholmgren
Copy link
Owner

Nice, @ohammersmith ! Is the API exactly the same on iPhones?

@ohammersmith
Copy link
Contributor Author

Yep, identical. See the UISplitViewController Class Reference:

In iOS 8 and later, you can use the UISplitViewController class on all iOS devices; in previous versions of iOS, the class is available only on iPad.

@squidpunch
Copy link
Contributor

👍

jamonholmgren added a commit that referenced this pull request Aug 10, 2015
SplitScreen support for iPhone after iOS 8.
@jamonholmgren jamonholmgren merged commit 4f4b0ac into jamonholmgren:master Aug 10, 2015
@jamonholmgren
Copy link
Owner

Thanks @ohammersmith !! Will be in the next version of ProMotion.

@markrickert
Copy link
Contributor

Thanks so much for this change, @ohammersmith! I just implemented a split screen on one of my apps when iPad or iPhone 6 Plus! (I kept it a uinavigtationcontroller for iPhone 6 and under just because of screen size and multiple ios version support., but the iPhone 6 Plus will never be less than iOS 8)

@markrickert
Copy link
Contributor

im having a weird issue on the iphone 6 plus where my master controller has a left and right nav button and in portrait mode when i tap a table row to open a detail screen it actually transfers one of the buttons over to the detail view controller, hiding the back button. It's really weird.

Here's my code:

  def open_style(args, index_path)
    self.selected_cell = index_path

    open_args = args
    open_args = args.merge({search_string: search_string}) if searching?
    if device.ipad? || device.five_point_five_inch?
      app.hide_keyboard
      open(DetailScreen.new(open_args), in_detail: true)
    else
      open(DetailScreen.new(open_args))
    end
  end

And a gif of it happening. Any ideas of what's going on here???

2015-08-16 11_17_27

@jamonholmgren
Copy link
Owner

Just an aside, ProMotion will ignore in_detail silently if not in a master/detail situation, so you can usually avoid the if device.ipad? thing.

Not sure what's happening with that button.

@ohammersmith
Copy link
Contributor Author

@markrickert only have time for a quick glance, but one thing I noticed when doing this patch is that ProMotion is replacing the respective view controllers, when the API docs say it's best to use showViewController and showDetailViewController.

I had suspected that this might cause strange issues, but I hadn't had time to dig in. I wonder if you've discovered one of the corner cases that are created by doing it this way.

If you're still having issues I can take a better look Tuesday.

@jamonholmgren
Copy link
Owner

Those methods are new in iOS 8, from what I understand, so we were doing it the iOS 6 & 7 way. We still support iOS 7, but we can update it to the new API eventually. Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants