Gmail iOS Modal View Transition - ios

Just wondering if anyone have tried to replicate the transition that is used for presenting modal views in Gmail iOS? It looks darn gorgeous and refreshing from the pop up from bottom animation.

Pretty sure you're referring to the push-back transition when displaying the modal view controller? If so, then it's the one that the National Geographic Park Guides app first introduced and someone has released their replica of it over on Github. This one is only a partial screen modal, but could be modified to mimic the full view that the Gmail app does.

How about using this? Detailed animation, there is a need to develop a little more.
https://github.com/ucu072/HCPushBackAnimation

I created a UIViewController category to mimic this type of modal animation. It is called MFFadeBackModalAnimation. It wraps around the native API for presenting and dismissing view controllers so it should integrate well with your existing app.

Related

Swift UI with MVVM architecture navigating screens in complicated apps

How can I navigate from one screen to another screen in Swift UI app , I am trying to implement MVVM architecture in my app and I have more than 20 screens so NavigationLink is not suitable in my case .
Thanks in advance .
I quite understand your problem, previously we had a central navigation controller (UINavigationController) we could call it anywhere and do a push or pop, but now only the current view can do a navigation using NavigationLink, I faced the same problem and the solution was to implement an UINavigationView in a sigleton and call it anywhere I want to push a view like MyNavigation.push(UIHostingController(rootView: NextView())).
Anyways, I think this approach is wrong because a new UIHostingController is created for every screen, so we lose some of the optimizations introduced by SwiftUI. If you really want to use the powerful features of SwiftUI I recommend you to redesign your app to adapt to SwiftUI capabilities

Apple Watch: Status bar not visible after presenting a modal screen from page based navigation

When i present a modal screen from a page in page based navigation, the whole screen shifts up and the status bar is no longer visible.
Here is a gif of the issue:
I am using xCode 6.2 version.
This was not happening in xCode 6.2 Beta 4..
I am not sure if this is a simulator issue or this will actually happen on a real device too.
Does anyone have the same issue? Is there a workaround?
I reported a bug to apple (20109240) and it was marked as a duplicate of (19862945), and that one is still open.
Thanks in advance
This is a known issue in the final release that exhibits itself in two cases:
When presenting a second modal controller (paging or single) over an existing paging modal controller
When presenting a menu using Force Touch over a paging modal controller
This has been discussed in the Apple Developer Forums, and the only workaround I've heard about is one that I use in my app. Unfortunately, there's no simple code to share that solves the problem, so I'll describe the approach (which I'd consider messy, but workable).
First, you need to keep track of interface controller presentations. I have a framework for this, but you may have to roll your own. When a child interface controller has its willActivate called two times in a row (in other words, without a call to a different child interface controller) you can assume that a modal was presented/dismissed on top of it.
Your presenting/parent controller can then inform all children that the modal menu bug has happened, and those child controllers can unhide a replacement status bar with its own Cancel/Close button. With some work, you can recreate a pixel-perfect version of the standard status bar with identical behavior.
The final twist is to detect when your Watch app is suspended, then resumes. In that case, willActivate is also called twice. If you don't handle that situation, you'll end up unhiding the replacement status bar and have two on the screen simultaneously. Not a great scenario.
Getting this right is very tricky, but it does work. I just wish I had a simple code sample that you could inject.
Update: I pushed some of my workaround code to GitHub: https://github.com/mikeswanson/JBInterfaceController

Floating view (like in the Apple stock mail app)?

I would like to implement a floating view into my iOS app. Something like the one in Apple´s stock mail app on iPad when you write a new mail or the one you see in some apps as introduction (with the ability to be a fullscreen view on iPhone). Unfortunately, I cannot find any tutorials (maybe because I´m not sure if they´re really called "floating views"?). Does anyone know a good tutorial or a simple code fragment? thx.
The Mail compose UI on iPad is an example of a view controller being shown as a modal view. You can get this style by presenting a view controller modally using either the PageSheet or FormSheet style.
You could simply place a UIView on top of your currently showing view. If you place it correctly you should get the desired effect. The animation likely comes from [UIView animateWithDuration... or some UIKitDynamics

Scrolling app: UIPageViewController vs UIScrollView

I am working on an app in which there are several screens and each screen has the same layout, just different data passed in, then I want the user to be able to swipe from one screen to the next.
So far I got something working using the UIPageViewController project template using the transition style UIPageViewControllerTransitionStyleScroll. What I have done so far works ok, although its resource intensive because it instantiates a new view controller each time I swipe to a new page but I am loooking into working around that.
The thing I am concerned about is that it is not strictly a page application in the sense of ibooks so even though I am able to make it look like a scrolling app, using the transition style setting, I wonder if there is a reason why people seem to only use this template for book type apps, unless I am mistaken
Also there seems to be an alternative approach of using a UIScrollView and PageControl to do similar functionality
http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html
I am not sure which approach is better to solve the problem I am trying to fix, so am looking for some feedback. Each page will need to be a separate instance of a view controller as there are several elements to display on each page.
Using UIScrollView is much more difficult. If you're targeting iOS 6 you should almost certainly use UIPageViewController. If you're targeting iOS 5 then UIPageViewController might not be perfect because the only page transition available is "scroll" which looks like a page flip.
If you're worried about the resource usage, you can reuse view controllers.
See the WWDC 2012 session 223:
https://developer.apple.com/videos/play/wwdc2012/223/

UISplitViewController like mail app

I want to make my application similar to mail.app in vertical orientation. It should show a master view controller by button, but not in pop over and in horizontal orientation it should look like a simple UiSplitViewController.
Have you any ideas? Is there any usable open source projects which could be re-used?
Mail.app is using a standard UISplitViewController. The behaviour was changed in iOS 5 so that it no longer uses a popover, but instead slides in the master view controller from the left. Although technically I guess you can still call that a "popover".
This may be confusing because the documentation and delegate methods still refer to a popover controller, but if you create a blank split view project from Xcode and run it on an iOS 5 device or simulator, you will get the new behaviour.
Try MGSplitViewController - very useful alternative to the UISplitViewController, has some nice configuration options.

Resources