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
// 丸描画 | |
let roundRect = UIBezierPath(roundedRect: CGRectMake(1, 1, 28, 28), cornerRadius: 10) | |
UIColor.blueColor().setStroke() | |
roundRect.lineWidth = 2 | |
roundRect.stroke() | |
// フォント属性 | |
let fontAttr = [NSFontAttributeName: UIFont.systemFontOfSize(10)] | |
// テキスト | |
let str = self.initial_txt! as NSString! |
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
textView.userInteractionEnabled = true | |
textView.editable = false | |
// tapでテキストのポジション検出可能とするため | |
textView.selectable = true | |
// 行間レイアウト用 | |
// textView.layoutManager.delegate = self |
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 <UIKit/UIKit.h> | |
#import "AppDelegate.h" | |
#import <Underscore.h> | |
int main(int argc, char * argv[]) { | |
@autoreleasepool { | |
NSArray *array = @[@1, @2, @3, @4, @5, @6, @7]; | |
id first = Underscore.array(array).first; // @1が返る | |
NSLog(@"first : %@", first); |
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
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; | |
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain]; |
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
@IBOutlet weak var bg: WKInterfaceGroup! | |
override func awakeWithContext(context: AnyObject?) { | |
var images: [UIImage] = [] | |
for (var i=1; i<71; i++){ | |
images.append(UIImage(named: String(format: "jackson%d.jpg", i))!) | |
} | |
let animatedImage = UIImage.animatedImageWithImages( |
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
@IBOutlet weak var sp_image: WKInterfaceImage! | |
let sp_image_cnt: Int = 17 | |
override func willActivate() { | |
var images: [UIImage] = [] | |
for (var i=1; i<sp_image_cnt; i++){ | |
images.append(UIImage(named: String(format: "%d.png", 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
// 保存データを全削除 | |
let userDefault = NSUserDefaults.standardUserDefaults() | |
var appDomain:String = NSBundle.mainBundle().bundleIdentifier! | |
NSUserDefaults.standardUserDefaults().removePersistentDomainForName(appDomain) | |
// キーidの値のみを削除 | |
userDefault.removeObjectForKey("id") |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AngularFire Sample</title> | |
</head> | |
<body> | |
<div ng-app="sampleApp" ng-controller="SampleController"> | |
<ul class="chatbox"> | |
<li ng-repeat="message in messages">{{message.from}}: {{message.content}}</li> | |
</ul> |
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
// | |
// ViewController.m | |
// webJsExec | |
// | |
// Created by matz on 2014/11/30. | |
// Copyright (c) 2014年 matz. All rights reserved. | |
// | |
#import "ViewController.h" |
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
// | |
// EmojiRow.swift | |
// EmojiWatch | |
// | |
// Created by matz on 2014/11/24. | |
// Copyright (c) 2014年 matz. All rights reserved. | |
// | |
import UIKit | |
import WatchKit |