I want to use 3D touch to navigate to a menu like in the contacts app or apple music. I have created a custom view controller for this however I don't want to use
-(UIViewController *)previewingContext:(id)previewingContext viewControllerForLocation:(CGPoint)location;
because the buttons won't be available to click until I pop into the ViewController.
I guess the alternative is to use
-(void)previewInteraction:(UIPreviewInteraction *)previewInteraction didUpdatePreviewTransition:(CGFloat)transitionProgress ended:(BOOL)ended
and navigate to the ViewController when I get the ended parameter is true.
However I am unsure how to create the blurring and scaling effects manually.
Related
Im a little bit curious : I wondered how did Apple made the transition from the home screen of the Find My iPhone app to the detail controller. I need to use this kind of transition for my app, but I'd like some insights before digging in.
When you move the view or select a device, it actually pushes a detail controller (without animation) but there is no transition on the mapView and no delay on the map tiles. My guess is that they should use a single instance of the MKMapView and move it along between the controllers, but maybe there is another way.
Any idea how would you do that?
Thanks.
I want to enable peek preview en my table View, but i don't want the user to actually navigate to the destination VC. I just want to let him peek, but not navigate into it.
I found a solution to this question.
The VC needs to implement the UIViewControllerPreviewingDelegate protocol which handles the peek and pop behaviours.
I have a weather app. I let users add new locations which means there should be a way for the user to view the weather data for the new location. Right now I have 1 ViewController which handles a swipe gesture. If the user swipes right/left new data appears until they run out of locations. The problem is I have no transition. I want to add a transition animation to mimic a slide animation transition that there normally would be while moving from ViewController A to ViewController B.
I don't know how to go on and implement this.
You really should use a UIPageViewController as #HAS told you before. Here is a good link to start with: iOS 7 UIPageViewController
Basically apple's weather app uses the exact same thing.
Here is what you are looking for.
https://github.com/comyarzaheri/Sol
I was wondering what is the best way to implement a countdown screen before showing the user the game view. For a more detailed example, I want the user to see a screen that displays 3...2...1...GO ! and than the game will appear.
Currently in my application I am using a navigation controller as my main menu where you can select multiple games to choose from. When a user selects one of the game buttons this is where I want the countdown screen to appear before my game interfaces does.
Solutions that I have thought about:
1) should I implement a new view controller that i push on the navigation controller to perform the count down ( seems like a waste)
2) is there a way to blank everything on a view and show a countdown first?
Thanks in advance for your help and cooperation !
Ryan
The best way i think is as soon as user selects a game, add your 3..2..1. Go screen on the same view..as soon as u present this u can also start preparing to create your game interface(but do not present). After GO appears, remove this countdown view and present your game..
It depends on the effect you are after. If you push a view controller onto the navigation stack, you'll need to use a pop transition.
My suggestion would be to open the game view controller and put a full-screen sized overlay view on top of it with your countdown message. Have the game VC manage the countdown view. When the countdown is complete, you could fade it, shrink it to a point, do some sort of clock wipe or keyhole animation, or whatever you want, easily and simply. (Some things are obviously easier than others. Cross-fades, shrinks and the like are trivial. clock wipes and keyhole transitions are much harder and require pretty advanced Core Animation skills.
What platform will this be for? For a full screen overlay I would try UIPopoverViewController if on an iPad. Otherwise, try a view controller presented modally. I believe you can set the transparency of either type to less than 1 so the underlying view shows through. In this case it would be nice to display the selected game's opening screen during the countdown. Of course it would be dark because of the overlying view. But it would provide a glimpse into what is to come.
I currently have my app setup to receive push notifications. When I am in the app and I receive a push notification, I have a custom UIView slide down from the top of the screen and displays the notification (similar to the new version of Whatsapps). Essentially I am trying to mimic the banner style notifications in iOS 5.
What I am looking to do now is have that UIView clickable. When clicked, based off of the type of notification received, will bring me to a different view controller (similar to how whatsapp does it).
For example, I am in chatroom A. I receive a message in chatroom B. The slider view comes down, I tap that and it brings me to chatroom B. In the push notification I am essentially passing the chatroomID which I can use to identify which room (essentially some view) I would like to join.
I have a root view controller setup already with a navigation controller as well. I am modally pushing other view controllers as the user navigates throughout the app. Would I dismiss the current view and push the next view when receiving a notification?
Also how would I go about making my slider view detect taps like the iOS banner notification? (and maybe have a selected animation, similar to the "grey clicked style" in a UITableView)?
Here's a trick for detecting a tap on a view: Use a UIControl instead of a UIView (UIControl is a superclass of UIView). Then use the UIControl's addTarget:action:forControlEvents: method with controlEvents of UIControlEventTouchUpInside to send the object of your choice a message when the view is tapped. If you're configuring the view in Xcode's graphical editor, you can use the Identity inspector's Class field to change the class of your view from UIView to UIControl, and then you can configure the Touch Up Inside event.
(I learned this technique from iOS Programming: The Big Nerd Ranch Guide by Conway and Hillegass.)
You could very easily present a clear button over the view with an "if" statement that matches your criteria and perform a view animation from there with the transition back to the other view.