SlideShare a Scribd company logo
1 of 12
Download to read offline
SWIFT
Iterator
Bill Kim(김정훈) | ibillkim@gmail.com
목차
•Iterator
•Structure
•Implementation
•References
iterator
Iterator(반복자) 패턴은 데이터의 타입(리스트, 스택, 트리 등)을
드러내지 않고 컬렉션 요소를 순회할 수 있는 행동 디자인 패턴입니
다.
Iterator(반복자) 패턴의 주요 아이디어는 컬렉션의 순회 동작을
별도의 반복자 객체로 분리하는 것입니다.
반복자 객체는 알고리즘을 구현할뿐만 아니라 현재 위치나 남은 요
소 등 모든 순회 세부 사항을 캡슐화합니다.
이 덕분에 여러 반복자가 동일한 컬렉션을 서로 독립적으로 순회할
수 있게 되는 것입니다.
Structure
Iterator 패턴을 UML로 도식화하면 아래와 같습니다.
Structure
Collection : 실제 데이터를 가지고 있는 추상 클래스 객체
ConcreteCollection : Collection 객체를 상속받아 데이터를 관
리하고 반복자를 생성할 수 있는 객체
Iterator : 기본 반복자 기능 인터페이스를 가지는 추상 클래스 객
체
ConcreteIterator : Iterator 객체를 상속받아 Collection 객체
들을 관리하며 반복자 관련 기능을 수행하는 객체
Implementation
구체적인 구현에 대해서 소스 코드를 통하여 살펴봅니다.
protocol Collection
{
var items:[Any] { get set }
func makeIterator() -> ConcreteIterator
}
class ConcreteCollectionA : Collection {
var items = [Any]()
func append(_ item: String) {
self.items.append(item)
}
func makeIterator() -> ConcreteIterator {
return ConcreteIterator(self)
}
}
class ConcreteCollectionB : Collection {
var items = [Any]()
func append(_ item: Int) {
self.items.append(item)
}
func makeIterator() -> ConcreteIterator {
return ConcreteIterator(self)
}
}
Implementation
protocol Iterator {
func next() -> Any?
func hasNext() -> Bool
}
class ConcreteIterator : Iterator {
private let collections : Collection
private var index = 0
init(_ collections: Collection) {
self.collections = collections
}
func next() -> Any? {
defer { index += 1 }
return index < collections.items.count ? collections.items[index] : nil
}
func hasNext() -> Bool {
if index < collections.items.count {
return true
}
else {
return false
}
}
}
Implementation
let words = ConcreteCollectionA()
words.append("First")
words.append("Second")
words.append("Third")
let numbers = ConcreteCollectionB()
numbers.append(1)
numbers.append(2)
numbers.append(3)
let iterator1 = words.makeIterator()
while (iterator1.hasNext()) {
print(iterator1.next()!)
// First
// Second
// Third
}
let iterator2 = numbers.makeIterator()
while (iterator2.hasNext()) {
print(iterator2.next()!)
// 1
// 2
// 3
}
Implementation
let iterator3 = ConcreteIterator(words)
while (true) {
guard let collection = iterator3.next() else { break }
print(collection)
// First
// Second
// Third
}
let iterator4 = ConcreteIterator(numbers)
while (true) {
guard let collection = iterator4.next() else { break }
print(collection)
// 1
// 2
// 3
}
References
[1] [Swift]Iterator 패턴 구현하기 : http://minsone.github.io/
mac/ios/swift-sequence
[2] 이터레이터 패턴 : http://www.incodom.kr/이터레이터_패턴
[3] Iterator Design Pattern in Swift Universe : https://
medium.com/@lazarevzubov/iterator-design-pattern-in-
swift-universe-34accb6fafd6
[4] Iterator in Swift : https://refactoring.guru/design-
patterns/iterator/swift/example
[5] Design Patterns in Swift: Iterator Pattern : https://
agostini.tech/2018/06/10/design-patterns-in-swift-iterator-
pattern/
References
[6] Iterator design pattern in Swift : https://theswiftdev.com/
iterator-design-pattern-in-swift/
[7] Design Patterns in Swift: Iterator Pattern : https://
viblo.asia/p/design-patterns-in-swift-iterator-
pattern-6J3ZgmBA5mB
[8] 반복자 패턴 (Iterator Pattern in Swift) : https://jerome.kr/
entry/iterator-pattern
[9] [Design Pattern] 반복자(Iterator) 패턴 - 디자인 패턴 : https://
palpit.tistory.com/200
[10] Intermediate Design Patterns in Swift : https://
www.raywenderlich.com/2102-intermediate-design-patterns-in-
swift
Thank you!

