What is the easiest way to implement your own functions that are used throughout a large project?

I want to create a set of functions that make life easier. I use them in about 60% of all project files. I wonder what the most effective way to include them in the project.

I am thinking of creating a single file, which they include, and including this file in every file in which I need them. On the other hand, it would be great if I could only include this once in a prominent place so that it was available throughout the project. But I don’t know what place it could be. I am not sure, but I think it is impossible. Or am I mistaken in this assumption?

+3
source share
3 answers

, , API, , , .m .

, :

  • - - , .
  • signleton . (.. +, -)
  • .

, - - ( grouop) . , , , AppDelegate. , NSString.

- - .h .m, , .

. . Matt Gallager , .

, , AppDelegate - , ; -)

+6

prefix.pch, xcode, , / .

UIKit Foundation .

, import, . " " " "

+3

You can include headers in ProjectName_Prefix.pch, I think.

+1
source

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


All Articles