CGContextShowTextAtPoint deprecated - what shall I use now?
Solution 1
You can use [yourString drawAtPoint:aPoint withAttributes:dictOfAttributes];
Docs for that here.
Or you could just add a UILabel
to your view hierarchy.
Solution 2
//begin graphic context
UIGraphicsBeginImageContext(imageSize);
//get the context for coreGraphics
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetTextDrawingMode(ctx, kCGTextFill);
[[UIColor blackColor] setFill];
[@"yourstring" drawAtPoint:CGPointMake(0, 0) withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Helvetica" size:17]}];
//make image out of bitmap context
UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext();
Related videos on Youtube
06 : 24
The 'CodeMaidPackage' package did not load correctly Error Solved Visual Studio | Tutorial4You
01 : 04 : 07
CppCon 2015: Scott Schurr “constexpr: Introduction”
59 : 29
High performance graphics and text rendering on the GPU for... - Geller & Sermersheim - CppCon 2019
01 : 09
The called constructor method for WP_Widget is deprecated since version 4.3.0 - PHP
34 : 41
CS45 - (ASP.NET Core 02) Middleware và pipeline luồng xử lý HttpContext , lập trình C# .NET
06 : 56
Deprecated Error Required parameter follows optional parameter in WordPress and Php Script-Live Fix
03 : 58
Fix: An endpoint configuration section for contract could could not be loaded because more...
09 : 29
How to access HttpContext inside the service class in .Net Core
20 : 25
23 : 23
Designing an RPG book? You need STYLE
01 : 02
Why is mime_content_type() deprecated in PHP - PHP
08 : 10
Deprecation Notice: Function get_magic_quotes_gpc() is deprecated (PHPMyAdmin)
01 : 17
Django translations and gettext The deprecation of the % (string interpolation) operator - Django
01 : 12
iOS : CGContextShowTextAtPoint deprecated - what shall I use now?
01 : 01
Showing Deprecation Warnings Only for a Specific Version When Testing Django - Django
01 : 15
Is there way to check feature deprecation against django version - Django
01 : 27
Caching queryset choices for ModelChoiceField or ModelMultipleChoiceField in a Django form - Django
01 : 04
The context_instance argument of render_to_string is deprecated - Django
Comments
-
The following will be considered as deprecated in iOS 7:
CGContextSelectFont,
CGContextShowTextAtPoint.
What should I use instead?