공통 상수 페이지
프로젝트 파일에서 공통으로 사용하는 상수들을 관리하는 페이지 만들기
import UIKit
struct Config {
static let bundleID = Bundle.main.bundleIdentifier!
static let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
static let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String
struct Size {
static let screenWidth = UIScreen.main.bounds.width
static let screenHeight = UIScreen.main.bounds.height
static let navigationBarHeight: CGFloat = 44
static let toolBarHeight: CGFloat = 44
static let statusBarHeight = UIApplication.shared.statusBarFrame.height
static let statusBarAndNavigationBarHeight = Size.statusBarHeight + Size.navigationBarHeight
}
struct URL {
static let bipumListUrl : String = "http://61.....199:8080/BIPUM_SERVER/bipumListXml.jsp"
static let imageStartUrl : String = "http://61.....199:8080/IMAGE/"
static let imageLastUrl : String = ".png"
static let historyListUrl :String = "http://61.....199:8080/BIPUM_SERVER/whereListXml.jsp"
static let historyNumberListUrl :String = "http://61.....199:8080/BIPUM_SERVER/whereListNumberXml.jsp"
static let historyUploadUrl :String = "http://61.....199:8080/BIPUM_SERVER/historyUpload.jsp"
static let bipumNumberListUrl :String = "http://61.....199:8080/BIPUM_SERVER/bipumNumberListXml.jsp"
static let bipumDeleteUrl :String = "http://61.....199:8080/BIPUM_SERVER/bipumDelete.jsp"
static let bipumEndDateUrl :String = "http://61.....199:8080/BIPUM_SERVER/endDateEdit.jsp"
static let historyResistrationUrl :String = "http://61.....199:8080/BIPUM_SERVER/historyResistration.jsp"
static let fileUploadUrl :String = "http://61.....199:8080/BIPUM_SERVER/RegistrationUpload.jsp"
}
struct API {
static let mainKey: String = ""
static let subKey: String = ""
}
struct Font {
static func main(_ size: CGFloat) -> UIFont { return Config.Font.nanumSquare(size: size) }
static func nanumSquare(size: CGFloat) -> UIFont { return UIFont(name: "NanumSquare", size: size) ?? UIFont.systemFont(ofSize: size) }
static func nanumBarunGothic(size: CGFloat) -> UIFont { return UIFont(name: "NanumBarunGothic", size: size) ?? UIFont.systemFont(ofSize: size) }
}
struct Logo {
//static let titleImage: UIImage = R.image.titleImage()!
}
}
호출 할 때는
Config.URL.bipumListUrl