Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stera8

macrumors member
Original poster
Aug 21, 2014
59
2
I want to update my app and need to create a view that users can draw in. The issue I have run into is that I need the view to be in the middle of the app and not on the top as if I was to shrink the dimensions. I located something on GitHub which is exactly what I need. I'm stuck on installing it.


https://github.com/acerbetti/ACEDrawingView

The directions are to

Import the files from the folder "ACEDrawingView" to your project
From IB create a view and set the class to "ACEDrawingView"
Programmatically use the initWithFrame: and add it as subview


I am stuck at this part:

Programmatically use the initWithFrame: and add it as subview

I am unsure how to incorporate this, I am testing it out on a blank project right now and receiving many errors. Hopefully with the last part it will correct all of it. Thanks for any help or advice you can provide
 
Please consider posting the actual text of the error messages. Copy and paste the text, rather than retyping it into a post.

It's difficult to diagnose the reason for errors without knowing what they say. Simply knowing the magnitude ("many errors") is rarely of any help.
 
Does your project use storyboards? If so you should do what he said: From IB create a view and set the class to "ACEDrawingView"
 
Did you #import ACEDrawingView ?

yes! :cool: but the solution is very very very close! You're warm

Please consider posting the actual text of the error messages. Copy and paste the text, rather than retyping it into a post.

It's difficult to diagnose the reason for errors without knowing what they say. Simply knowing the magnitude ("many errors") is rarely of any help.

Sorry about that. I was stuck at step 3 and thought I received the errors because I wasn't sure what to do that that point (I thought that is what caused the errors). Once again, sorry for the missing information.

Does your project use storyboards? If so you should do what he said: From IB create a view and set the class to "ACEDrawingView"

Yes! and this was also done. However, I researched the issues and I saw on github how there was an "issues" for each project. Missing from the code was that I also had to #import UIKit/UIKit.h to the ACEDrawingTools.h file

I apologize for the delay, busy week as a school teacher this week. Student vs staff basketball game tomorrow night! :p
 
So what you're saying is that there were compiler errors but you didn't tell us what they were.

Not #importing UIKit may be an error in that .h file but the standard precompiled header file #imports UIKit so it shouldn't matter.
 
So what you're saying is that there were compiler errors but you didn't tell us what they were.

Not #importing UIKit may be an error in that .h file but the standard precompiled header file #imports UIKit so it shouldn't matter.


Yeah, I'll show the screenshots below.

The first one is of the actual ACEDrawingView Demo which runs successfully without UIKit being imported in DrawingTools



I then used a sample project and brought in the files and when I ran, I received many errors such as:


After looking on GitHub, I saw that when you bring it into a project, you need to import UIKit. As you see below, DrawingTools does not have the UIKit



After importing UIKit, it runs
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.