반응형
iOS Swift 사용자 정의 연산자 Custom Operator
postfix operator ~~ extension String { static postfix func ~~ (string: Self) -> Character { return string.last ?? Character("") } } "Gons"~~// s 문자열의 마지막 글자를 ~~ 물결 2개로 가져옴. 이런식으로 원하는 동작을 하는 연산자를 만들 수 있습니다. iOS Swift Xcode Custom Operator postfix prefix infix ternary
iOS Swift + UIKit
2023. 1. 1. 00:00
반응형