IOS How can I pack reusable code into a reusable widget? How heavily modified text widget?

iOS, how can I pack reusable code in a reusable widget? How heavily modified text widget?

I built a UITextView that has many user-specific functions specific to my application (removes the web server for some special macros, has a special autocomplete dictionary, etc.)

I want to reuse this special text recording on multiple screens of my iOS application. How can I neatly pack this code so it can be easily used as simple as a UITextView can be reused?

+5
source share
2 answers

you can create a class that will have a UITextView as a superclass, and this class will also become a place to implement your functions to support custom functions, and then your class will be used directly instead of UITextView to use custom functions.

+2
source

You put the block @interfacein the .h file and the block @implementationin the .m file. Then, in any file you want to use, the #import.h file is at the top (using double quotes, not angle brackets).

+1
source

All Articles