Skip to content

Commit

Permalink
Add note
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Nov 6, 2017
1 parent 16ffd4e commit 69a994f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Finjinon/PhotoCaptureViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ open class PhotoCaptureViewController: UIViewController, PhotoCollectionViewLayo

open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

// Setting subviews in viewDidAppear is not a great solution... It's a fix to respect Safe Areas (known after
// viewDidAppear) for iPhone X in particular. Setting positions constrained to Safe Area would allow for more
// flexibility with Auto Layout, and thus creating the subViews in viewDidLoad/viewWillAppear would be possible again.

if #available(iOS 11.0, *) {
view.insetsLayoutMarginsFromSafeArea = true
viewFrame = view.convert(view.safeAreaLayoutGuide.layoutFrame, to: view.superview ?? view)
Expand Down

0 comments on commit 69a994f

Please sign in to comment.