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 <SpriteKit/SpriteKit.h> | |
typedef NS_ENUM(NSInteger, BallType) | |
{ | |
Blue, | |
Red, | |
Green, | |
Yellow, | |
Purple, | |
Pink, |
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)drawRect:(CGRect)rect | |
{ | |
// Drawing code | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGMutablePathRef path = createRoundeRectForRect(self.bounds, 15.0); | |
CGContextSaveGState(context); | |
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor); |
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
Edge* MakeEdge(NSUInteger i, NSUInteger j); | |
@interface Edge : NSObject <NSCopying> | |
@property (nonatomic, assign, readonly) NSUInteger i; | |
@property (nonatomic, assign, readonly) NSUInteger j; | |
+ (instancetype)edgeWithI:(NSUInteger)i J:(NSUInteger)j; | |
@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
- (void)getRequestData:(NSString *)urlString | |
success:(void(^)(NSArray *jsonList))success | |
failure:(void(^)(NSError *error))failure | |
{ | |
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; | |
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration]; | |
NSURLSessionDataTask *task = [session dataTaskWithURL: | |
[NSURL URLWithString:urlString] |
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
#ifndef __HELLOWORLD_SCENE_H__ | |
#define __HELLOWORLD_SCENE_H__ | |
#include "cocos2d.h" | |
#include "DotSprite.h" | |
class HelloWorld : public cocos2d::Layer | |
{ | |
public: |
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
var keys = Array(buttons.keys) | |
sort(&keys){$0.rawValue < $1.rawValue} |
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
let myView = UIView() | |
myView.setTranslatesAutoresizingMaskIntoConstraints(false) | |
myView.backgroundColor = UIColor.greenColor() | |
self.view.addSubview(myView) | |
self.view.addConstraints([ | |
NSLayoutConstraint(item: myView, | |
attribute: .Width, | |
relatedBy: .Equal, | |
toItem: self.view, |
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
let myView1 = UIView() | |
myView1.backgroundColor = UIColor.greenColor() | |
myView1.setTranslatesAutoresizingMaskIntoConstraints(false) | |
self.view.addSubview(myView1) | |
let myView2 = UIView() | |
myView2.backgroundColor = UIColor.orangeColor() | |
myView2.setTranslatesAutoresizingMaskIntoConstraints(false) | |
myView1.addSubview(myView2) | |