Created
December 11, 2015 19:09
-
-
Save nevyn/86c7f4710bf1ad48918b to your computer and use it in GitHub Desktop.
Use loops instead of copy pasting
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
for(NSString *when in @[@"will", @"did"]) { | |
[_output writeRowWithValues:@[ // COLUMNS: | |
[NSString stringWithFormat:@"%.4f", [_output currentSessionTime]], // Time | |
type, // {interface|device} | |
when, // {will|did} | |
[NSString stringWithFormat:@"%d", newDegrees], // newOrientationInDegreesWhere0IsPortrait | |
[NSString stringWithFormat:@"%.2f", duration], // transitionDurationForInterfaceRotation | |
]]; | |
} |
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
NSString *when = @"will"; | |
GFLog(GFDebug, @"%@ orientation %@ become %d°", type, when, newDegrees); | |
[_output writeRowWithValues:@[ // COLUMNS: | |
[NSString stringWithFormat:@"%.4f", [_output currentSessionTime]], // Time | |
type, // {interface|device} | |
when, // {will|did} | |
[NSString stringWithFormat:@"%d", newDegrees], // newOrientationInDegreesWhere0IsPortrait | |
[NSString stringWithFormat:@"%.2f", duration], // transitionDurationForInterfaceRotation | |
]]; | |
when = @"did"; | |
[_output writeRowWithValues:@[ // COLUMNS: | |
[NSString stringWithFormat:@"%.4f", [_output currentSessionTime]], // Time | |
type, // {interface|device} | |
when, // {will|did} | |
[NSString stringWithFormat:@"%d", newDegrees], // newOrientationInDegreesWhere0IsPortrait | |
[NSString stringWithFormat:@"%.2f", duration], // transitionDurationForInterfaceRotation | |
]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment