Skip to content

Instantly share code, notes, and snippets.

View dipkasyap's full-sized avatar

Devi Pd. Ghimire (Dip Kasyap) dipkasyap

View GitHub Profile
//
// SimpleScrollingStack.swift
// A super-simple demo of a scrolling UIStackView in iOS 9
//
// Created by Paul Hudson on 10/06/2015.
// Learn Swift at www.hackingwithswift.com
// @twostraws
//
import UIKit
@dipkasyap
dipkasyap / CalculatorView.swift
Created December 14, 2016 11:18 — forked from natecook1000/CalculatorView.swift
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
case CenterTop
case RightTop
@dipkasyap
dipkasyap / realoadTableView
Created August 16, 2016 06:40
Reloading table view with custom animation
func reload(TableViewWithAnimation tableView:UITableView, animationType:UIViewAnimationOptions){
UIView.transitionWithView(tableView,
duration:0,
options:animationType,
animations:{() -> Void in
tableView.hidden = true
tableView.reloadData()
},
@dipkasyap
dipkasyap / Reg-Ex.swift
Created June 16, 2016 10:35
String extenssion and Reg-Ex
//
// StringExtension.swift
// EddyCab
//
// Created by Bikram on 12/24/15.
// Copyright © 2015 Esig. All rights reserved.
//
import Foundation
//
// indicator.swift
// mTaxi
//
// Created by Saroj on 4/6/16.
// Copyright © 2016 Saroj. All rights reserved.
//
import UIKit
extension UIView{
func addBorderOf(color color:UIColor?, withWidth width:CGFloat?,ofCornorRadious radious:CGFloat?) {
self.layer.borderColor = color?.CGColor
if let width = width{
self.layer.borderWidth = width
} else {
self.layer.borderWidth = 0
}