2021-10-22から1日間の記事一覧
Java で書かれていたサンプルコードを、Swift で書き換えてみた。 /// アグリゲートの役 protocol Aggregate { func iterator() -> Iterator } /// イテレータの役 protocol Iterator { func hasNext() -> Bool func next() -> Any } /// 本を取り出す実体 f…
Java で書かれていたサンプルコードを、Swift で書き換えてみた。 /// アグリゲートの役 protocol Aggregate { func iterator() -> Iterator } /// イテレータの役 protocol Iterator { func hasNext() -> Bool func next() -> Any } /// 本を取り出す実体 f…