Bạn nói rất hay rất chính xác .
Nguyen Pham
Vào ngày 27 thg 3, 2023, lúc 20:10, Dankinsoid via Swift Forums notifications@swift.discoursemail.com đã viết:
| dankinsoid
March 27 |
- | - |
I often come across situations when I need access to the internal API of libraries. Sometimes it happens when the scenario I have is different from those that the author of the library foresaw, and this is a separate topic.
But sometimes I don't have access to the API, which obviously can be useful.
For example, Swift has many private environment variables, such as foregroundColor. Many structs (Text, Color, Font etc) are completely closed and there is not even always a way to convert them to similar ones in UIKit. I studied the structure of the Font (I had to convert it to UIFont) using reflection and did not see any reason why its content should be private. I was very surprised to find that the components of the Сolor are not so easy to get, even more difficult than from UIColor.