This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIView { | |
func blurView(style: UIBlurEffect.Style) { | |
var blurEffectView = UIVisualEffectView() | |
let blurEffect = UIBlurEffect(style: style) | |
blurEffectView = UIVisualEffectView(effect: blurEffect) | |
blurEffectView.frame = bounds | |
addSubview(blurEffectView) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a new MKMapCamera object. | |
//Looking at, is where you want it to look at, in this example I keep it the same so use the map views current center coordinate | |
//I up the altitude (zoom out) by adding 1600 on to the current position | |
//Pitch and heading are the rotation and angle of the camera | |
let newCameraPosition = MKMapCamera(lookingAtCenterCoordinate: mapView.centerCoordinate, fromDistance: mapView.camera.altitude + 1600, pitch: 50, heading: -30) | |
//Animate the camera, here over 5 seconds with a 1.5 second delay, the options are fairly self explanitory. | |
UIView.animateWithDuration(5, delay: 1.5, options: [.AllowUserInteraction, .CurveEaseInOut], animations: { |
NewerOlder