- WWDC 2012 Session 405 — Modern Objective-C
- WWDC 2012 Session 413 — Migration to Modern Objective-C
- WWDC 2013 Session 228 — Hidden Gems in Cocoa and Cocoa Touch
- WWDC 2014 Session 402 — Introduction to Swift
- WWDC 2014 Session 403 — Intermediate Swift
- WWDC 2014 Session 404 — Advanced Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LHDFingerpaintView.m | |
// Drawing | |
// | |
// Created by Steven Masuch on 2014-07-31. | |
// Copyright (c) 2014 Lighthouse Labs. All rights reserved. | |
// | |
#import "LHDFingerpaintView.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Week 3 Interview Questions | |
#### Goals | |
- Understand Storyboards | |
- Understanding basic application architecture | |
- Familiarity with most common Cocoa/Foundation classes & patterns (delegation, target-action) | |
##### Question 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delegation should be preferred method. For more information, see http://www.objc.io/issue-7/communication-patterns.html | |
The custom collection view cell subclass header should look similar to the following code snippet. A couple of things to look for: | |
It is important that the delegate callbacks include the cell (sender in the following snippet) as one of the parameters. We will need to know which cell invokes the delegate callback in order to find the index path for the cell, which we will then use to retrieve the Photo object to pass to the method to either share or report the photo. | |
The custom collection view cell subclass should never have or keep a reference to the photo object. Doing so would break MVC pattern where the view should never talk to the model directly. | |
@import UIKit; | |
@protocol PanoramaPhotoCollectionViewCellDelegate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
range binaryRangedSearch(int array[], int searchValue, int minimumSearchBounds,int maximumSearchBounds) | |
{ | |
// We would perform the search much like above | |
// where we go to find the value. But once we've found it, | |
// we need to find out where it occurs first and where it occurs last. | |
if (minimumSearchBounds > maximumSearchBounds) { | |
range notFound = {-1, 0}; | |
return notFound; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to create your own completion blocks | |
+ (void)responseFrom4sq:(CLLocation*)currentLocation limit:(NSString*)limit block:(void (^)(NSArray *locationDictionary, NSError *error))completionBlock{ | |
NSString *apiString4aq= @"https://api.foursquare.com/v2/venues/search?ll="; | |
NSString *clientID = @"&client_id=x&client_secret=y"; | |
NSString *version = @"&v=20121219"; | |
NSMutableURLRequest *foursqRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%1.6f,%1.6f%@%@&limit=%@",apiString4aq,currentLocation.coordinate.latitude,currentLocation.coordinate.longitude,clientID,version,limit]]]; | |
dispatch_queue_t foursqQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func tableView(tableView: UITableView, targetIndexPathForMoveFromRowAtIndexPath sourceIndexPath: NSIndexPath, toProposedIndexPath proposedDestinationIndexPath: NSIndexPath) -> NSIndexPath { | |
if sourceIndexPath.section != proposedDestinationIndexPath.section { | |
var row = 0 | |
if sourceIndexPath.section < proposedDestinationIndexPath.section { | |
row = tableView.numberOfRowsInSection(sourceIndexPath.section) - 1 | |
} | |
return NSIndexPath(forItem: row, inSection: sourceIndexPath.section) | |
} | |
return proposedDestinationIndexPath; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update -y | |
apt-get upgrade -y | |
apt-get install git -y | |
curl -fsSL https://get.docker.com/ | sh | |
apt-get install python-pip -y | |
pip install docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTTP - redirect all requests to HTTPS | |
server { | |
listen 80; | |
listen [::]:80 default_server ipv6only=on; | |
return 301 https://$host$request_uri; | |
} | |
# HTTPS - proxy requests to /parse-server/ | |
# through to Parse Server | |
server { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a function that pluralizes words. | |
• By default, it just adds "s" to the end. | |
• But there are some exceptions ("goose" -> "geese") | |
• Create a dictionary of exceptions, so I can look up "hoof" and get back "hooves". | |
• The function should first check the dictionary, to see if it has an exception, then fall back to appending "s" |
OlderNewer