Moved the dismiss call before the delegate call.
Some fixes for iOS 8.
Fixed constraints for iOS 8. Fixed status bar offset for iPad and iOS 8.
Removed redundand code logic.
Merge remote-tracking branch 'upstream/master'

Merge with upstream to keep in sync.