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
| <html> | |
| <head> | |
| <title>Sample</title> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"> | |
| </script> | |
| <script type="text/javascript"> | |
| // 動的な要素にも利用できるようなイベント構文について説明 | |
| // onメソッドを使えば良い | |
| // 調査範囲.on(イベント名, セレクタ, イベントで実行したい処理) | |
| // |
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)startMyJSTest_OBJC_Call_JS | |
| { | |
| JSContext *context = [[JSContext alloc] init]; | |
| // by JS | |
| JSValue *result = [context evaluateScript:@"2+2"]; | |
| NSLog(@"2 + 2 = %d", [result toInt32]); | |
| // JSValue |
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 "MyView.h" | |
| #import <CoreGraphics/CoreGraphics.h> | |
| struct RGBColor | |
| { | |
| float r; | |
| float g; | |
| float b; | |
| float a; | |
| }; |
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
| struct RGBColor | |
| { | |
| float r; | |
| float g; | |
| float b; | |
| float a; | |
| }; | |
| typedef struct RGBColor RGBColor; | |
| void (^drawCircle)(CGContextRef, CGPoint*, RGBColor*, float) = ^(CGContextRef context, CGPoint *point, RGBColor *rgb, float r) |
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)startMyJSTest_JS_CALL_OBJC | |
| { | |
| //ObJC blocks | |
| JSContext *context = [[JSContext alloc] init]; | |
| context[@"myBlock"] = ^(NSString *w) { | |
| return [NSString stringWithFormat:@"==%@===", w]; | |
| }; | |
| //JScode call blocks |
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
| @interface RGB : NSObject <RGBExport> | |
| @end | |
| @implementation RGB | |
| @synthesize r = _r; | |
| @synthesize g = _g; | |
| @synthesize b = _b; | |
| @synthesize a = _a; | |
| + (id)makeRGBWithR:(float)r G:(float)g B:(float)b alpha:(float)a | |
| { | |
| RGB *rgb = [RGB new]; |
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
| SOLID規則のメモ | |
| S Single responsibility 1クラス1債務 | |
| O Open-Closed | |
| L Liskov substitution | |
| I Interface | |
| Single responsibility principle | |
| 例 |
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
| <Grid | |
| x:Name="bgGrid" | |
| Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | |
| DoubleTapped="bgGrid_DoubleTapped"> | |
| <FlyoutBase.AttachedFlyout> | |
| <Flyout x:Name="Flayout1" Placement="Left"> | |
| <Grid Background="Aqua" Width="300" Height="400"> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="Auto"/> | |
| <RowDefinition Height="*"/> |
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
| webView.loadRequest(NSURLRequest(URL: NSURL.URLWithString("http://www.google.com"))) |
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
| func fire() | |
| { | |
| var date = NSDate(); | |
| NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("aaaa"), userInfo: nil, repeats: false); | |
| } | |
| func aaaa() | |
| { | |
| print("hello") |