This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) | |
| } |
This file contains hidden or 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 StoryboardIdentifiable { | |
| static var storyboardIdentifier: String { get } | |
| } | |
| extension StoryboardIdentifiable where Self: UIViewController { | |
| static var storyboardIdentifier: String { | |
| return String(describing: self) | |
| } | |
| } |
This file contains hidden or 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
| class Stack { | |
| var lastNode: Node? = nil | |
| class Node { | |
| var data: Int! | |
| var prev: Node? | |
| init(data: Int, prev: Node?) { | |
| self.data = data | |
| self.prev = prev | |
| } |
This file contains hidden or 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 |
OlderNewer