Access modifiers serve not only to encapsulate our code. But they can also speed up the runtime of our application. These modifiers are
final I use for all classes.
More information here
Try to use structures instead of classes. Because structures are more secure (passing by value, not by reference) and structures are stored in a
stack, which is much faster to access than the
heap (where our objects are stored). Also, because the structure is stored in a
stack, it does not increase the
- Better optimized
- Do not increase ARC counter
- When you assign clousure become escaping
selfto capture context
Swift has no exceptions like other languages, the only exceptions left are in Objective-C, the main reasons are unstable operation, horrible performance and memory leaks
Layout - responsible for placing the view on the screen, and also serves as a process for calculating the frame.
AutoLayout - Almost the same, but the calculation process is automatic.
How often do you crash because of AutoLayout? And memory problems? And a console full of AutoLayout errors?
These are the main reasons why auto layout is evil, but unfortunately it is very common, but nevertheless try to use the normal Layout.
But please do not mix both in one project :)
- Layout and AutoLayout.
- Hierarchy views
The two items in the UIView's area of responsibility are handled by CALayer. The main reasons for using it:
- Using GPU
Handler of any user input in the UIKit application