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
| /** | |
| * @class Ext.ux.form.MultiSelect | |
| * @extends Ext.form.field.Base | |
| * A control that allows selection and form submission of multiple list items. | |
| * | |
| * @history | |
| * 2008-06-19 bpm Original code contributed by Toby Stuart (with contributions from Robert Williams) | |
| * 2008-06-19 bpm Docs and demo code clean up | |
| * | |
| * @constructor |
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 "RecentRequestsViewController.h" | |
| #import "AppDelegate.h" | |
| @interface RecentRequestsViewController () | |
| @end | |
| @implementation RecentRequestsViewController | |
| #pragma mark - |
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
| // NSArray *locations as an array of CLLocation* that you wish to filter | |
| // with a given radius constant. | |
| CLLocationDistance radius = kSomeRadius; | |
| // Target you want to test against to see if it is within the radius bounds. | |
| CLLocation* target = [[CLLocation alloc] initWithLatitude:someLat longitude:someLon]; | |
| NSArray *locationsWithinRadius = [locations objectsAtIndexes: | |
| [locations indexesOfObjectsPassingTest: | |
| ^BOOL(id obj, NSUInteger idx, BOOL *stop) { |
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
| // Uses http://underscorem.org/ | |
| // #import "USArrayWrapper.h" | |
| // Wraps an array in Underscore.m's USArrayWrapper. This is crucial in order to use the | |
| // other methods. The *__unused* tells LLVM to ignore unused variable in XCode 4.3.2. | |
| USArrayWrapper *wrapper __unused = _array(serviceRequests); | |
| _array(serviceRequests).each(^(id obj) { | |
| RequestModel *req = (RequestModel *)obj; | |
| NSLog(@"Object: %@", req | |
| }); |
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
| // UIImage from image URL. | |
| NSURL *url = [NSURL URLWithString:@"http://example.com/image.jpg"]; | |
| NSData *data = [NSData dataWithContentsOfURL:url]; | |
| UIImage *img = [[UIImage alloc] initWithData:data]; |
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
| /* //Below code is causing the slowdown | |
| for (var i = 0; i < records.length; i++) { | |
| var record = new recordTemplate(records[i]); | |
| this.store.add(record); | |
| } | |
| }, | |
| */ | |
| // Better code | |
| var records2 = []; |
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
| // Customize the title text for *all* UINavigationBars | |
| [[UINavigationBar appearance] setTitleTextAttributes: | |
| [NSDictionary dictionaryWithObjectsAndKeys: | |
| [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0], | |
| UITextAttributeTextColor, | |
| [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8], | |
| UITextAttributeTextShadowColor, | |
| [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], | |
| UITextAttributeTextShadowOffset, | |
| [UIFont fontWithName:@"Arial-Bold" size:0.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
| [[UIToolbar appearance] setTintColor:[UIColor colorWithRed:0.157 green:0.169 blue:0.235 alpha:1.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
| // Each UIView object has a tag property which is simply an integer value | |
| // that can be used to identify that view. You could set the tag value of | |
| // each added view to 7 like this. The use the for loop to clean up the | |
| // subview if needed. | |
| UITouch *touch = [touches anyObject]; | |
| CGPoint touchPoint = [touch locationInView:self.view]; | |
| CGRect myImageRect = CGRectMake((touchPoint.x -50), (touchPoint.y -50), 80.0f, 90.0f); | |
| UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect]; |