This file contains 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
#define DEPRECATED(since, replaced) __attribute__((deprecated("since '" #since "' use '" #replaced "'"))) |
This file contains 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
#define DO_PRAGMA(x) _Pragma (#x) | |
#define MESSAGE(x) DO_PRAGMA(message (x)) | |
@interface TBFoo : NSObject | |
@end | |
@implementation TBFoo | |
-(void)bar MESSAGE("Hello World!"){} |
This file contains 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 org.junit.Test; | |
import org.junit.Assert; | |
import java.util.function.Consumer; | |
public class ApplicationScopeTest | |
{ | |
@Test(expected=RuntimeException.class) | |
public void testApplicationScope() throws Exception | |
{ | |
ApplicationScope applicationScope = new ApplicationScope(); |
This file contains 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 java.util.function.Consumer; | |
import java.util.function.Supplier; | |
public class ApplicationScope | |
{ | |
private volatile String value; | |
private final Supplier<String> supplier; |
This file contains 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
public class Main | |
{ | |
static class Number | |
{ | |
final int value; | |
public Number(int value) { | |
this.value = value; | |
} | |
} |
This file contains 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
-(IBAction)tap:(id)sender | |
{ | |
UIBarButtonItem *refresh = self.navigationItem.rightBarButtonItem; | |
CALayer *layer = ((UIButton*)refresh.customView).imageView.layer; | |
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; | |
rotate.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; | |
rotate.fromValue = @(0); | |
rotate.toValue = @(2 * M_PI); |
This file contains 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 QNDUnit | |
- (id)initWithCalculator:(QNDCalculator*) calculator | |
{ | |
self = [super init]; | |
if (self) { | |
_calculator = calculator; | |
} | |
This file contains 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(int argc, char *argv[]) | |
{ | |
NSArray *array = @[ @"a", @"b", @"c" ]; | |
for (NSUInteger i = 0; i < array.count; i++) | |
{ | |
NSLog(@"%@", array[i]); | |
} |
This file contains 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 FooViewController: UIViewController | |
{ | |
} | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
let fooViewController = FooViewController() | |
let view = self.window!.snapshotViewAfterScreenUpdates(false) | |
let viewController = UIViewController() |
This file contains 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 ViewController : UIViewController | |
{ | |
var foo = "foo" | |
func hello() | |
{ | |
let closure = { [foo = self.foo] in | |
print("Hello \(foo)!") | |
} | |
} |