More Related Content

What's hot

[Swift] Data Structure - Stack
[Swift] Data Structure - Stack[Swift] Data Structure - Stack
[Swift] Data Structure - StackBill Kim
 
05_STL컨테이너정리
05_STL컨테이너정리05_STL컨테이너정리
05_STL컨테이너정리noerror
 
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자Jaewook Byun
 
[ES6] 9. Iterator
[ES6] 9. Iterator[ES6] 9. Iterator
[ES6] 9. IteratorHan JaeYeab
 
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자Jaewook Byun
 
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기Jaewook Byun
 
데이터 분석 2 - 동기부여
데이터 분석 2 - 동기부여데이터 분석 2 - 동기부여
데이터 분석 2 - 동기부여Jaewook Byun
 
데이터 분석 3 - Java Collection Framework와 ArrayList
데이터 분석 3 - Java Collection Framework와 ArrayList데이터 분석 3 - Java Collection Framework와 ArrayList
데이터 분석 3 - Java Collection Framework와 ArrayListJaewook Byun
 
Collection framework
Collection frameworkCollection framework
Collection frameworkssuser34b989
 
LINQ란 무엇인가
LINQ란 무엇인가LINQ란 무엇인가
LINQ란 무엇인가Jungsoo Park
 
7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성HyeonSeok Choi
 
05 컬렉션제너릭
05 컬렉션제너릭05 컬렉션제너릭
05 컬렉션제너릭rjawptlsghk
 
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업Jiho Lee
 

What's hot (16)

[Swift] Data Structure - Stack
[Swift] Data Structure - Stack[Swift] Data Structure - Stack
[Swift] Data Structure - Stack
 
05_STL컨테이너정리
05_STL컨테이너정리05_STL컨테이너정리
05_STL컨테이너정리
 
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자
데이터 분석 6 - 나만의 배열 기반 LIST, MyLinkedList를 만들어보자
 
STL study (skyLab)
STL study (skyLab)STL study (skyLab)
STL study (skyLab)
 
[ES6] 9. Iterator
[ES6] 9. Iterator[ES6] 9. Iterator
[ES6] 9. Iterator
 
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자
데이터 분석 4 - 나만의 배열 기반 LIST, MyArrayList를 만들어보자
 
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기
데이터 분석 5 - Java Collection Framework - LinkedList 파헤치기
 
데이터 분석 2 - 동기부여
데이터 분석 2 - 동기부여데이터 분석 2 - 동기부여
데이터 분석 2 - 동기부여
 
데이터 분석 3 - Java Collection Framework와 ArrayList
데이터 분석 3 - Java Collection Framework와 ArrayList데이터 분석 3 - Java Collection Framework와 ArrayList
데이터 분석 3 - Java Collection Framework와 ArrayList
 
C++ stl
C++ stlC++ stl
C++ stl
 
Collection framework
Collection frameworkCollection framework
Collection framework
 
LINQ란 무엇인가
LINQ란 무엇인가LINQ란 무엇인가
LINQ란 무엇인가
 
7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성
 
함수적 사고 2장
함수적 사고 2장함수적 사고 2장
함수적 사고 2장
 
05 컬렉션제너릭
05 컬렉션제너릭05 컬렉션제너릭
05 컬렉션제너릭
 
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업
20111025 Excel의 VBA, 매크로. 그리고 파이썬으로 함께하는 반복작업
 

Similar to [Swift] Iterator

파이썬 Collections 모듈 이해하기
파이썬 Collections 모듈 이해하기파이썬 Collections 모듈 이해하기
파이썬 Collections 모듈 이해하기Yong Joon Moon
 
