Skip to content

Instantly share code, notes, and snippets.

//DOMainViewController.m
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"1.png"]]];
//DOContactsTableViewController.h
UIImageView *backgroundView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 44)];
UIImage *backgroundImage = [[UIImage imageNamed:@"newsfeed_background.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)];
[backgroundView setImage:backgroundImage];
backgroundView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
[cell.contentView insertSubview:backgroundView belowSubview:cell.textLabel];
@davidolesch
davidolesch / gist:9309862
Last active November 16, 2015 17:19
Lesson 2 presented March 4th 2014
//action connected to Random Location button
- (IBAction)touchedRandomLocation:(id)sender {
//create a list of cities
NSArray *cities = @[@"New York, NY",@"Los Angeles, CA",@"Chicago, IL",@"Philadelphia, PA",@"Phoenix, AZ",@"San Diego, CA",@"San Jose, CA",@"Jacksonville, FL",@"Indianapolis, IN",@"San Francisco, CA"];
//choose a random integer less than the count of cities
int randomIndex = arc4random_uniform((int)[cities count]);
//choose the city from the cities list at the random integer index
NSString *city = [cities objectAtIndex:randomIndex];
@davidolesch
davidolesch / gist:9309876
Last active August 29, 2015 13:56
Lesson 3 presented March 4th 2014
//DORouteMapViewController interface
@property (strong, nonatomic) MKPlacemark *origin;
@property (strong, nonatomic) MKPlacemark *destination;
//this method is called while transitioning from the search view to the map view
-(void)mapFromLocation:(NSString *)fromLocation toLocation:(NSString *)toLocation
{
//geocode the from location and handle the returned placemark
[[[CLGeocoder alloc] init] geocodeAddressString:fromLocation completionHandler:^(NSArray *placemarks, NSError *error) {
//grab the first placemark and set it as the origin placemark
@davidolesch
davidolesch / gist:9309897
Created March 2, 2014 17:15
Lesson 4 presented March 4th 2014
- (void)getAndDisplayTravelTime
{
//create request
MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init];
[request setSource:[[MKMapItem alloc] initWithPlacemark:self.origin]];
[request setDestination:[[MKMapItem alloc] initWithPlacemark:self.destination]];
[request setTransportType:MKDirectionsTransportTypeAutomobile];
//send request
[[[MKDirections alloc] initWithRequest:request] calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse *response, NSError *error) {
//
// DOViewController.m
// LoginForm
//
// Created by David Olesch on 4/1/14.
// Copyright (c) 2014 David Olesch. All rights reserved.
//
#import "DOViewController.h"
// This file is part of the jQuery formatCurrency Plugin.
//
// The jQuery formatCurrency Plugin is free software: you can redistribute it
// and/or modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// The jQuery formatCurrency Plugin is distributed in the hope that it will
// be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
@davidolesch
davidolesch / Best-iOS-engineering-and-indie-business-blogs
Last active August 29, 2015 14:12
High quality iOS engineering and indie business blogs that continuously release new good content.
News Sources
============
(https://twitter.com/DavidOlesch/following)[https://twitter.com/DavidOlesch/following]
http://hn.algolia.com/legacy#!/story/sort_by_date/prefix/0/ios
http://www.watchkitresources.com/
Technical Blogs
===============
http://subjc.com/
http://petersteinberger.com/blog/archives/
<a href="alertsenseapp://alertsense.com/login?UserName=david.rabbit">alertsenseapp://alertsense.com/login?UserName=david.rabbit</a>
@davidolesch
davidolesch / AlertID.html
Last active January 29, 2016 17:21
AlertID
<a href="alertsenseapp://alertsense.com/Alerts/116810">alertsenseapp://alertsense.com/Alerts/116810</a>
<a href="alertsenseapp://alertsense.com/Polling/119571">alertsenseapp://alertsense.com/Polling/119571</a>