Skip to content

Instantly share code, notes, and snippets.

View mspvirajpatel's full-sized avatar
🏠
Working from home

Virajkumar Patel mspvirajpatel

🏠
Working from home
View GitHub Profile
@mspvirajpatel
mspvirajpatel / UIFont+SFUIDisplay.swift
Created August 2, 2017 10:43
Font Extension For Swift
import Foundation
import UIKit
struct SFUIDisplayFontType : OptionSetType
{
let rawValue: Int
init(rawValue: Int) { self.rawValue = rawValue }
static internal let None = SFUIDisplayFontType(rawValue: 0)
static internal let Bold = SFUIDisplayFontType(rawValue: 1)
import Foundation
typealias KVOContext = UInt8
var MyObservationContext = KVOContext()
class Observer: NSObject {
func startObservingPerson(person: Person) {
let options = NSKeyValueObservingOptions([.New, .Old])
person.addObserver(self, forKeyPath: "firstName", options: options, context: &MyObservationContext)
person.addObserver(self, forKeyPath: "lastName", options: options, context: &MyObservationContext)
@mspvirajpatel
mspvirajpatel / BaseButton.swift
Created July 20, 2017 06:46
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.
//
// BaseButton.swift
// ViewControllerDemo
//
import UIKit
import Font_Awesome_Swift
/**
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.