Skip to content

Instantly share code, notes, and snippets.

@gitbricho
gitbricho / flow01_01.swift
Last active March 27, 2016 05:14
swift:flow
//: Playground - noun: a place where people can play
import UIKit
//## for-in
for i in 1...3 {
//3回繰り返し
}
// 配列の要素の数だけ繰り返して合計を求める
var v合計 = 0
@gitbricho
gitbricho / closure01_01.swift
Last active August 19, 2016 09:51
swift:closure
import UIKit
//## シンタックス: {(引数リスト) -> (戻り値) in 文}
//# 変数にクロージャを代入
//例1 {() -> () }
var v引数無し戻り値無し: ()->() = {
print("引数無し戻り値無しのクロージャ")
}
v引数無し戻り値無し() //"引数無し戻り値無しのクロージャ"
@gitbricho
gitbricho / collection01_01.swift
Last active June 17, 2016 09:09
swift:collection
import UIKit
//## 配列の定義
//# 空の配列の作成
var v整数配列 = [Int]() //[]
print("v整数配列の要素数:\(v整数配列.count)")
//結果:v整数配列の要素数:0\n
//# 配列に値を追加
v整数配列.append(5) //[5]
@gitbricho
gitbricho / class01_01.swift
Last active June 18, 2016 06:36
swift:class
//: Playground - noun: a place where people can play
import UIKit
//## クラスとストラクチャ #####
//## 定義
struct S住所 {
// MARK:プロパティ
var 郵便番号 = ""
var 都道府県 = ""
var 市区町村 = ""
@gitbricho
gitbricho / AppTests.swift
Last active May 2, 2016 07:27
IOSSample101
import XCTest
@testable import App
class AppTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
@gitbricho
gitbricho / ATS1_info.plist
Last active January 11, 2016 04:21
IOSSample101
...
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
...
</dict>
@gitbricho
gitbricho / MovieRepo.swift
Last active January 11, 2016 04:03
IOSSample
import UIKit
class MovieRepo {
// MARK: プロパティ
var movies = [MovieT]()
// MARK: イニシャライザ
init() {
let photo1 = UIImage(named: "movie01")!
@gitbricho
gitbricho / Comment.swift
Last active January 11, 2016 04:07
IOSSample101
import UIKit
class Comment {
// MARK: プロパティ
var id: Int
var text: String
// MARK: イニシャライザ
init(id:Int, text:String) {
self.id = id
@gitbricho
gitbricho / B5:view.properties
Created November 18, 2014 06:22
healthcare: src/view.properties
pdfView.(class)=com.itrane.healthcare.view.PdfBuilder
@gitbricho
gitbricho / B4:vodList.html
Last active August 29, 2015 14:09
healthcare: WEB-INF/views/vod/vodList.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="fragment/frag01 :: htmlhead" th:with="title=#{app.title}"></head>
<style>
.contents {
margin: 50px;
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>