Skip to content

Instantly share code, notes, and snippets.

View HeidiHansen's full-sized avatar
🚲

JungleDev HeidiHansen

🚲
View GitHub Profile
@agiletalk
agiletalk / TwoTables.m
Created April 21, 2011 05:24
Two UITableView in One UIViewController
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSInteger rows;
@lxbarth
lxbarth / index.html
Created December 19, 2012 23:19
Demo with open weather maps data, MapBox Satellite and OpenStreetMap based MapBox Streets http://openweathermap.org/maps
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
@floriankugler
floriankugler / gist:6870499
Last active September 29, 2023 15:56
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
@HeidiHansen
HeidiHansen / 03. THCameraButton drawRect
Last active August 29, 2015 14:06
THCameraButton.m drawRect method. Custom drawn camera button, iOS 7 default camera button look-alike.
#define DegreesToRadians(x) ((x) * M_PI / 180.0)
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGMutablePathRef path = CGPathCreateMutable();
CGFloat buttonRadius = rect.size.width/2;
CGFloat buttonRing = buttonRadius - (buttonRadius/5.5);
@HeidiHansen
HeidiHansen / 01. THFilterViewController.h
Last active August 29, 2015 14:06
Image FilterViewController.h
#import <UIKit/UIKit.h>
#import "FISFilterObject.h"
#import "THConversationShareViewController.h"
@interface FISViewController : UIViewController<UIPickerViewDelegate, UIPickerViewDataSource, ConversationShareViewControllerDelegate>
@property (strong, nonatomic) UIImage *imageToProcess;
@property(strong, nonatomic) UIImage *savedImage;
@property (strong, nonatomic) IBOutlet UIImageView *theImageView;
@property (strong, nonatomic) IBOutlet UIPickerView *filterNamesPicker;
@HeidiHansen
HeidiHansen / 02. TH FilterViewController.m
Last active August 29, 2015 14:06
Image Filter View Controller
#import "FISViewController.h"
@interface FISViewController ()
@property(strong, nonatomic) CIContext *context;
@property(strong, nonatomic) CIFilter *filter;
@property(strong, nonatomic) CIImage *beginImage;
@property(strong, nonatomic) NSMutableArray *arrayOfFilters;
@property(strong, nonatomic) NSString *filtersName;
@end
@HeidiHansen
HeidiHansen / 04. THEditImageViewController.m
Last active August 29, 2015 14:06
04. THEditImageViewController.m
#import "THEditImageViewController.h"
#import "THCameraViewController.h"
#import "THEditImageViewController+Autolayout.h"
typedef void(^ButtonReplacementBlock)(void);
@interface THEditImageViewController () <UINavigationControllerDelegate, THCameraDelegateProtocol, UIScrollViewDelegate>
@property (nonatomic, assign) CGFloat zoomScale;
@property (nonatomic, assign) CGFloat maximumZoomScale;
@HeidiHansen
HeidiHansen / 05. THEditImageViewController.h
Created September 12, 2014 21:56
05. THEditImageViewController.h
#import <UIKit/UIKit.h>
#import "THCameraViewController.h"
#import "THConversationShareViewController.h"
@interface THEditImageViewController : UIViewController <ConversationShareViewControllerDelegate>
#pragma mark - Object Properties
@property (strong, nonatomic) id <ConversationShareViewControllerDelegate> delegate;
@matt-curtis
matt-curtis / gist:c0fa7aa820d6257e7b2a
Last active August 21, 2019 13:49
UINavigationBar Multiline Title
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if(!self.navigationItem.titleView){
self.navigationItem.titleView = ({
UILabel *titleView = [UILabel new];
titleView.numberOfLines = 0;
titleView.textAlignment = NSTextAlignmentCenter;
titleView.attributedText = [[NSAttributedString alloc] initWithString:@"2\nLINES" attributes:
self.navigationController.navigationBar.titleTextAttributes