Draw and Erase on ImageView using UIBezierPath - ios

I write this link's answer code to create ImageViewLayer and Imageview.
StackOverflow Link
This link gives me the below result.
It's work fine .But I want ,when user press the original button... and then touches with finger it remove the clear area ang fill with the previous one.
And how to create Undo Functionality for this..If any question regarding this please add your comment..Please help me...

how to draw CALayer with line path like simulate eraser effect?
this is the post i get the answer. there is a sample code about the effect.
what you are different is change the gray color layer to be the "paper imager"
hope it help you

Related

Rotate Icons in a circle by finger

I have a project having the home page like the attached image and need to implement the following functionality.
Home Page slides in left to right
Functionality of this is the icons rotate in a circle by finger
Sliding once user clicks on an icon they will be directed to the page.
Pls help someone, if you have done such things.
Regards
CJ
Following is the Custom UICollectionView Layout may help you to best fit your requirement.
Download the source code and reference from here.
Take a look at a library called iCarousel by Nick Lockwood. (Available on Github.) It is very configurable and will give you exactly what you need with very little custom code.

UIControl subclassed for making drawing tool in iOS slides while drawing for the first time?

I am having a problem while using something like a DAScratchPad. I had this problem while drawing a line. The initial point is not moving properly and the below problem occurs when I draw the line for the first time:
In the above image I was trying to draw a straight line but after touches moved this happened. This also happens everytime after the orientation change.
Kindly help me to resolve this. Thanks in advance.

How to draw an editable line in iOS app?

I am developing an app which enable users to draw a connection between different components, I tried to use CGPath to draw a line. But the problem is, the line is not an object which I can not reference it later or edit it.
Since I want to enable the app to create a line when two points in screen is touched, and can delete it if need by touching the line, do you have any good ideas to implement this?
Thanks very much!
I think you're looking for CAShapeLayer. You can change its path property after it's been added to the layer hierarchy and it will update accordingly.

Rounded buttons in XCode 4.6

I have been looking for an answer to this question on google and other places, but have not found a helpful answer as of yet.
I am making an app on Xcode 4.6 using storyboards.
When drag and drop a Rounded Rectangle Button, it is fine, but when I change the background, it becomes rectangular with no rounded edges. i just wanted to change the colour of button and not anything more, but keep it rounded as the original buttons. Could someone tell me a simple method to achieve this or give me a detailed instruction as I am using storyboard and I am rather poor with XCode programming, so the little the programming, the better.
Thanks in advance.
You probably should check the UIAppearance Protocol documentation for iOS.
Meanwhile, you can use...
[[UIButton appearance] setTintColor:[UIColor redColor]];
of course, with your color.
UPDATE:
I have used an alternative method as I do not understand the suggestions which were given to me as I am not as knowledgeable about XCode programming and didn't want to take the coding route.
This may be useful for others, but what i done was that I in Photoshop, I filled the background black, used the rounded rectangle tool on the whole background and then filled the rounded rectangle with the button colour. This somewhat gave a rounded shape, but is still not as good as the original rounded buttons provided in XCode.
If anyone has any other solutions, I am free to try them out and will comment and update what I will do.
I will select the best answer by looking at which one was the simplest although I have not used that method
I suggest you to use GradientButtons
http://code.google.com/p/iphonegradientbuttons/downloads/list
1) Define regular buttons in your storyboard files.
2) Change their class to GradientButton.
3) If you want a different color, initialize them in the corresponding view.

iOS draw circle on navigation bar

I have a navigation bar on the top of my screen. Is there a way to draw a small green circle? I'd like to be able to enable/disable it.
Use CGContext to draw a circle at a specified spot
Watch http://www.youtube.com/watch?v=7aMb8xEx660 , Demo starts at minute 53
Demo Source: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/sample_code/Happiness_0.zip
Lecture PDF: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/Lecture%205.pdf
Sorry for not answering the option to enable/disable it. I don't really know how to do that.
Maybe you can use a view which you put that circle on, and then you can load/unload it whenever you want :)

Resources