TestMode 를 Info.plist에 생성하고 Boolean 형으로 지정한다.


    var isTestmode_network : Bool

    var isTestmode_RESTAPI : Bool

전역 싱글톤 클래스의 init에 넣어 초기화 해서 쓰면 됨

static let s = GS()


   private init() {

        var nsDictionary: NSDictionary?

        let path = Bundle.main.path(forResource: "Info", ofType: "plist")

        nsDictionary = NSDictionary(contentsOfFile: path ?? "")

        let value: AnyObject = nsDictionary?.object(forKey: "TestMode") as AnyObject

        isTestmode_network = value as! Bool

        isTestmode_RESTAPI = value as! Bool


항상 GlobalSettings 라 명명했는데 GS가 나름 좋은 일을 많이 했더라. 애국 기업이라 이제 줄여서 씀(귀찮아서 그런것도 사실 좀 있음)

+ Recent posts