Determines how attractive a break opportunity in this view is. This can be used for determining which view is the most attractive to call
breakView
on in the process of formatting. A view that represents text that has whitespace in it might be more attractive than a view that has no whitespace, for example. The higher the weight, the more attractive the break. A value equal to or lower than
BadBreakWeight
should not be considered for a break. A value greater than or equal to
ForcedBreakWeight
should be broken.
This is implemented to provide the default behavior of returning BadBreakWeight
unless the length is greater than the length of the view in which case the entire view represents the fragment. Unless a view has been written to support breaking behavior, it is not attractive to try and break the view. An example of a view that does support breaking is LabelView
. An example of a view that uses break weight is ParagraphView
.