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
Related
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.
I have noted recently that each of my app view has one particular bug/behaviour: if user taps too fast on a UI component when the view appears, the tap is simply ignored. If the user wait a bit before tapping, the tap works.
Storyboard is used for the storyboard, tap gesture recognisers are on UIImageview and using IOS 10.2.
Through different forums i have read about the following options:
nest the call of "present view controllers" in main thread
Call CFRunLoopWakeup before presentviewcontroller
Add programatically the TapGesturerecognizer
change the states of "delays touches end" and "delays touches began"
disable 3d touch option as similar symptoms was reported to happen in other apps
All above have been unsuccessful.
Anyone would have met similar issues with the first tap just after the view load?
[Update: I realise this misbehaviour is not specific to this app. Two tests to try:
create an xCode Project for iPhone and two view controllers Controller A and Controller B. Two buttons : a button on Controller A view to go to Controller B view and a button Back in Controller B view to go back to Controller A view. Tap to go from View A to B, tap back in B and try immediately to tap on button to go to B. First tap doesn't work either.
Go in Settings of the iPhone. Tap On Notifications. Press On Settings to go back to Main Settings screen, Tap immediately back on Notifications. If fast enough, first tap doesn't work. Second tap works or waiting a bit before first tap.
Question is now: this looks like a common problem across iPhone apps. Would you know if there would be a common setting somewhere? or is this a common bug for given IOS version ?
]
Stephane
This is a general problem (the moment when the view controller is changed, the first tap will be ignored), but this is not a bug that will happen only because the switch view controller's animation has not yet been completed. If you set the animation to false , then the view controller can immediately respond to your click, no matter how fast (anyway faster than your hand) :)
I want to segue between my view controllers the same way Apple's Clock app segues between the World Clock, Alarm, Bedtime etc. They just appear instantly, and most important of all, it doesn't instantiate new instances of the different parts (e.g. the Stopwatch and Timer keeps going after segueing).
I'm trying to prevent using a Navigation Controller, because I don't want a back button or anything to appear. I just want buttons that segue you to the other parts of the app without stopping timers etc.
If anyone could point me in the right direction in regards to this, I would appreciate it very much.
Maybe you want to use a UITabBarController?
See https://developer.apple.com/library/content/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/TabBarControllers.html
apple is using a UITabBarController over there
you can use that
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 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.