Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] 기존의 UrlLiteral 을 없애고 info.plist 에 baseUrl 숨기기 #387

Closed
wants to merge 11 commits into from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
## User settings
xcuserdata/

## Info files
UrlInfo.plist

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
Expand Down
20 changes: 16 additions & 4 deletions Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */; };
396334D9292DAE0000E74B77 /* AppleLoginResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */; };
3975CEAF293EEDD6002D4F1A /* KeywordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3975CEAE293EEDD6002D4F1A /* KeywordView.swift */; };
397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397E49562924D93F004220D6 /* UrlLiteral.swift */; };
397E495A2924F871004220D6 /* UserDefaultStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397E49592924F871004220D6 /* UserDefaultStorage.swift */; };
397E495C2924F8A2004220D6 /* UserDefaultHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397E495B2924F8A2004220D6 /* UserDefaultHandler.swift */; };
398474222925CF4800EDC139 /* TeamInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398474212925CF4800EDC139 /* TeamInfoResponse.swift */; };
Expand Down Expand Up @@ -99,6 +98,7 @@
3E557FFD2901CD7400714E46 /* Keyword.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FFC2901CD7400714E46 /* Keyword.swift */; };
3E5580072906A7B200714E46 /* InProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5580062906A7B200714E46 /* InProgressViewController.swift */; };
3E66777529419C8300BB5670 /* KeywordTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */; };
3E6FFF6D2A1FA02700166DCE /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6FFF6C2A1FA02700166DCE /* Config.swift */; };
3E8052DF2906E09100A6449D /* KeywordSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */; };
3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */; };
3EA341E62924E2AD005CBD1C /* HomeEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */; };
Expand Down Expand Up @@ -147,6 +147,7 @@
D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; };
D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; };
D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; };
D738A9A72A20C092006182FE /* UrlInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = D738A9A62A20C092006182FE /* UrlInfo.plist */; };
D7505119294239A5001BDA34 /* SelectMemberView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7505118294239A5001BDA34 /* SelectMemberView.swift */; };
D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */; };
D75D0D2229B2003F0013ADA5 /* EmptyTeamView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */; };
Expand Down Expand Up @@ -211,7 +212,6 @@
396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginResponse.swift; sourceTree = "<group>"; };
396334DC292DB07100E74B77 /* Maddori.Apple.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Maddori.Apple.entitlements; sourceTree = "<group>"; };
3975CEAE293EEDD6002D4F1A /* KeywordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordView.swift; sourceTree = "<group>"; };
397E49562924D93F004220D6 /* UrlLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UrlLiteral.swift; sourceTree = "<group>"; };
397E49592924F871004220D6 /* UserDefaultStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultStorage.swift; sourceTree = "<group>"; };
397E495B2924F8A2004220D6 /* UserDefaultHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultHandler.swift; sourceTree = "<group>"; };
398474212925CF4800EDC139 /* TeamInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamInfoResponse.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -257,6 +257,7 @@
3E557FFC2901CD7400714E46 /* Keyword.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Keyword.swift; sourceTree = "<group>"; };
3E5580062906A7B200714E46 /* InProgressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressViewController.swift; sourceTree = "<group>"; };
3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordTextFieldView.swift; sourceTree = "<group>"; };
3E6FFF6C2A1FA02700166DCE /* Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = "<group>"; };
3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordSectionHeaderView.swift; sourceTree = "<group>"; };
3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCacheManager.swift; sourceTree = "<group>"; };
3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeEndPoint.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -305,6 +306,7 @@
D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = "<group>"; };
D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = "<group>"; };
D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = "<group>"; };
D738A9A62A20C092006182FE /* UrlInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = UrlInfo.plist; sourceTree = "<group>"; };
D7505118294239A5001BDA34 /* SelectMemberView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectMemberView.swift; sourceTree = "<group>"; };
D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectKeywordTypeView.swift; sourceTree = "<group>"; };
D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyTeamView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -397,6 +399,7 @@
39257DD828F90EA900201E0B /* Network */ = {
isa = PBXGroup;
children = (
3E6FFF6B2A1FA01600166DCE /* Setting */,
39AC287D29269BBB006CFEE6 /* Protocol */,
397E49582924F80E004220D6 /* Storage */,
39F52C782924CC8600B19A77 /* EndPoint */,
Expand Down Expand Up @@ -437,7 +440,6 @@
39257DF028F93C2A00201E0B /* ImageLiteral.swift */,
39257DF228F93D8900201E0B /* TextLiteral.swift */,
395C7E1228F9841A00FC2FCA /* SizeLiteral.swift */,
397E49562924D93F004220D6 /* UrlLiteral.swift */,
);
path = Literal;
sourceTree = "<group>";
Expand Down Expand Up @@ -489,6 +491,7 @@
isa = PBXGroup;
children = (
39257DD228F8FEBE00201E0B /* Info.plist */,
D738A9A62A20C092006182FE /* UrlInfo.plist */,
39257DC628F8FEBD00201E0B /* SceneDelegate.swift */,
39257DC428F8FEBD00201E0B /* AppDelegate.swift */,
);
Expand Down Expand Up @@ -814,6 +817,14 @@
path = UIComponent;
sourceTree = "<group>";
};
3E6FFF6B2A1FA01600166DCE /* Setting */ = {
isa = PBXGroup;
children = (
3E6FFF6C2A1FA02700166DCE /* Config.swift */,
);
path = Setting;
sourceTree = "<group>";
};
3EB508672913550000FB77CB /* Reflection */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1179,6 +1190,7 @@
files = (
3EF7909B29E462F50052578E /* LaunchScreen.storyboard in Resources */,
3998E86F295C308100541752 /* Settings.bundle in Resources */,
D738A9A72A20C092006182FE /* UrlInfo.plist in Resources */,
39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -1203,7 +1215,6 @@
391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */,
39F52C7A2924CC9600B19A77 /* SetupEndPoint.swift in Sources */,
39F52C5F2923338B00B19A77 /* MembersDetailResponse.swift in Sources */,
397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */,
3E557FFA2901CD4200714E46 /* KeywordCollectionViewCell.swift in Sources */,
52F0CB5229178C2700E39C50 /* AlertViewController.swift in Sources */,
395C7E0528F953D200FC2FCA /* UIViewController+Extension.swift in Sources */,
Expand Down Expand Up @@ -1310,6 +1321,7 @@
39F52C4929232DFB00B19A77 /* JoinTeamDTO.swift in Sources */,
39F52C552923311200B19A77 /* JoinTeamResponse.swift in Sources */,
39257DED28F9378D00201E0B /* BaseCollectionViewCell.swift in Sources */,
3E6FFF6D2A1FA02700166DCE /* Config.swift in Sources */,
391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */,
39F1A13C2912637E005E3456 /* MyFeedbackMemberCollectionViewCell.swift in Sources */,
391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */,
Expand Down
14 changes: 0 additions & 14 deletions Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift

This file was deleted.

5 changes: 5 additions & 0 deletions Maddori.Apple/Maddori.Apple/Global/Supports/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
10 changes: 10 additions & 0 deletions Maddori.Apple/Maddori.Apple/Global/Supports/UrlInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BASE_URL</key>
<string></string>
<key>IMAGE_BASE_URL</key>
<string></string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class MemberCollectionViewCell: BaseCollectionViewCell {
memberInfoView.profileNicknameLabel.text = nickname
memberInfoView.profileRoleLabel.text = role
if let imagePath {
memberInfoView.profileImageView.load(from: UrlLiteral.imageBaseURL + imagePath)
memberInfoView.profileImageView.load(from: Config.imageBaseUrl + imagePath)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ enum AddFeedBackEndPoint<T: Encodable> {
var address: String {
switch self {
case .fetchCurrentTeamMember:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/members"
case .dispatchAddFeedBack(let reflectionId, _):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ enum CreateReflectionEndPoint<T: Encodable> {
var address: String {
switch self {
case .patchReflectionDetail(let reflectionId, _):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)"
case .deleteReflectionDetail(let reflectionId):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum EditTeamNameEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .patchEditTeamName:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/team-name"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/team-name"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ enum HomeEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .fetchCertainTeamDetail:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)"
case .fetchCurrentReflectionDetail:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/current"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/current"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ enum InProgressEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .fetchTeamMembers:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/members"
case .fetchTeamAndUserFeedback(let reflectionId, let memberId):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)"
case .patchEndReflection(let reflectionId):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ enum MyFeedBackEndPoint<T: Encodable> {
var address: String {
switch self {
case .fetchCurrentTeamMember:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/members"
case .fetchCertainMemberFeedBack(let memberId):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/current/feedbacks/from-me?members=\(memberId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/current/feedbacks/from-me?members=\(memberId)"
case .deleteFeedBack(let reflectionId, let feedBackId):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)"
case .putEditFeedBack(let reflectionId, let feedBackId, _):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ enum MyReflectionEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .fetchPastReflectionList(let teamId):
return "\(UrlLiteral.baseUrl2)/teams/\(teamId)/reflections"
return "\(Config.baseUrl)/teams/\(teamId)/reflections"
case .fetchCertainTypeFeedbackAllID(let reflectionId, let cssType):
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)"
case .deleteUser:
return "\(UrlLiteral.baseUrl2)/auth/signout"
return "\(Config.baseUrl)/auth/signout"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ enum SetupEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .dispatchCreateTeam:
return "\(UrlLiteral.baseUrl2)/teams"
return "\(Config.baseUrl)/teams"
case .dispatchJoinTeam(let teamId, _):
return "\(UrlLiteral.baseUrl2)/users/join-team/\(teamId)"
return "\(Config.baseUrl)/users/join-team/\(teamId)"
case .fetchCertainTeam(let invitationCode):
return "\(UrlLiteral.baseUrl2)/teams?invitation_code=\(invitationCode)"
return "\(Config.baseUrl)/teams?invitation_code=\(invitationCode)"
case .dispatchAppleLogin:
return "\(UrlLiteral.baseUrl2)/auth"
return "\(Config.baseUrl)/auth"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ enum TeamDetailEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .fetchTeamMember:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)/members"

case .fetchTeamInformation:
return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)"
return "\(Config.baseUrl)/teams/\(UserDefaultStorage.teamId)"

case .deleteTeam:
return "\(UrlLiteral.baseUrl2)/users/team/\(UserDefaultStorage.teamId)/leave"
return "\(Config.baseUrl)/users/team/\(UserDefaultStorage.teamId)/leave"

case .fetchUserTeamList:
return "\(UrlLiteral.baseUrl2)/users/teams"
return "\(Config.baseUrl)/users/teams"

case .patchEditProfile:
return "\(UrlLiteral.baseUrl2)/users/teams/\(UserDefaultStorage.teamId)/profile"
return "\(Config.baseUrl)/users/teams/\(UserDefaultStorage.teamId)/profile"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum TeamInfoEndPoint<T: Encodable>: EndPointable {
var address: String {
switch self {
case .fetchUserTeamList:
return "\(UrlLiteral.baseUrl2)/users/teams"
return "\(Config.baseUrl)/users/teams"
}
}

Expand Down
44 changes: 44 additions & 0 deletions Maddori.Apple/Maddori.Apple/Network/Setting/Config.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// Config.swift
// Maddori.Apple
//
// Created by 이성민 on 2023/05/25.
//

import Foundation

enum Config {
enum Keys {
enum Plist {
static let baseUrl = "BASE_URL"
static let imageBaseUrl = "IMAGE_BASE_URL"
}
}

private static let infoDictionary: [String: Any] = {
guard let path = Bundle.main.path(forResource: "UrlInfo", ofType: "plist") else {
fatalError("plist cannot be found.")
}
guard let dict = NSDictionary(contentsOfFile: path) else {
fatalError()
}
return dict as! [String : Any]
}()

}

extension Config {

static let baseUrl: String = {
guard let key = Config.infoDictionary[Keys.Plist.baseUrl] as? String
else { fatalError("baseUrl not fetched from info.plist") }
return key
}()

static let imageBaseUrl: String = {
guard let key = Config.infoDictionary[Keys.Plist.imageBaseUrl] as? String
else { fatalError("imageBaseUrl not fetched from info.plist") }
return key
}()

}
Loading