String2 [iOS 유용한 메소드] joined() 배열을 텍스트로 나눌때 편한 함수 "," , "-" joined()는 이런식으로 배열을 string으로 편하게 return 해주는 메소드이다. extension Array where Self.Element == String { /// Returns a new string by concatenating the elements of the sequence, /// adding the given separator between each element. /// /// The following example shows how an array of strings can be joined to a /// single, comma-separated string: /// /// let cast = ["Vivien", "Marlon", "Kim", "Karl"] /// l.. 2020. 5. 29. [iOS DateFormatter Locale] Date->String Locale identifier 사용표 예) let dateFormatter = DateFormatter() dateFormatter.locale = Locale(identifier: "ko_KR") 필드 심볼 ko-KR en_US_POSIX 내용 시대 (Era) G 서기 AD 기원전/후(서기) 표시 BC, AD GG 서기 AD GGG 서기 AD GGGG 서력기원 Anno Domini 기원 전후를 풀어서 표기 GGGGG 서기 A 년 (Year) y 2012 2012 년도를 네 자리로 표시 yy 12 12 년도를 두 자리로 표시 yyy 2012 2012 년도를 네 자리로 표시 yyyy 2012 2012 yyyyy 2012 2012 네 자리 년도 앞에 '0'이 붙는다. yyyyyy 2012 2012 Y 2012 2012 "Week of Year".. 2019. 11. 21. 이전 1 다음