-
(iOS) randomElement() - 랜덤으로 값 꺼내기iOS💖 2022. 12. 22. 15:41
Declaration
func randomElement() -> Self.Element?- 랜덤하게 꺼내는데 값이 nil일 경우를 생각한다.
- 리턴 값은 ? 이다.
Example
let symbols: [String] = ["cloud", "sun", "snow"] let symbol = symbols.randomElement()!'iOS💖' 카테고리의 다른 글
(iOS) constraints update 안될때 단축키 (0) 2022.12.22 (iOS) StackView 뿌시기💔 (1) 2022.12.22 (Xcode) Lable 줄바꿈 (0) 2022.12.21 (iOS) TabBarController 이해하기 (0) 2022.12.21 🥗 Swift grammar #01 - Basic Data type, Collection (1) 2022.12.16