스플래시 페이지 추가

This commit is contained in:
Yu Sung
2023-08-09 16:52:36 +09:00
parent 058c907609
commit 84d3dd61ca
27 changed files with 932 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
//
// StringExtension.swift
// yozm
//
// Created by klaus on 2022/06/03.
//
import Foundation
extension Optional where Wrapped == String {
func isNullOrBlank() -> Bool {
return self == nil || self!.trimmingCharacters(in: .whitespaces).isEmpty
}
}
extension String {
func convertDateFormat(from: String, to: String) -> String {
let fromFormatter = DateFormatter()
fromFormatter.dateFormat = from
fromFormatter.timeZone = TimeZone(identifier: TimeZone.current.identifier)
if let date = fromFormatter.date(from: self) {
return date.convertDateFormat(dateFormat: to)
} else {
return self
}
}
func substring(from: Int, to: Int) -> String {
guard from < count, to >= 0, to - from >= 0 else {
return ""
}
// Index
let startIndex = index(self.startIndex, offsetBy: from)
let endIndex = index(self.startIndex, offsetBy: to + 1) // '+1' : endIndex
//
return String(self[startIndex ..< endIndex])
// - https://ios-development.tistory.com/379
}
}