Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jaisonv's full-sized avatar

Jaison Vieira jaisonv

View GitHub Profile
@jaisonv
jaisonv / TableViewController.swift
Last active August 29, 2015 14:24
Pull to refresh
// first enable "Refreshing" on controller via storyboard
override func viewDidLoad() {
super.viewDidLoad()
// the value for "action" must mach the function's name
refreshControl?.addTarget(self, action: "reloadStuff", forControlEvents: UIControlEvents.ValueChanged)
}
func reloadStuff() {
@jaisonv
jaisonv / TableViewController.swift
Last active August 29, 2015 14:23
Resize cell height based on content
tableView.estimatedRowHeight = 100 // estimated value for cell height
tableView.rowHeight = UITableViewAutomaticDimension
@jaisonv
jaisonv / ViewController.m
Last active August 29, 2015 14:21
Rounded ImageView
myImageView.layer.cornerRadius = 10.0f;
@jaisonv
jaisonv / ViewController.m
Last active August 29, 2015 14:21
Beautiful border to ImageView
myImageView.layer.borderWidth = 3.0f;
myImageView.layer.borderColor = [UIColor whiteColor].CGColor;
@jaisonv
jaisonv / ViewController.m
Last active August 29, 2015 14:21
Circular ImageView
myImageView.layer.cornerRadius = myImageView.frame.size.width / 2;
myImageView.clipsToBounds = YES;
@jaisonv
jaisonv / test_helper.rb
Created May 15, 2015 06:04
MiniTest reporters - Rails tests show red and green
require "minitest/reporters"
Minitest::Reporters.use!