[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study경 송
 
개경프 1주차 Stl study
개경프 1주차 Stl study개경프 1주차 Stl study
개경프 1주차 Stl study경 송
 
[Swift] Data Structure - Queue
[Swift] Data Structure - Queue[Swift] Data Structure - Queue
[Swift] Data Structure - QueueBill Kim
 
C++ Advanced 강의 4주차
 C++ Advanced 강의 4주차 C++ Advanced 강의 4주차
C++ Advanced 강의 4주차HyunJoon Park
 
Swift3 generic
Swift3 genericSwift3 generic
Swift3 genericEunjoo Im
 
[Swift] Data Structure - Array
[Swift] Data Structure - Array[Swift] Data Structure - Array
[Swift] Data Structure - ArrayBill Kim
 
Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기Daegwon Kim
 
[Algorithm] Radix Sort
[Algorithm] Radix Sort[Algorithm] Radix Sort
[Algorithm] Radix SortBill Kim
 
C++ Template/STL study
C++ Template/STL studyC++ Template/STL study
C++ Template/STL studySeo Dong-yu
 
이펙티브 C++ 공부
이펙티브 C++ 공부이펙티브 C++ 공부
이펙티브 C++ 공부quxn6
 
[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue[Swift] Data Structure - Dequeue
[Swift] Data Structure - DequeueBill Kim
 
알고리즘과 자료구조
알고리즘과 자료구조알고리즘과 자료구조
알고리즘과 자료구조영기 김
 
7가지 동시성 모델 4장
7가지 동시성 모델 4장7가지 동시성 모델 4장
7가지 동시성 모델 4장HyeonSeok Choi
 

Similar to [Swift] Iterator (19)

파이썬 Collections 모듈 이해하기
파이썬 Collections 모듈 이해하기파이썬 Collections 모듈 이해하기
파이썬 Collections 모듈 이해하기
 
[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study[Commit Again] 1주차 STL study
[Commit Again] 1주차 STL study
 
개경프 1주차 Stl study
개경프 1주차 Stl study개경프 1주차 Stl study
개경프 1주차 Stl study
 
Java_08 collection
Java_08 collectionJava_08 collection
Java_08 collection
 
Java collection
Java collectionJava collection
Java collection
 
[Swift] Data Structure - Queue
[Swift] Data Structure - Queue[Swift] Data Structure - Queue
[Swift] Data Structure - Queue
 
Java(4/4)
Java(4/4)Java(4/4)
Java(4/4)
 
C++ Advanced 강의 4주차
 C++ Advanced 강의 4주차 C++ Advanced 강의 4주차
C++ Advanced 강의 4주차
 
Swift3 generic
Swift3 genericSwift3 generic
Swift3 generic
 
ES6-02
ES6-02ES6-02
ES6-02
 
[Swift] Data Structure - Array
[Swift] Data Structure - Array[Swift] Data Structure - Array
[Swift] Data Structure - Array
 
Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기Ruby Enumerator(루비 열거자) 이해하기
Ruby Enumerator(루비 열거자) 이해하기
 
[Algorithm] Radix Sort
[Algorithm] Radix Sort[Algorithm] Radix Sort
[Algorithm] Radix Sort
 
C++ Template/STL study
C++ Template/STL studyC++ Template/STL study
C++ Template/STL study
 
이펙티브 C++ 공부
이펙티브 C++ 공부이펙티브 C++ 공부
이펙티브 C++ 공부
 
[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue
 
알고리즘과 자료구조
알고리즘과 자료구조알고리즘과 자료구조
알고리즘과 자료구조
 
Valentine
ValentineValentine
Valentine
 
7가지 동시성 모델 4장
7가지 동시성 모델 4장7가지 동시성 모델 4장
7가지 동시성 모델 4장
 

More from Bill Kim

[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison[Algorithm] Sorting Comparison
[Algorithm] Sorting ComparisonBill Kim
 
[Algorithm] Big O Notation
[Algorithm] Big O Notation[Algorithm] Big O Notation
[Algorithm] Big O NotationBill Kim
 
[Algorithm] Shell Sort
[Algorithm] Shell Sort[Algorithm] Shell Sort
[Algorithm] Shell SortBill Kim
 
[Algorithm] Quick Sort
[Algorithm] Quick Sort[Algorithm] Quick Sort
[Algorithm] Quick SortBill Kim
 
[Algorithm] Heap Sort
[Algorithm] Heap Sort[Algorithm] Heap Sort
[Algorithm] Heap SortBill Kim
 
[Algorithm] Selection Sort
[Algorithm] Selection Sort[Algorithm] Selection Sort
[Algorithm] Selection SortBill Kim
 
[Algorithm] Merge Sort
[Algorithm] Merge Sort[Algorithm] Merge Sort
[Algorithm] Merge SortBill Kim
 
[Algorithm] Insertion Sort
[Algorithm] Insertion Sort[Algorithm] Insertion Sort
[Algorithm] Insertion SortBill Kim
 
[Algorithm] Bubble Sort
[Algorithm] Bubble Sort[Algorithm] Bubble Sort
[Algorithm] Bubble SortBill Kim
 
[Algorithm] Binary Search
[Algorithm] Binary Search[Algorithm] Binary Search
[Algorithm] Binary SearchBill Kim
 
[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)Bill Kim
 
[Swift] Data Structure - AVL
[Swift] Data Structure - AVL[Swift] Data Structure - AVL
[Swift] Data Structure - AVLBill Kim
 
[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search TreeBill Kim
 
[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)Bill Kim
 
[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)Bill Kim
 
[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary TreeBill Kim
 
[Swift] Data Structure - Tree
[Swift] Data Structure - Tree[Swift] Data Structure - Tree
[Swift] Data Structure - TreeBill Kim
 
[Swift] Data Structure - Graph
[Swift] Data Structure - Graph[Swift] Data Structure - Graph
[Swift] Data Structure - GraphBill Kim
 
[Swift] Data Structure - Heap
[Swift] Data Structure - Heap[Swift] Data Structure - Heap
[Swift] Data Structure - HeapBill Kim
 
[Swift] Data Structure Introduction
[Swift] Data Structure Introduction[Swift] Data Structure Introduction
[Swift] Data Structure IntroductionBill Kim
 

More from Bill Kim (20)

[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison
 
[Algorithm] Big O Notation
[Algorithm] Big O Notation[Algorithm] Big O Notation
[Algorithm] Big O Notation
 
[Algorithm] Shell Sort
[Algorithm] Shell Sort[Algorithm] Shell Sort
[Algorithm] Shell Sort
 
[Algorithm] Quick Sort
[Algorithm] Quick Sort[Algorithm] Quick Sort
[Algorithm] Quick Sort
 
[Algorithm] Heap Sort
[Algorithm] Heap Sort[Algorithm] Heap Sort
[Algorithm] Heap Sort
 
[Algorithm] Selection Sort
[Algorithm] Selection Sort[Algorithm] Selection Sort
[Algorithm] Selection Sort
 
[Algorithm] Merge Sort
[Algorithm] Merge Sort[Algorithm] Merge Sort
[Algorithm] Merge Sort
 
[Algorithm] Insertion Sort
[Algorithm] Insertion Sort[Algorithm] Insertion Sort
[Algorithm] Insertion Sort
 
[Algorithm] Bubble Sort
[Algorithm] Bubble Sort[Algorithm] Bubble Sort
[Algorithm] Bubble Sort
 
[Algorithm] Binary Search
[Algorithm] Binary Search[Algorithm] Binary Search
[Algorithm] Binary Search
 
[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)[Algorithm] Recursive(재귀)
[Algorithm] Recursive(재귀)
 
[Swift] Data Structure - AVL
[Swift] Data Structure - AVL[Swift] Data Structure - AVL
[Swift] Data Structure - AVL
 
[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree
 
[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)
 
[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)
 
[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree
 
[Swift] Data Structure - Tree
[Swift] Data Structure - Tree[Swift] Data Structure - Tree
[Swift] Data Structure - Tree
 
[Swift] Data Structure - Graph
[Swift] Data Structure - Graph[Swift] Data Structure - Graph
[Swift] Data Structure - Graph
 
[Swift] Data Structure - Heap
[Swift] Data Structure - Heap[Swift] Data Structure - Heap
[Swift] Data Structure - Heap
 
[Swift] Data Structure Introduction
[Swift] Data Structure Introduction[Swift] Data Structure Introduction
[Swift] Data Structure Introduction
 

[Swift] Iterator

  • 3. iterator Iterator(반복자) 패턴은 데이터의 타입(리스트, 스택, 트리 등)을 드러내지 않고 컬렉션 요소를 순회할 수 있는 행동 디자인 패턴입니 다. Iterator(반복자) 패턴의 주요 아이디어는 컬렉션의 순회 동작을 별도의 반복자 객체로 분리하는 것입니다. 반복자 객체는 알고리즘을 구현할뿐만 아니라 현재 위치나 남은 요 소 등 모든 순회 세부 사항을 캡슐화합니다. 이 덕분에 여러 반복자가 동일한 컬렉션을 서로 독립적으로 순회할 수 있게 되는 것입니다.
  • 4. Structure Iterator 패턴을 UML로 도식화하면 아래와 같습니다.
  • 5. Structure Collection : 실제 데이터를 가지고 있는 추상 클래스 객체 ConcreteCollection : Collection 객체를 상속받아 데이터를 관 리하고 반복자를 생성할 수 있는 객체 Iterator : 기본 반복자 기능 인터페이스를 가지는 추상 클래스 객 체 ConcreteIterator : Iterator 객체를 상속받아 Collection 객체 들을 관리하며 반복자 관련 기능을 수행하는 객체
  • 6. Implementation 구체적인 구현에 대해서 소스 코드를 통하여 살펴봅니다. protocol Collection { var items:[Any] { get set } func makeIterator() -> ConcreteIterator } class ConcreteCollectionA : Collection { var items = [Any]() func append(_ item: String) { self.items.append(item) } func makeIterator() -> ConcreteIterator { return ConcreteIterator(self) } } class ConcreteCollectionB : Collection { var items = [Any]() func append(_ item: Int) { self.items.append(item) } func makeIterator() -> ConcreteIterator { return ConcreteIterator(self) } }
  • 7. Implementation protocol Iterator { func next() -> Any? func hasNext() -> Bool } class ConcreteIterator : Iterator { private let collections : Collection private var index = 0 init(_ collections: Collection) { self.collections = collections } func next() -> Any? { defer { index += 1 } return index < collections.items.count ? collections.items[index] : nil } func hasNext() -> Bool { if index < collections.items.count { return true } else { return false } } }
  • 8. Implementation let words = ConcreteCollectionA() words.append("First") words.append("Second") words.append("Third") let numbers = ConcreteCollectionB() numbers.append(1) numbers.append(2) numbers.append(3) let iterator1 = words.makeIterator() while (iterator1.hasNext()) { print(iterator1.next()!) // First // Second // Third } let iterator2 = numbers.makeIterator() while (iterator2.hasNext()) { print(iterator2.next()!) // 1 // 2 // 3 }
  • 9. Implementation let iterator3 = ConcreteIterator(words) while (true) { guard let collection = iterator3.next() else { break } print(collection) // First // Second // Third } let iterator4 = ConcreteIterator(numbers) while (true) { guard let collection = iterator4.next() else { break } print(collection) // 1 // 2 // 3 }
  • 10. References [1] [Swift]Iterator 패턴 구현하기 : http://minsone.github.io/ mac/ios/swift-sequence [2] 이터레이터 패턴 : http://www.incodom.kr/이터레이터_패턴 [3] Iterator Design Pattern in Swift Universe : https:// medium.com/@lazarevzubov/iterator-design-pattern-in- swift-universe-34accb6fafd6 [4] Iterator in Swift : https://refactoring.guru/design- patterns/iterator/swift/example [5] Design Patterns in Swift: Iterator Pattern : https:// agostini.tech/2018/06/10/design-patterns-in-swift-iterator- pattern/
  • 11. References [6] Iterator design pattern in Swift : https://theswiftdev.com/ iterator-design-pattern-in-swift/ [7] Design Patterns in Swift: Iterator Pattern : https:// viblo.asia/p/design-patterns-in-swift-iterator- pattern-6J3ZgmBA5mB [8] 반복자 패턴 (Iterator Pattern in Swift) : https://jerome.kr/ entry/iterator-pattern [9] [Design Pattern] 반복자(Iterator) 패턴 - 디자인 패턴 : https:// palpit.tistory.com/200 [10] Intermediate Design Patterns in Swift : https:// www.raywenderlich.com/2102-intermediate-design-patterns-in- swift