Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:34:14+00:00 2026-05-26T14:34:14+00:00

I’m looking for a canvas-like element to use in iOS apps. By canvas-like I

  • 0

I’m looking for a “canvas-like” element to use in iOS apps. By “canvas-like” I mean that I want a surface on which I can draw basic shapes such as rectangles, lines, text, or images. I do not need 3D or other really advanced stuff — rectangles and other images would be enough, text can be stored in images if required.

I can’t imagine that no such API is available, but how do they call it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:34:15+00:00Added an answer on May 26, 2026 at 2:34 pm

    With UIKit, everything that the user sees and interacts with is essentially a view. For instance, a button is a view, a table view is a view, etc. Your application should already have a main view controller, or a main window, which can contain zero or more views. You can draw on any view that you create, as long as you are in the position to implement the drawRect: method. Here’s an example of implementing a UIView subclass on which can you can draw using CoreGraphics:

    @interface MyView : UIView
    @end
    
    @implementation MyView
    
    - (void)drawRect:(CGRect)dirtyRect {
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextSetRGBFillColor(context, 0, 0, 0, 1);
        // here, you can draw shapes, for example, a circle:
        CGContextFillEllipseInRect(context, CGContextMake(10, 10, 50, 50));
    }
    
    @end
    

    Then, in order to add an instance of MyView to your application, either drag in a custom view in interface builder and change its class to MyView, or do this in viewDidLoad of your view controller:

    - (void)viewDidLoad {
        MyView * aView = [[MyView alloc] initWithFrame:self.bounds];
        [self.view addSubview:aView];
    #if __has_feautre(objc_arc) != 1
        [aView release];
    #endif
    }
    

    You can learn more about what you can do in the drawRect method from the Quartz 2D Programming Guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.