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 SwiftUI | |
| struct ContentView : View { | |
| let sample = Story.sample | |
| var body: some View { | |
| ScrollView { | |
| HStack(spacing: 16) { | |
| Spacer() | |
| ForEach(sample) { story in | |
| VStack { |
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
| __weak typeof(self) weakSelf = self; | |
| AFJSONRequestOperation *operation = | |
| [AFJSONRequestOperation JSONRequestOperationWithRequest:request | |
| success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
| NSDictionary *jsonDict = (NSDictionary *) JSON; | |
| // this is the array that stores the JSON response | |
| NSArray *csvFiles = [jsonDict objectForKey:@"csv_files"]; | |
| [weakSelf doSomethingWithTheArray:csvFiles]; | |
| } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { |
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
| [CATransaction begin]; | |
| [CATransaction setValue:(id)kCFBooleanTrue | |
| forKey:kCATransactionDisableActions]; | |
| // do stuff | |
| [CATransaction commit]; |
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
| [CATransaction begin]; | |
| [CATransaction setValue:(id)kCFBooleanTrue | |
| forKey:kCATransactionDisableActions]; | |
| [aLayer removeFromSuperlayer]; | |
| [CATransaction commit]; |
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 *)reuseIdentifier { | |
| static NSString *reuseIdentifier; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| reuseIdentifier = [NSStringFromClass(self) retain]; | |
| }); | |
| return reuseIdentifier; | |
| } |
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
| 2011-05-11 03:25:07.462 GlobalSingletonSupportTest[63618:1803] irSharedInstance instance NSObject 15f980, 181511 ns | |
| 2011-05-11 03:25:07.465 GlobalSingletonSupportTest[63618:5303] irSharedInstance instance NSObject 15f980, 614 ns | |
| 2011-05-11 03:25:07.465 GlobalSingletonSupportTest[63618:5403] irSharedInstance instance NSObject 15f980, 584 ns | |
| 2011-05-11 03:25:07.464 GlobalSingletonSupportTest[63618:a0f] irSharedInstance instance NSObject 15f980, 1546 ns | |
| 2011-05-11 03:25:07.466 GlobalSingletonSupportTest[63618:a0f] irSharedInstance instance NSObject 15f980, 1545 ns |
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
| #!/bin/sh | |
| if [ -d "$BUILT_PRODUCTS_DIR/${PRODUCT_NAME}.app/foo.bundle" ]; then | |
| rm -rf "$BUILT_PRODUCTS_DIR/${PRODUCT_NAME}.app/foo.bundle" | |
| fi | |
| if [ -d "$BUILT_PRODUCTS_DIR/foo.bundle" ]; then | |
| cp -r "$BUILT_PRODUCTS_DIR/foo.bundle" "$BUILT_PRODUCTS_DIR/${PRODUCT_NAME}.app/" | |
| fi |
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
| CGFloat CGContextShadowOrientationYMultiplier() { | |
| static CGFloat sharedMultiplier__ = 0.0; | |
| if (sharedMultiplier__ == 0.0) { | |
| NSString *version = [UIDevice currentDevice].systemVersion; | |
| sharedMultiplier__ = ([version compare:@"3.2"] == NSOrderedAscending) ? 1.0f : -1.0f; | |
| } | |
| return sharedMultiplier__; | |
| } |
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 <Foundation/Foundation.h> | |
| int main() { | |
| CGFloat version = [@"4.2.1" floatValue]; | |
| NSLog(@"version: %f", version); | |
| } | |
| O2Machina:~ karl$ gcc main.m -o test -framework Foundation | |
| O2Machina:~ karl$ ./test |
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
| $lipo libTapjoyConnectDeviceConnect.a libTapjoyConnectSimulatorConnect.a -create -output libTapjoyConnect.a |
NewerOlder