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
func configureDetailView(annotationView: MKAnnotationView) { | |
let width = 300 | |
let height = 200 | |
let snapshotView = UIView() | |
let views = ["snapshotView": snapshotView] | |
snapshotView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[snapshotView(300)]", options: [], metrics: nil, views: views)) | |
snapshotView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[snapshotView(200)]", options: [], metrics: nil, views: views)) | |
self.takeSnapshot(mapView , annotationView: annotationView) { (image, error) in |
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
let a = [1,2,3,4,5,6] | |
let startIndex = 5 | |
let endIndex = a.count | |
for i in stride(from: 0, to: endIndex, by: 1) { | |
let newIndex = (i + startIndex) % endIndex | |
print(newIndex) | |
} |
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
// MARK: - <#label#> | |
// TODO: [your to-do item] | |
// FIXME: [your bug fix reminder] | |
#warning("Some string to display") | |
#error("Some error to display") |