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 *)importsForClass:(Class)aClass { | |
NSMutableDictionary *importsDict = [NSMutableDictionary dictionary]; | |
for (NSString *identifier in [identifiers objectForKey:aClass]) { | |
[importsDict addEntriesFromDictionary:[imports objectForKey:identifier]]; | |
} | |
[importsDict addEntriesFromDictionary:[imports objectForKey:aClass]]; | |
return [importsDict allValues]; | |
} |
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
- If something has an underscore it is classed as private and ignored | |
- If a typedef appears multiple times (eg in an #if statement) the first documented one is used | |
- Enums that have both a type def and a name (@enum name) will have the title "type - doc name" | |
- Any functions or macros found will be placed in a separate functions page | |
- Constants groups and typedefs in separate files can be related to a class with (@class name). They can have multiple @class statements | |
- Any constants groups or typedefs found in files that don't contain classes and aren't that related to classes are put in separate constants and data types pages | |
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
#!/usr/bin/env ruby | |
#This script currently only works if you have your derived data in the default location | |
#First look for a project path as our workspace | |
xcodeWorkspacePath = ENV['XcodeProjectPath'] | |
if xcodeWorkspacePath | |
workspaceName = /([\w\s]+).xcodeproj/.match(xcodeWorkspacePath)[1] | |
#If we don't have a project we have a workspace, check for that and exit with code 1 if that doesn't exist | |
else |
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)method1:(id)somethingElse { | |
NSString *identifier = [NSString stringWithFormat:@"%@.%@", [SomeClass someMethod], somethingElse]; | |
MyObject *obj = [[MyObject alloc] initWithIdentifier:identifier]; | |
… | |
} | |
- (void)method2:(id)somethingElse { | |
NSString *identifier = [NSString stringWithFormat:@"%@.%@", [SomeOtherClass someOtherMethod], somethingElse]; | |
MyObject *obj = [[MyObject alloc] initWithIdentifier:identifier]; |
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)performLayout | |
{ | |
[super performLayout]; | |
myScrubView.frame = self.bounds; | |
BOOL reload = NO; | |
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; | |
if (orientation == UIInterfaceOrientationPortrait) | |
{ |
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)sendDetails { | |
if ([self _shouldShowPrompt]) { | |
[permissionPromptController showWindow:self]; | |
} else { | |
[submitter submitDetails]; | |
} | |
} | |
- (BOOL)_shouldShowPrompt { |
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)submitDetails { | |
//If the user said not to send, don't | |
if (![[NSUserDefaults standardUserDefaults] boolForKey:TWSSendSystemProfile]) | |
return; | |
//Generate our last sent check and see if it is different to the stored one | |
NSString *lastSent = [[NSDate date] descriptionWithCalendarFormat:@"%Y%m" timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0] locale:nil]; | |
if ([lastSent isEqualToString:[[NSUserDefaults standardUserDefaults] objectForKey:TWSLastSent]]) | |
return; | |
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
def fac(n, limit) | |
if n == 1 | |
return 1 | |
end | |
if n == limit | |
return limit | |
end | |
return n * fac(n - 1, limit) | |
end |
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
Basically I can turn this: | |
[[[[loginResult | |
where:^(id x) { | |
return [x hasError]; | |
}] | |
select:^(id x) { | |
return [x error]; | |
}] | |
injectObjectWeakly: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
//Pass in arrays of views and access with number keys or add attributes for all | |
NSArray *views = @[ topView, middleView, lastView ]; | |
[containerView setSubviews:views]; | |
[containerView m3_addConstraints:@[ | |
@"$1.top = 0", | |
@"$2.top = $1.bottom", | |
@"$3.top = $2.bottom", | |
@"$3.bottom = 0", | |
@"$all.(left, right) = (0, 10)", //Assign multiple attributes in one statement | |
@"$all.height >= 30" |
OlderNewer