Skip to content

Instantly share code, notes, and snippets.

(function($) {
$.fn.countdown = function(options, callback) {
//custom 'this' selector
thisEl = $(this);
//array of custom settings
var settings = {
'date': null,
'format': null
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch
self.window.backgroundColor = [UIColor whiteColor];
MainViewController *viewController = [[MainViewController alloc] init];
self.window.rootViewController = viewController;
#import "AppDelegate.h"
#import "MainViewController.h"
extension UIColor {
simpleColor(red: Int, green: Int, blue: Int) {
let newRed = CGFloat(red)/255
let newGreen = CGFloat(green)/255
let newBlue = CGFloat(blue)/255
self.init(red: newRed, green: newGreen, blue: newBlue, alpha: 1.0)
}
}
let APIPaidStatus = paystubData.status
if APIPaidStatus == "paid" {
cell.paidStatusLabel.text = "PAID"
} else if APIPaidStatus == "scheduled" {
cell.paidStatusLabel.text = "SCHEDULED"
} else {
cell.paidStatusLabel.text = ""
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let paystubData = sortedPaystubsArray[indexPath.section][indexPath.row]
let payoutDetailViewController = PayoutDetailViewController()
payoutDetailViewController.paystubDetailArray = paystubData
self.navigationController?.presentViewController(payoutDetailViewController, animated: false, completion: nil)
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! ImageCell
for imageURL in self.imageURLs {
let URL = NSURL(string: imageURL as! String)!
cell.imageView.af_setImageWithURL(URL)
}
activityIndicator.stopAnimating()
return cell
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Initialize the window
window = UIWindow.init(frame: UIScreen.mainScreen().bounds)
// Set Background Color of window
window?.backgroundColor = UIColor.whiteColor()
// Allocate memory for an instance of the 'MainViewController' class
let mainViewController = MainViewController()
import UIKit
class MainViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
lazy var textField: UITextField! = {
let view = UITextField()
view.translatesAutoresizingMaskIntoConstraints = false
view.borderStyle = .RoundedRect
return view
}()