전체 글24 Custom Operator |> 해당 포스트를 공부하며 정리한 글입니다. https://www.pointfree.co/episodes/ep1-functions Episode #1: Functions Our first episode is all about functions! We talk a bit about what makes functions special, contrasting them with the way we usually write code, and have some exploratory discussions about operators and composition. www.pointfree.co 연산자 사용자 정의를 알아보도록 하겠습니다. |> 는 왼쪽에 입력받은 것을 오른쪽에서 처리하여 출력한다는 뜻의 연산자로 Elixi.. 2022. 11. 29. 프로젝트 모듈화하기 -프로젝트 생성 요즘 회사 프로젝트에서 Monolish 앱에서 벗어나 모듈화를 통한 코드 분리, 기능 분리, 의존성 분리 등을 진행하면서 처음 시작했던 모듈 나누기 작업을 정리하면서 해보겠습니다. (굉장히 간단..!) Workspace를 만들어 둡니다. 프로젝트 단위로 기능을 나눌 것이니 관리하기 용이하도록 하기 위해서입니다. 이름은 Note처럼 필기할 수 있는 느낌으로다가.. 이제 본 프로젝트를 만듭니다. App으로 선택하고 프로젝트를 생성해주세요! (이때 프로젝트의 그룹을 위에서 만든 Workspace로!) 그럼 workspace 안에 App Project가 생겼을 겁니다. Noterious는 기획하면서 만든 거라 기능을 상세하기 구분하지 않았지만 공통 기능 및 Extension 함수, 공통 UI를 제공하는 모듈은 .. 2022. 11. 21. ObjectIdentifier을 이용한 DI - 2 1편에서 ObjectIdentifier을 활용하여 DI 를 할 수 있는 DependencyInjecter 클래스를 만들었습니다. 객체를 등록하고 빼내고 하는 기본기능을 만들어보았는데요. 만약 같은걸 두 개 등록 하고 싶을 때가 있을 겁니다. 바로 아래처럼! let dependencyInjecter = DependencyInjecter() dependencyInjecter.register(MovieRepository.self) { _ in MovieRepositoryImpl() } dependencyInjecter.register(MovieRepository.self) { _ in MovieRepositoryImpl2() } dependencyInjecter.printKeys() //============.. 2022. 4. 13. ObjectIdentifier을 이용한 DI ObjectIdentifier A unique identifier for a class instance or metatype. Overview This unique identifier is only valid for comparisons during the lifetime of the instance. In Swift, only class instances and metatypes have unique identities. There is no notion of identity for structs, enums, functions, or tuples. ObjectIdenfier는 메타타입 또는 클래스타입의 인스턴스를 식별값을 정해주고 활용 할 수 있도록 도와주는데요. DI를 적용할 때 ObjectIden.. 2022. 4. 6. 이전 1 ··· 3 4 5 6 다음