I want to create a UIImageView having 4 sides with 4 different images,and if user swipes on visible interface of UIImageView i t should show next face of the cube with different image.
it Should allow left swipe and right swipe.
final image should be like this.can any one suggest me code or any tutorial links to create like this.where should i star..?t
I think you could modify this to work:
https://github.com/augustjoki/CubeTabBarController
It has the animation code in it at least. You could start by altering it to use gestures to trigger the animation.
Related
Using Swift 4 in XCode, I have several image views on the screen. I have added a gesture recognizer to one, and am able to move that image around the screen with a pan action.
What I'd like is that when I move that image NEXT to another image view on the screen, it "snaps" into place right next to it. (imagine magnetic lego blocks - and when one gets close to the next one, it snaps and attaches) -- as opposed to, say, being able to drag the movable image on TOP of the static image.
Can anyone guide me toward an answer, as I don't know what this concept is called.
(I'm not really trying to use animation, as it should only move based on a user's swipe.) Any tutorial links would be appreciated! Thanks!
Wondering if the above can be created using UISlider? If not, what other ways can this be accomplished?
You can set components of a UISlider, such as the currentThumbImage ( see: "Appearance of Sliders"1).
However, it is almost certainly easier to just re-implement a slider for this much customization. Simply use background UIImageView with the scale image, and then add a separate UIView (or UIImageView) for the arrow. Finally, attach a UIPanGestureRecognizer to the arrow view to allow a user translate the view vertically.
You can change a lot in the appearance of a UISlider like setting the thumb to a red arrow. You can also replace the background image with the inches ruler and with different rulers for the different device types and display sizes.
The one thing that I don't see is that you turn the slider to work vertically. I know them only working left to right.
If I'm right, your only chance is to have a ruler as background image and a view that contains the arrow and a label with the actual value. That whole view can be pawned and tapped using Gesture Listener.
I have this design here : http://imgur.com/XHMBUdj
I would like to allocate the left half of the screen(splitting vertically) to panning up and down for the blue bars and allocate the right half of the screen(splitting vertically) to panning up and down for the red bars.
I can already use UIPanGestureRecognizer, however, I just need help making the region in which if the user pans on the right side of the screen, "this" happens and if the user pans on the left side, "this" happens.
A friend of mine recommended using UIBezierPath. Could someone help me out? Code will be much appreciated!
I looks like it would be easier to have two UIPanGestureRecognizers.
In your view, you can add a subview that take up the left half on the screen that contains the blue bars and the microphone and add another subview that is on the right half of the screen containing the red bars and the music icon.
Then you can create two separate UIPanGestureRecognizers and add one to each of the views. Then each side will have its one recognizer that will take care of the side detection for you.
I'm trying to create a UISlider that will have the ability to drag upwards, and to the right. Think of the slider looking like a capital L with the slider thumb-button positioned at the bend after each slide action is performed.
I've looked and found this: UICircularSlider
But it seems too much for what I need done. I'm not sure UISlider is the way to go, but it's what comes to mind for easiest functionality.
Is there a way to do this?
Going with 3rd party libraries is definitely one way to go, but the normal way using all the normal objective C components would be having 2 UISliders, rotate one of the 90 degrees using CGAffineTransformRotate. Then you start the second one as the other one ends and hide the ThumbImage on the first one so it kind of gives you the feeling that they are continues. Once again, this way definitely is not a tidy way to do it, just no headaches of working with new libraries.
P.S: You can make your own subclass of UISlider and implement this in that class, so you can reuse it if you needed it again.
Here's my suggestion:
Make 2 sliders, rotate one 90 degrees and hide the thumb.
Add a gesture recognizer to the horizontal (active) slider's thumb image and set the direction to UISwipeGestureRecognizerDirectionUp.
At an up swipe event, show the vertical slider's thumb and hide the horizontal slider's thumb.
On the downside, this method doesn't report the vertical location, so you might wanna use UITouch, call the locationInView method, and update the thumb frame accordingly. Beats the purpose of using a slider, but achieves what you're trying to achieve.
U can make 2 view to make it.:
bottomview that detects rotate gestures
topview with image of circular slider in that
Example of control : https://github.com/nathanday/ndrotator
I want to make Credits in my application, so I make that as an image and I am using UIImageView. I want to make that image scroll up from bottom unseen until all image finish and repeat again infinitely.
I can do that with cocos2d but now I am not using cocos2d and only use UIImageView.
Please share some code...Thanks in advance.
Stick the long image into a UIScrollView and animate its contentOffset. Repeat infinitely. If your image is very large, it might be a good idea to split it into several small ones and insert them consecutively.