Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

erdinc27

macrumors regular
Original poster
Jul 20, 2011
168
1
hey guys. I have two Targets(Test and Dev) in my project. They have different base url and endpoint names that are hold in info-Test.plist and info-Dev.plist. What I want to do is I want to read that base url and enpoints in a class and use them as global variables. I have a Configuration.swift file and when I try to read the plist items like that
Code:
if let baseURL = Bundle.main.path(forResource: "info", ofType: "plist") {
    
}
then i get that error
Statements are not allowed at the top level

Where it would be better option to read that values and hold them as globals?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.