Skip to content

Instantly share code, notes, and snippets.

View hudinwal's full-sized avatar

Dinesh Kumar hudinwal

  • Infoedge India Pvt. Ltd.
  • Noida
View GitHub Profile
@hudinwal
hudinwal / CrashTrackerController.swift
Created July 25, 2017 06:58
Custom Logs and keys
import UIKit
import Crashlytics
class CrashTrackerController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
CLSLogv("CONTROLLER_DID_LOAD - %@",getVaList([self.className]))
}
class Diver: Swimmable {
func swim() {
print("Diver is swiming")
}
}
class Whale: Swimmable {
func swim() {
print("Whale is Swiming")
}
class Diver: Swimmable {
func swim() {
print(“I am swimming ~~~ -0- ~~~”)
}
}
class Diver: Swimmable {
}
protocol Swimmable{
func swim()
}
import UIKit
/*
Extension with queryItems to Dictionary and Dictionary to queryItems
*/
extension URLComponents {
/*
Get the dictionary from queryItems
*/
//: Playground - noun: a place where people can play
/*
Snippet to test whether parsing JSON false or 0's and 1's (for booleans) is time effective.
With 2000 items Booleans took 0.01858549600001425
and 0's 1's took 0.07641855199472047
*/
import UIKit
class Shape {
var name: String
var sides : Int
init(sides:Int, named: String) {
self.sides = sides
self.name = named
printShapeDescription()
}
func printShapeDescription() {
print("Shape Name :\(self.name)")
//
// ViewController.swift
// PullDownSample
//
// Created by Dinesh Kumar on 15/08/16.
// Copyright © 2016 Organization. All rights reserved.
//
import UIKit