Skip to content

Instantly share code, notes, and snippets.

View dipkasyap's full-sized avatar

Devi Pd. Ghimire (Dip Kasyap) dipkasyap

View GitHub Profile
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
}
//
// indicator.swift
// mTaxi
//
// Created by Saroj on 4/6/16.
// Copyright © 2016 Saroj. All rights reserved.
//
import UIKit
@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
@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 / 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
//
// 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
//
// 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
Advanced Animations with UIKit
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_hd_advanced_animations_with_uikit.mp4?dl=1
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_advanced_animations_with_uikit.pdf
Advanced Touch Bar
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_hd_advanced_touch_bar.mp4?dl=1
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_advanced_touch_bar.pdf
Advances in TVMLKit
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/202ximbb9e2dq222/202/202_hd_advances_in_tvmlkit.mp4?dl=1
@dipkasyap
dipkasyap / publish2iTunesConnect.sh
Created February 18, 2019 05:50 — forked from BYCHEN/publish2iTunesConnect.sh
Automation build xcode project, ipa, and upload to Apple testFlight
#!/bin/bash -l
#
#
#
# version 0.0.1
#
#
# Configurations Setting
##########################################################################
WORKSPACE="<SET Workspace name>"
@dipkasyap
dipkasyap / 1_playground.swift
Created November 14, 2019 00:36 — forked from morishin/1_playground.swift
Circular UIView with drop shadow (using UIBezierPath)
import UIKit
import PlaygroundSupport
let container = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 200))
container.backgroundColor = .lightGray
let buttonRadius: CGFloat = 50
let buttonSize = CGSize(width: buttonRadius * 2, height: buttonRadius * 2)
let buttonPath = UIBezierPath(arcCenter: CGPoint(x: buttonRadius, y: buttonRadius), radius: buttonRadius, startAngle: 0, endAngle: CGFloat.pi * 2, clockwise: true)