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.