Tocropviewcontroller: Support iPhone X

Created on 13 Sep 2017  ·  12Comments  ·  Source: TimOliver/TOCropViewController

Jumping in here before anyone else does.

Due to the extremely custom layout of this view controller, it is hilariously broken on iPhone X.

simulator screen shot - iphone x - 2017-09-13 at 15 14 53

For the most part, it should just be a matter of making the tool bar and the crop box insets obey the safe area of iOS 11. It shouldn't be TOO bad to fix.

bug in progress

Most helpful comment

Alright. It's done. I ended up needing to spend a whole day on it, but it's finally done. :D

img_4507

There were a lot of little edge cases that broke by sheer virtue of the fact that the iPhone X notch introduces a pretty substantial offset. A lot of images broke when performing rotation animations on them and the likes.

I tested it very thoroughly on my iPhone X, my iPad and iOS 10.3 in the Simulator, and I'm happy with it.

It's been pushed to CocoaPods under version 2.2. Enjoy!

All 12 comments

@TimOliver When will this issue be fixed?

It's virtually finished in master already. The only thing remaining is I need to set up the toolbar background to extend under the notch, but even that isn't too much of a problem since it isn't noticable.

I plan to close this issue off after I've finished that part. But I've got some other pressing stuff, so I won't commit to any timeframe except 'before the iPhone X is released'. :)

The iPhone X is due out November 3. I am working on another issue with this repository, but I was also hoping to support iPhone X in my app that will be released in the next couple of weeks. Do you happen to have any updates on this? Thanks.

Nope. No updates at the moment sorry. I'm at multiple conferences this week
without my dev setup. XD

Okay. I'm heading home from my conference week now. I had a quick chance to fill in the rest of the iPhone X logic I was missing.

It's all checked into master now. Try pulling it down and see how it looks to you! If all is good, I'll cut a new CocoaPods release after I get back home.

Just tested the master branch. The notch or the system bar overlaps the UI in some situations. This issue affects all devices (iPhone X, iPad, iPhone 8), and also devices running iOS 10.

bildschirmfoto 2017-11-01 um 12 46 15
bildschirmfoto 2017-11-01 um 12 46 35
bildschirmfoto 2017-11-01 um 12 49 03

sorry for bothering. any good news on the issue?

Sorry to bother again Tim. Any updates with this issue? Thanks for this great controller, again.

Sorry for the delay folks! I was Mac-less for all of last week, but I'm back in business now!

Oh jeez, okay. I see the issue. The top inset isn't account for the notch properly still on iPhone X, and not even handling the status bar properly on other iOS devices.

I think I know how to fix it. I'll see if I can smooth it all out today. :)

Okay! I THINK I've smoothed out the majority of issues. The implementation is a bit of a mess so I'll go through it tomorrow and properly refine it to make sure it works properly (It's a matter of testing landscape/portrait on iPad, iPhone and iPhone X. Each have different behaviours with the status bar.)

In the meantime, please grab the latest version from master and see how that looks to you. :)

Hi Tim, thanks for the update! With the new version from master (commit 4835a0), it looks correct on portrait under iOS 11. Configurations that use landscape or iOS 10 still look wrong.

Alright. It's done. I ended up needing to spend a whole day on it, but it's finally done. :D

img_4507

There were a lot of little edge cases that broke by sheer virtue of the fact that the iPhone X notch introduces a pretty substantial offset. A lot of images broke when performing rotation animations on them and the likes.

I tested it very thoroughly on my iPhone X, my iPad and iOS 10.3 in the Simulator, and I'm happy with it.

It's been pushed to CocoaPods under version 2.2. Enjoy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yarodevuci picture yarodevuci  ·  8Comments

muranobu picture muranobu  ·  4Comments

ClaesClaes picture ClaesClaes  ·  6Comments

felipebonezi picture felipebonezi  ·  6Comments

ojseven picture ojseven  ·  7Comments