Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Projects/Core/Sources/Extension/String+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ public extension String {
return serverKey
}

/// domain url
static var domainURL: Self {
guard let any = Bundle.main.object(
forInfoDictionaryKey: "DOMAIN_URL"
),
let domain = any as? String
else { return "" }
return domain
}

/// 프로젝트 버전
static func getCurrentVersion() -> [Int] {
static func getCurrentVersion() -> Self {
guard let dictionary = Bundle.main.infoDictionary,
let version = dictionary["CFBundleShortVersionString"] as? String
else { return [1, 0, 0] }
else { return "1.0.0" }

return version.split(separator: ".").compactMap { Int($0) }
return version
}

static func getDeviceIdentifier() -> String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public extension RegularAlarmEndPoint {
}

var host: String {
"api.wherebybus.shop"
return .domainURL
}

var path: String {
Expand Down