This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate+CoreData.h | |
// Protactinium | |
// | |
// Created by Devarshi on 10/8/14. | |
// Copyright (c) 2014 Devarshi Kulshreshtha. All rights reserved. | |
// | |
#import "AppDelegate.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PasteboardWatcher.swift | |
// PasteboardWatcher | |
// | |
// Created by Devarshi Kulshreshtha on 6/19/15.PasteboardWatcher | |
// Copyright © 2015 Devarshi Kulshreshtha. All rights reserved. | |
// | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSArrayController { | |
/// Method which can be binded in storyboard to remove all objects from array controller | |
@IBAction func removeAllObjects(sender: AnyObject) { | |
let range = NSMakeRange(0, self.arrangedObjects.count) | |
self.removeObjectsAtArrangedObjectIndexes(NSIndexSet(indexesInRange: range)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pod::Spec.new do |s| | |
# 1 | |
s.platform = :ios | |
s.ios.deployment_target = '8.0' | |
s.name = "RWPickFlavor" | |
s.summary = "RWPickFlavor lets a user select an ice cream flavor." | |
s.requires_arc = true | |
# 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// OnBoardingViewController.swift | |
// | |
// Created by Devarshi Kulshreshtha on 10/26/16. | |
// Copyright © 2016 Devarshi. All rights reserved. | |
// | |
import UIKit | |
class OnBoardingViewController: PaginationViewBaseController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Pop { | |
func moveBackToParentViewController(currentViewController: UIViewController) | |
} | |
extension Pop { | |
func moveBackToParentViewController(currentViewController: UIViewController) { | |
let transition = CATransition() | |
transition.duration = 0.5 | |
transition.type = kCATransitionMoveIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BorderedView.swift | |
// | |
// Created by Devarshi Kulshreshtha on 17/12/16. | |
// Copyright © 2016 Devarshi. All rights reserved. | |
// | |
import UIKit | |
@IBDesignable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import XCTest | |
import CoreData | |
@testable import MainModule | |
extension XCTestCase { | |
func setUpInMemoryManagedObjectContext() -> NSManagedObjectContext { | |
let managedObjectModel = NSManagedObjectModel.mergedModel(from: [Bundle.main])! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Performs binary search using Recursion | |
func binarySearch<T:Comparable>(on array: [T], for targetValue: T, from minIndex: Int, to maxIndex: Int) -> Int? { | |
// assigning to var so that values can be updated | |
var min = minIndex | |
var max = maxIndex | |
// Obtaining the pivot element | |
let guessIndex = Int((max + min) / 2) | |
// Value comparisons | |
if array[guessIndex] == targetValue { | |
// Value found :) Return the index! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Reusable: class { | |
static var reuseIdentifier: String { get } | |
} | |
extension Reusable { | |
static var reuseIdentifier: String { | |
// I like to use the class's name as an identifier | |
// so this makes a decent default value. | |
return String(describing: self) | |
} |
OlderNewer