enumerated1 [Swift] enumerated()로 인덱스와 요소를 모두 반환하기 Swift의 문자열이나 배열에서 어떻게 하면 인덱스와 요소를 하나로 묶은 채 모두 출력할 수 있을까? 바로 enumerated() 메서드를 이용하면 된다. enumerate는 '열거하다'라는 뜻의 영단어이다. 📌 공식 문서 링크 enumerated() | Apple Developer Documentation Collection Types | Documentation 콜렉션 타입(Collection Types) | Swift 📌 요약 Returns a sequence of pairs (n, x), where n represents a consecutive integer starting at zero and x represents an element of the sequence. 쌍으로 묶은 (n, x) 과.. 2023. 3. 28. 이전 1 다음 반응형