재생목록 만들기 페이지 추가
This commit is contained in:
14
SodaLive/Sources/Extensions/CollectionExtension.swift
Normal file
14
SodaLive/Sources/Extensions/CollectionExtension.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// CollectionExtension.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 12/8/24.
|
||||
//
|
||||
|
||||
extension Collection {
|
||||
func mapIndexed<T>(_ transform: (Index, Element) -> T) -> [T] {
|
||||
return self.enumerated().map { index, element in
|
||||
transform(self.index(startIndex, offsetBy: index), element)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user