Photo Extension, How Does Photo Place My view controller's view?

When creating a Photos extension on OS X, I see my view controller's view gets placed at frame origin 0, 0, so it hugs the lower left.


How do I tell Photos to center my view controller's view? I tried doing it manually, and it doesn't work (if it did it would be kind of dirty because the parent should do it).


I also tried setting preferredScreenOrigin but that doesn't seem to work with Photo Extensions.

The view controller for my Photos extension inherits from a view controller for another extension, which sets the preferred content size. Setting that property clamps the view controller at a smaller size than the frame Photos gives me, which would be fine if I could tell Photos to center my view controller.


If I don't set the preferred content size on the view controller, my view controller's view is full-sized in its container. So I guess the right approach would be to have my Photo extension view controller be full sized...and then wrap a smaller subview, and center that subview.

Accepted Answer

The view controller for my Photos extension inherits from a view controller for another extension, which sets the preferred content size. Setting that property clamps the view controller at a smaller size than the frame Photos gives me, which would be fine if I could tell Photos to center my view controller.


If I don't set the preferred content size on the view controller, my view controller's view is full-sized in its container. So I guess the right approach would be to have my Photo extension view controller be full sized...and then wrap a smaller subview, and center that subview.

Photo Extension, How Does Photo Place My view controller's view?
 
 
Q