IOS Reusable Components

During my work with iOS application development, I noticed that almost every application has several parts that repeat. For example, each application has user management logic, login, registration, forgotten password. And each time I find that I myself try to manually import the logic that has already been developed (view controllers, tips, storyboards). My question is how can I implement these common functions in a separate component, so I can just reuse them every time I start a new project. Also note that there should be an opportunity for small settings, for example, all applications have a login screen, but the user interface design varies for each application.

In short, I need:

  • How to encapsulate frequently repeated functions in a separate component.
  • How to add a component to a new project.
  • How to make settings in a component without changing the core of the component.

I suppose that some combination of Framework (or static library) and cocoa pods should be made here, but I wanted to hear if someone had already developed some concepts about this.

+4
source share
2 answers

How to encapsulate frequently repeated functions in a separate component.

No matter what you choose, you will have to abandon the code that your individual component requires from your code base. This is the first step in the whole process. - so think long and hard about if it makes sense to turn it into a separate component

So now you have the code that you would like to reuse ...

, Xcode, , . Cocoa pods - - : (

Xcode

- Xcode, . Xcode, , . Xcode , .

iOS

. iOS . , .

Frameworks

OS X . , , nib , , , , , .. , .

. .framework, , . , .

, . - , , / , Xcode. , .

.

, , . .

, , .

.

, , . , .

+1

, , , , , - , , CocoaPods, git. 1 2. 3 , , . , .

+5

Source: https://habr.com/ru/post/1619742/


All Articles