Skip to content

Instantly share code, notes, and snippets.

//
// ViewController.swift
// BluetoothExample
//
// Created by Mark Jackson on 3/18/15.
// Copyright (c) 2015 Mark Jackson. All rights reserved.
//
import UIKit
import CoreBluetooth
@jacks205
jacks205 / CustomView.swift
Last active August 29, 2015 14:17
Some Path and Image drawing in Swift
//
// CustomView.swift
// BluetoothExample
//
// Created by Mark Jackson on 3/18/15.
// Copyright (c) 2015 Mark Jackson. All rights reserved.
//
import UIKit
@jacks205
jacks205 / TimeEstimateCell.swift
Created March 27, 2015 06:25
Old style of custom cell for Routes
//
// TimeEstimateCell.swift
// Routes
//
// Created by Mark Jackson on 3/21/15.
// Copyright (c) 2015 Mark Jackson. All rights reserved.
//
import UIKit
class TimeEstimateCell: UITableViewCell {
@jacks205
jacks205 / addGradientToBezierPath.swift
Created April 5, 2015 01:35
How to add a gradient layer to bezierpath swift
func fillTrafficIndicatorBase(ref : CGContextRef, rect : CGRect, cornerRadius : CGFloat, colorLight : CGColorRef, colorDark: CGColorRef, fillWidth : CGFloat){
CGContextSaveGState(ref)
let gradient : CGGradientRef = CGGradientCreateWithColors(Colors.genericRGBSpace(), [colorLight, colorDark], nil)
let path = UIBezierPath(roundedRect: rect, cornerRadius: cornerRadius)
path.fill()
path.addClip()
CGContextDrawLinearGradient(ref, gradient, CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect)), CGPointMake(CGRectGetMidX(rect), CGRectGetMaxY(rect)), 0)
CGContextRestoreGState(ref)
}
@jacks205
jacks205 / resignKeyboardScrollView.swift
Created April 5, 2015 01:40
Resigning keyboard when using a searchbar and a tableview
func scrollViewWillBeginDragging(scrollView: UIScrollView) {
self.searchBar.resignFirstResponder()
}
@jacks205
jacks205 / MapDirections.swift
Created April 6, 2015 07:29
MKMapKit showing route and zooming to show source and destination
//
// ViewController.swift
// MapDirections
//
// Created by Mark Jackson on 4/5/15.
// Copyright (c) 2015 Mark Jackson. All rights reserved.
//
import UIKit
import MapKit
@jacks205
jacks205 / XMLtoFile.cs
Created June 11, 2015 18:58
Write to XML File C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace JanteqTestConsoleApplication
{
public class Program
//
// InflatingCircleIndicatorView.swift
// Spots
//
// Created by Mark Jackson on 9/24/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit
//
// ViewController.swift
// CirclePieViewExample
//
// Created by Mark Jackson on 10/8/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit
//
// CirclePieView.swift
// CirclePieViewExample
//
// Created by Mark Jackson on 10/8/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit