Skip to content

Instantly share code, notes, and snippets.

@M8Games
M8Games / gist:71e748db62d1a35e9477
Last active August 29, 2015 14:19
Swift - Class and method output
println("\(__FILE__.lastPathComponent.stringByDeletingPathExtension) \(__FUNCTION__)")
// Sample output: ViewController viewDidLoad()
@M8Games
M8Games / gist:274d0e255e915e0ff101
Last active August 29, 2015 14:19
Swift - Scale up low resolution map tiles to show on retina screens
// Somewhere in ViewController:
func changeMapOverlay() {
mapOverlay = MyTileOverlay( URLTemplate: "http://tile.openstreetmap.org/{z}/{x}/{y}.png" )
mapOverlay!.canReplaceMapContent = true
mapOverlay!.tileSize = CGSize( width: 512, height: 512 )
self.mapView.addOverlay( self.mapOverlay, level: .AboveLabels )
//
// ShadowView.swift
//
import UIKit
@IBDesignable
class ShadowView: UIView {
@IBInspectable var startAlpha: CGFloat = 90 {