Skip to content

Instantly share code, notes, and snippets.

View vikdenic's full-sized avatar

vik vikdenic

  • Chicago, IL
View GitHub Profile
@property NSMutableArray *self.shoeImagesArray;
// ^somewhere within your interface
-(void)retreiveImagesFromParse
{
self.shoeImagesArray = [NSMutableArray new];
PFQuery *query = [PFQuery queryWithClassName:@“Shoe”];
@vikdenic
vikdenic / gist:b0acbe9bd44cce56a170
Last active August 29, 2015 14:05
retrieving image files from parse, converting them to images, and adding them in an array
@property NSMutableArray *self.shoeImagesArray;
// ^somewhere within your interface
-(void)retrieveImagesFromParse
{
self.shoeImagesArray = [NSMutableArray new];
PFQuery *query = [PFQuery queryWithClassName:@“Shoe”];
extension String
{
///:returns: The floating-point value of the string as a double.
func toDouble() -> Double
{
let convertedString = self as NSString
return convertedString.doubleValue
}
///:returns: The NSInteger value of the string.
@vikdenic
vikdenic / gist:067cba8d015d9409ca9b
Created September 23, 2014 14:34
MMExtensions for Tip Calculator
extension String
{
///:returns: The floating-point value of the string as a double.
func toDouble() -> Double
{
let convertedString = self as NSString
return convertedString.doubleValue
}
///:returns: The NSInteger value of the string.
//Resign keyboard when user taps away from textfield
override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!)
{
view.endEditing(true)
}
//MARK: TextField Delegate Methods
func textFieldShouldReturn(textField: UITextField) -> Bool
{
textField.resignFirstResponder()
return true
}
@vikdenic
vikdenic / gist:06409309b275d7bc950b
Created October 6, 2014 13:52
Animate UILabel's alpha
//Animate the tipLabel's alpha changing from 0 to 1 over the period of 1.2 seconds
tipLabel.alpha = 0
UIView.animateWithDuration(1.2, animations: { () -> Void in
self.tipLabel.alpha = 1
})
@vikdenic
vikdenic / gist:504cc443c004756bd1b0
Created October 6, 2014 15:54
Resign keyboard on tap-away
override func touchesBegan(touches: NSSet, withEvent event: UIEvent)
{
view.endEditing(true)
}
@vikdenic
vikdenic / gist:d976a9ecdd300807e325
Created October 17, 2014 17:42
Custom Pizzeria.h
//
// Pizzeria.h
// ZaHunter
//
// Created by Christopher on 10/15/14.
// Copyright (c) 2014 Big Nerd Ranch. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@vikdenic
vikdenic / gist:88672b7f45fd23220e38
Created October 17, 2014 17:43
Custom Pizzeria.m
//
// Pizzeria.m
// ZaHunter
//
// Created by Christopher on 10/15/14.
// Copyright (c) 2014 Big Nerd Ranch. All rights reserved.
//
#import "Pizzeria.h"