Fixed minor bug with window hierarchy

Fixed bug: "Warning: Attempt to present UIActivityViewController on MainViewController whose view is not in the window hierarchy!"