Skip to content

Instantly share code, notes, and snippets.

View cristinaITdeveloper's full-sized avatar
💻
Coding....

Cristina Developer cristinaITdeveloper

💻
Coding....
View GitHub Profile
@freak4pc
freak4pc / MKMultiPoint+Ext.swift
Last active October 10, 2023 07:44
Get a list of coordinates from a MKPolyline / MKRoute
public extension MKMultiPoint {
var coordinates: [CLLocationCoordinate2D] {
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid,
count: pointCount)
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount))
return coords
}
}
@MihaelIsaev
MihaelIsaev / CameraViewController.swift
Created April 16, 2015 19:30
This is the example of camera view for iOS written in Swift
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
@IBOutlet weak var myView: UIView!
var session: AVCaptureSession?
var device: AVCaptureDevice?
var input: AVCaptureDeviceInput?
@igordeoliveirasa
igordeoliveirasa / gist:78a310f0348fcad9b270
Created March 26, 2015 01:41
iOS Loading Overlay View - SWIFT
//
// 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
@tomasbasham
tomasbasham / UIImage+Scale.m
Last active February 1, 2024 19:04
Scale a UIImage to any given rect keeping the aspect ratio
@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.