Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

ビットフラグ

ビットフラグはOpsionSetを定義すると使える。

    struct Hoge : OptionSet {
        let rawValue : Int
        
        static let a = Hoge(rawValue: 0b0001)
        static let b    = Hoge(rawValue: 0b0010)
        static let c    = Hoge(rawValue: 0b0100)
        static let all:Hoge   = [.a, .b, .c]
        static let ab:Hoge = all.subtracting(.c)
        
        func isNonEmpty() -> Bool {
            return !self.isEmpty
        }
        
        func isIntersect(_ v:Hoge) -> Bool {
            return self.intersection(v).isNonEmpty()
        }
        
    }

アクティビティ図

フローチャート代わりに使える。

テンプレ的に以下

```plantuml
title <size:18>Sample</size>

(*) --> "A"

if "State" then
    partition "PartA"
        --> [a] "B" as hoge
    end partition
else
    -> [b] "C"
    --> "D"
endif

partition "PartA" {
    hoge --> ===fork===

    ===fork=== --> "E"
    --> ===join===

    ===fork=== --> "F"
    --> ===join===

    ===join=== --> "G"
}
-->(*)
note right : H
```

f:id:KatagiriSo:20171213122633p:plain

詳細は以下を参照
yohshiy.blog.fc2.com

最初

作る sqlite3設定

rodhos.hatenadiary.jp

命令群

./bin/cake bake migration CreateProducts name:string description:text created modified
./bin/cake migrations migrate
./bin/cake bake seed Product
./bin/cake migrations seed
./bin/cake bake model Products
./bin/cake bake controller Products
./bin/cake bake template Products

sqlite3

.tables
select description, modified, created  from products;

ローカルで確認

./bin/cake server
http://localhost:8765/Products

基本的なこと

DisposeBag

Observableの自動開放用袋、追加しておくとDisposeBagがdeinitする際にdisposeしてくれる。

CompositeDisposable

Disposableをまとめてられる。まとめて廃棄すればよいものをまとめておく。