Programming/Todo(App)

-1- swift에서는 pch가 없다. 싱글톤으로!

몽롱한상태 2020. 10. 24. 21:08

앱 기본 화면 구성

 

참고 앱 ( microSoft Todo)

 

하려고 했던 것-

앱에 사용되는 고정된 텍스트들을 하나의 파일 안에 넣어서 어떤 코드 부분에서도 접근 가능하게 하고자 했음.

-> object-c로 된 이전 프로젝트에서 .pch라는 게 기억남

내가 원하던 것

 

swift에서도 pch파일 혹은 같은 역할을 하는 것이 있는지 찾아봤다. 하지만...

stackoverflow.com/questions/31648610/what-is-an-alternative-to-pch-in-swift

stackoverflow.com/questions/25113256/why-pch-file-not-available-in-swift

 

Why .pch file not available in swift?

In swift, Prefix.pch file is not provided. In my project, I want to declare some macros globally and use through out application. Can anyone give me suggestion how to do it, Where to declare? Is ...

stackoverflow.com

 

결론 - 싱글톤으로 구현