Skip to content

Instantly share code, notes, and snippets.

View prasannag's full-sized avatar

Prasanna Gopalakrishnan prasannag

View GitHub Profile
@prasannag
prasannag / KeyboardTableView.swift
Last active October 15, 2019 09:30
UITableView that allows navigation with hardware keyboard. Supports multiple sections.
// Prasanna Gopalakrishnan
// Based on https://gist.github.com/douglashill/50728432881ef37e8b49f2a5917f462d that supports a single section
import UIKit
/// A table view that allows navigation and selection using a hardware keyboard.
/// Supports multiple sections.
class KeyboardTableView: UITableView {
override var canBecomeFirstResponder: Bool {
@prasannag
prasannag / gist:9d8839eedb93e73dfd14
Created May 13, 2015 07:27
AppDelegate for tests in Swift
import Foundation
@UIApplicationMain
class DispatchDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?, appDelegate: AppDelegate!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
var result = true
if isTesting() {
window = UIWindow(frame: UIScreen.mainScreen().bounds)