How to draw inside a view in a UIScrollView or UIViewVontroller? - ios

I want to implement a signature feature in my tabbar application. I want to add a subView to a UIScrollView or UIViewController (which ever is the more appropriate and easier). Which control should I use for it?
I want to pick the touch events on the signature view and draw on those points to get the signature. Any help would be highly appreciated.

You can use just a UIView for drawing points get touched. I needed to implement something like that and the following page was really helpful. It explains all with code. You may want to check it out.
http://www.effectiveui.com/blog/2011/12/02/how-to-build-a-simple-painting-app-for-ios/

First thing you need to read is this - http://developer.apple.com
and check this apple demo - GLPaint
after that you may check this - tutorial

Related

How to implement Circular iCarosel?

I tried all the ways by setting the respective value's but i'm unable
get below one by using iCaurosel,or is there any controller which gives same functionality
? can you help me?
You should choose iCarousel type to wheel:
self.carousel.type = iCarouselTypeWheel;
but if you mean items margin, this is not possible:
https://github.com/nicklockwood/iCarousel/issues/306
Please check following sample. this is dynamic circles (views) you can add.:)
https://github.com/mpospese/CircleLayout
Happy coding.
You can achieve the same functionality by creating the custom circular UICollectionView layout.Please visit the following link to solve this.
http://developer.xamarin.com/guides/ios/user_interface/introduction_to_collection_views/
You can do this using carousel.type = iCarouselTypeWheel and then using the carousel:valueForOption:withDefault: delegate method to adjust circle radius, number of items shown, etc.
To position the circle off-center like that, use carousel.contentOffset.
You may find that the gesture handling is a bit weird though, because the pan gesture will still be linear even though the view appears circular.

How to load another UIViewController to a UIView Example Like UITabbarController

I have a 2 UIViewController(s), I need to be able to change the views at the bottom of the Airtime and Data Plan Upon tap gesture on Airtime and Data Plan!
The yellow line will indicate the active view controller. some thing like tab bar.
Perhaps, the image attached is an android version
Could anyone provide a help on how to go about this.
Thanks
I personally use a library called ICVIewPager
https://github.com/iltercengiz/ICViewPager
This is pretty simple and easy to use with examples. It should put you in the right direction without writing a lot of code.

Component in iOS to make a selector option

I wonder which component is being used to create a selector option like the one used in iBooks where we can adjust the Font Size and also the Theme, but without moving to a new view controller.
In my application I would like to implement it giving 3 small options to the user to choose, but without moving the view controller being presented. Its a small square area with an arrow at the bottom or top side giving the impression where it's coming from. (Let me know if I am not clear with the explanation).
Does anybody know how to use it??
Thank you all in advance
ibooks is using UIView. In that UIView you can add any controls you like. You need to use delegate methods so that I can perform communication between two objects(send message to another object). You will be able to make you custom UIView as controls.

Custom Scroll view in cocos2d without using uikit

I currently need to create a custom scroll view without using UIKit's scrollview in cocos2d.
The best way, I think, is to create a separate layer and then add all my sprites to that layer. But I'm not sure how to receive touch events for all of the sprites. Is there a best way to do this? Thanks!
Have you seen CCScrollLayer? It might not be suitable for you but maybe you can copy the way that it is picking up touches.
https://github.com/cocos2d/cocos2d-iphone-extensions/tree/develop/Extensions/CCScrollLayer
http://www.cocos2d-iphone.org/forum/topic/17118
There's another one here as well, not sure if it's a fork or an independent one:
https://github.com/jerrodputman/CCKit
But I didn't have much success with any of these. The bounce and other parts of the experience never feel right, so I go back to using UIScrollView to handle the touches.
I've been facing the same issue and I found the SWScrollView here:
https://github.com/saim80/Cocos2D-Extensions
met my needs better than CCScrollView. It acts more like the UIScrollView where as CCScrollView is more for paging from what I've seen.
There is a nice framework called CMMSimpleFramework.
http://www.cocos2d-iphone.org/forum/topic/39018
http://www.cocos2d-iphone.org/forum/topic/60354
There are some sample videos, and the link to the repo is on those pages.
One of the classes is a scrolling layer that might do what you need.
To get the sample project to run, I had to comment out some game center authentication handler code that has changed, but after I did that the demo worked fine.

Can I obtain a valid CGContext for drawing with just a #synthesize UIView dropped into a view controller view

Thank you in advance for any help, I am building a multipage iPad app,and each page has specialized calculations, they all work great, but i would like to make the user experience better with some simple line drawings that represent the calculations, I am comfortable with the drawing once i get a valid CGcontext working, and this is where my problem is. I already have a webview on each page and now I want to have a UIView pop open with my drawing when the user presses the calculate button, My UIview is called drawingView and it will pop open like I want but from what i have read all drawing needs to be done within the DrawRect method in order to use the correct context. I think some of my problem is the syntax for getting the context.
Thanks for any help
Norman
Ok, I had to do what I wanted the old fashioned way, but it just seems like you should be able to get the current context of a UIView from wherever I want. By calling the view and getting it's current context. But when I do ,I get errors about not getting the current context. So, I have to make my app differently using traditional UIViews classes and bringing them into my page.

Resources