This file contains hidden or 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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"EGOTitledTableViewCell"; | |
EGOTitledTableViewCell *cell = (EGOTitledTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[EGOTitledTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
// Set up the cell... | |
if(indexPath.row == 0) { |
This file contains hidden or 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
// Load an Image: | |
UIImage* image = [UIImage imageWithData:[[EGOCache currentCache] dataForKey:@"imageCacheKey"]]; | |
// Store an Image: | |
[[EGOCache currentCache] setData:UIImagePNGRepresentation(image) forKey:@"imageCacheKey" withTimeoutInterval:604800]; |
This file contains hidden or 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
float scaleBy = 0.80; | |
id<MKAnnotation> annotation; // Define to yours | |
self.mapView = [[[MKMapView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 64 / scaleBy, 64 / scaleBy)] autorelease]; | |
[self.mapView addAnnotation:job]; | |
CLLocationCoordinate2D coordinate = annotation.coordinate; | |
coordinate.longitude -= 0.0006; |
This file contains hidden or 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
@implementation ExampleCell | |
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
imageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]]; | |
imageView.frame = CGRectMake(4.0f, 4.0f, 36.0f, 36.0f); | |
[self.contentView addSubview:imageView]; | |
} | |
return self; |
This file contains hidden or 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
protected void onDraw(Canvas canvas) { | |
Bitmap bitmap; // set to your bitmap | |
canvas.drawBitmap(bitmap, null, new Rect(0, 0, 50, 50), null); | |
} |
This file contains hidden or 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
protected void onDraw(Canvas canvas) { | |
Bitmap bitmap; // set to your bitmap | |
Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); // Fix for HA | |
canvas.drawBitmap(bitmap, src, new Rect(0, 0, 50, 50), null); | |
} |
This file contains hidden or 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
#import <objc/runtime.h> | |
#import <objc/message.h> | |
SEL SHNSwapSelectorWithBlock(Class class, SEL selector, BOOL isClassMethod, id block) { | |
Method method1 = isClassMethod ? class_getClassMethod(class, selector) : class_getInstanceMethod(class, selector); | |
// Generate new selector to inject | |
SEL newSelector = NSSelectorFromString([@"_swappedBlock_" stringByAppendingString:NSStringFromSelector(selector)]); | |
// Inject the block as method in the class |
This file contains hidden or 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
// | |
// SHNFakeStatusBar | |
// Created by Shaun Harison on 12/3/13. | |
// | |
#import <objc/runtime.h> | |
#define CARRIER_STRING @"Apple" | |
#define TIME_STRING @"Timestamp" |
This file contains hidden or 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
extension CGRect: DebugPrintable { | |
var debugDescription: String { | |
return NSStringFromCGRect(self) | |
} | |
} | |
extension CGSize: DebugPrintable { | |
var debugDescription: String { | |
return NSStringFromCGSize(self) | |
} |
This file contains hidden or 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
fileprivate class NetworkingDelegate: NSObject, URLSessionDelegate { | |
fileprivate func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { | |
completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) | |
} | |
} | |
private let proxySessionDelegate = NetworkingDelegate() |