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
public extension MKMultiPoint { | |
var coordinates: [CLLocationCoordinate2D] { | |
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid, | |
count: pointCount) | |
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount)) | |
return coords | |
} | |
} |
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 | |
import AVFoundation | |
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { | |
@IBOutlet weak var myView: UIView! | |
var session: AVCaptureSession? | |
var device: AVCaptureDevice? | |
var input: AVCaptureDeviceInput? |
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
// | |
// LoadingOverlay.swift | |
// app | |
// | |
// Created by Igor de Oliveira Sa on 25/03/15. | |
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved. | |
// | |
// Usage: | |
// | |
// # Show Overlay |
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
@implementation UIImage (scale) | |
/** | |
* Scales an image to fit within a bounds with a size governed by | |
* the passed size. Also keeps the aspect ratio. | |
* | |
* Switch MIN to MAX for aspect fill instead of fit. | |
* | |
* @param newSize the size of the bounds the image must fit within. | |
* @return a new scaled image. |