基本はコーディングガイドラインに沿う。
つまり、親クラス: コーディングガイドライン
- 必要に応じてViewの内部で保有関係を階層化する
- 一番親のView(Controllerと直接やりとりするView)でのControllerへのメッセージ送信にはデリゲートモデルを使う
基本はコーディングガイドラインに沿う。
つまり、親クラス: コーディングガイドライン
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
/* ----------------------------------------------- | |
* Accurate Cross-Browser Viewport Width | |
* https://gist.github.com/2399828 | |
* ----------------------------------------------- | |
* Copyright 2012, Brett Jankord. | |
* http://www.brettjankord.com/ | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/MIT | |
* ------------------------------------------------*/ |
(function (window) { | |
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6. | |
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling. | |
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction). | |
// This code is released in the public domain. Do with it what you want, without limitations. I do not promise | |
// that it works, or that I will provide support (don't sue me). | |
// Author: rkorving@wizcorp.jp | |
var timeouts = {}; |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
//.. do other setup | |
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; | |
// Transition neatly from splash screen | |
// Very odd, on iPhone 5 you need to position the splash screen differently.. |
require.config({ | |
baseUrl: '/backbone-tests/', | |
paths: { | |
'jquery' : '/app/libs/jquery', | |
'underscore' : '/app/libs/underscore', | |
'backbone' : '/app/libs/backbone', | |
'mocha' : 'libs/mocha', | |
'chai' : 'libs/chai', | |
'chai-jquery' : 'libs/chai-jquery', | |
'models' : '/app/models' |
$(function(){ | |
var tokenValue = $("meta[name='csrf-token']").attr('content'); | |
$.ajaxSetup({ | |
headers: {'X-CSRF-Token': tokenValue} | |
}); | |
}) |
CSSもモジュラー開発の時代だからこそ、知っておきたいディレクトリ構成の例。Sassを使った例ではあるが、LESSでもStylusでも同じことは実現できる。このあたりの構成についてはかなり考えたがこれは結構よく出来ている。これをベースに今の構成を見直そう。
JavaScriptのモジュールデザインパターンを著者の好きな形式を詳しく見ていきながら解説。短いながら利点を明確にして解説してあるので、是非。