How can I determine how large the NSString area will occupy, i.e. using:
[string drawAtPoint:p withAttributes:nil];
Ideally, I need to do this before drawing it so that I can highlight the "areas" in which lines are drawn accordingly.
You can use the message -[NSString sizeWithAttributes:].
-[NSString sizeWithAttributes:]
You can use sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:. This is an add-on NSStringprovided by UIKit(look for "NSString UIKit Add-ons" in the docs).
sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:
NSString
UIKit
Source: https://habr.com/ru/post/1714216/More articles:ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΡΡΡΡΡ Π² g++, Π½ΠΎ Π²ΡΡ ΠΎΠ΄ΡΡ Ρ ΠΎΡΠΈΠ±ΠΊΠ°ΠΌΠΈ ΠΊΠΎΠΌΠΏΠΎΠ½ΠΎΠ²ΡΠΈΠΊΠ° Π² gcc - c++SQL - a query that is stored inconsistently - sqlChange Background Image IDE Visual Studio.Net 2008 - visual-studioHow to save a font in an inherited text box? - c #ΠΠ°ΠΊ ΡΠΎΡ ΡΠ°Π½ΠΈΡΡ ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ ΠΈΠ· CheckBoxList Π² FormView? - c#How to use NSCollectionView and Outlets correctly? - objective-cFunction name from offset? - debuggingDynamic method overriding or observation when calling a method at runtime? - c #Rapid Web Application Development with Web Toolkit - toolkitScala, animation and graphical user interface - user-interfaceAll Articles