How to create a custom UIView that shows 5 stars - iphone

I have a requirement for a UIView that displays stars similar to the way one can rate albums in iTunes on the Mac and iPhone.
Does anyone know what it would involve to create this or whether one is available online?

Have a look at the TouchCustoms library. I'm pretty sure there's a star rating component for iOS in there.

I had it done it a couple of months back. It is very simple.
Subclass a UIView.
Add the 5 stars(UIImageviews)
Write a function to toggle the image of the stars
In the touches Began and touches moved method Check for the touch and accordingly change the images of the imageviews.
Also add a int variable that will have the current rating.(you can set the value whenever the toggle changes the images of the stars)

Related

labels on images in ios like instagram

In iOS 10 ( Swift 2) how would I go about getting a tag on an image like Instagram does in the pic below ? I want to get the 'topgearporsche" label and get it on the right object in this case - the porsche for an app I am building.
Thanks in advance.
This is pretty basic.
image.addSubview(label)
It is a lil complicated if u exactly want how instagram does it... U will have to make a custom view using uibezierpath... Place these views exactly where you want them to point out, like literally spoon feeding the cgrect (cgpoint and cgsize). Assign an uitapgesturerecogniser to show the views which were hidden in the beginning.... And then after a certain amount of time they should vanish which can be achieved using uiview.animatewithduration function... And hide those views again in its completionblock...

slide show with UIGestureRecognizer and with tap action

i am noob and new in development iphone application so i want to create a slide show(ios 5 with storyboard) ( banner with 5 or 6 image and every image the user can clicked on him and go to link in itunes for the app it's like a banner but no only one it's multiple )
i want the user can swipe between images and can click in every one and go to specific link so if on people have a tutorial or documentation or sample code for how to do this it's will be very helpful thanks
you can understand UIGestureRecognizers by some examples like these:
http://www.icodeblog.com/2010/10/14/working-with-uigesturerecognizers/
How to detect Swipe Gesture in iPhone SDK?
http://iosdevelopertips.com/event-handling/gestures-recognizers-tap-pinchzoom-rotate-swipe-pan-long-press.html
Best way is to use UIScrollView with paging, so you'll have to deal with only one UITapGestureRecognizer.
Take a look at the Facebook app's Three 20-framework for inspiration:
http://joehewitt.com/2009/03/23/the-three20-project
There is a fully functional slideshow-framework in there that you can look at and get some idea as to how you can make it on your own.
The TTPhotoViewController is the class you are looking for:
https://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTPhotoViewController.h

view based iphone development question

I am trying to develop and app that will display a number or text and the user will physically speek the said number or text then touch the number or text and a new window will show another number or text
and this will continue many times
how should i go about developing this?
Brian, first of all you should take a look at UIViewController Class Reference:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
This file will help you a lot, you'll know how to manage different view controllers, and it's basically what you need.
Second thing is: to touch the number or text it's OK, but to speak and your app recognize it, it's a little bit harder. I would suggest you to develop the touch control and after you finish with this, maybe you can start to study a way to develop the speakable control.
Third, as a basic model, you should think in instantiate an NSArray with the "right" content, I mean, the content that should be touched to go to next "step".
Create a button with this "right content" and for every touch in the screen you call a method to check if the touch was inside the right button or not.
You can use one UIViewController for each index of this array, or you can use always the same UIViewController and just change the words or numbers on the screen with some custom method.
Hope it helps.

how to activate the thumb of slider to work as a button?

I want to make the thumb of my slider to work as the button so that when a user done selecting the value and pull his finger up it should do something i want.
Is there any way to do this.
Thanks,
Hi,
Create this function
- (IBAction)mySliderUserFinshed:(UISlider *)theSlider
Make sure you add it to the header of you file.
The in interface builder, right click on the slider you want to act as a button.
You will need to wire up the Sent Event
Touch Up Inside to the function that you created. If you dont know how to use interface builder watch a few quick videos on youtube or in Xcode 4 there is a short guide on some of the new and awesome features of xCode 4 with very very cool videos (takes about 10mins to watch and will save you hours of coding).
Good Luck, John.

UISlider with sound effect and vibration

I need to do a lot of things with UISlider. First of all I want to know what are all the things are possible and what are not. Please give me ideas for the doable ones.
I need to add a slider control in my iPhone application (that should resemble the one which is displayed in the iphone when the phone is getting charged).
Can the round button of the UISlider be changed to any other shape. Can any image be added on top of that round button?
When the UISlider is being moved, we need ad a sound effect(for example car stating sound) and when the sliding ends the sound should be stopped. is this possible? if yes, please gimme ideas to do this. 3. vibration should also happen while sliding (possible?)
Thanks in advance!!!
All of these can be done via the public API. Read the docs :-)
The button is called the "thumb image"; there's a property to replace the image.
Assign a delegate and set the 'continuous' property on the slider.
See the Application Programming Guide for more on delegates.
As far as question number 2, just write up the methods to accomplish playing a sound and vibrating and then have them fire when the value changes on the slider.