Pretty user-interface with animated segue in Swift - ios

I want to make a pretty interface. So after reflexion, I decide to make a pattern with to axes but with some essential points. The red screen is the primary screen, all start by this one.
We can only make this two move : red to another color and another color to red. And change are made with GestureRecognizer.
I also want to switch view by seeing the two at the same time. Obviously, it's following my finger and I can stay in this state.
Do you think that 5 viewController witch are all load at the start and we came to these with pretty segue (maybe custom) is possible ? And if yes, do you have an idea of how to make this ?

As a first thought I think you want to make a custom view controller navigation controller. Like UINavigationController, UITabBarController or UIPageViewController.
I'd also use a scroll view over a gesture recogniser maybe?
Either way it's gonna be a lot of work which means there are many many different ways to do it.
It sounds like you have a decent idea of how you want it to work. Give it a whirl and see what happens. I reckon you can have a decent bash at it.
If you get stuck let us know and we'll try to help :)

Related

Add same NavigationBar on every page in swift

I recently try to develop an application in swift and wanted to make a navigation bar which is the same on every single view.
I tried different approaches. The best one so far was a solution from another stack overflow-question you can see here
The solution from Jacob King works for me, but because I am relatively new in Swift, I am concerned if his approach would add a second, third, fourth,... navigation bar every time I navigate between two views, which both inherit the navigation bar? And if that is true, how can I solve this problem?
Thanks for all efforts in advance.
From the looks of the code, he says you would need to declare each ViewController. In his case, when he taps the open search button the code would execute the open search function, so from the looks of it it would not create infinite amounts of navigation bars. Remember in the future after implementing your code you can always build and run your application to test things like these to make sure I’m right. It never hurts to try! - Colin
you have to create a viecontroller class with a navigation bar and then all the viecontrollere you will have to put
miaviewcontroller: viewcontroller_with_bar

Which control should I use to display an ActionSheet-like view at the top of the screen?

I was asked to display a list of three options for the user in a View sliding from the top to bottom. They say it should slide from the top because the action is initiated from a dropdown-like button on the navigation bar.
Most of what I found on that subject mentions the deprecated UIActionSheet class.
The "new" way using UIAlertController doesn't seem to allow us to change position of the view. At the least from what I've found.
The end result I'm trying to get can be seen on the image below,
From what I've learned about iOS programming, one method I could think to achieve that would be to create a new UIViewController and to use a custom class to control the transition. But it just seems so much. And I think it wouldn't not look like a dropdown afterall.
The other option would be to create the TableView with options and leave it on the Controller where it should be displayed, configuring its height to zero. And then Animating when necessary. I also have such a bad feeling doing it this way.
Is there a right way to do this on iOS? Does one of the options I've found seems acceptable?
Thanks.
Following the suggestion given by #Losiowaty on the comments, I started looking for a custom View/Control on cocoapods and ended up finding quite a few that did what I was looking.
The one I decided to use is this:
https://github.com/lminhtm/LMDropdownView

3dtouch to present(peek without pop) UIView like contacts app

I'm trying to implement 3D Touch feature that presents a summary of information (like Peek). But I don't want that it pops. I just want to preview the information like contacts app does with contatcs:
It only presents an UIView and doesn't deal with two levels of force (peek and pop).
How can I do something like this?
Ps.: I don't want to deal with long press gesture.
Introduction
Hello
I know this is a bit to late, probably, but in case someone else stumbles upon it: I certainly believe it is possible and I don't think its a "native behavior for contacts". Although it would not be as simple as the UIKit api for peek pop views. You would need to:
Steps
subclass UIGestureRecognizer (perhaps it may work with the UITapGestureRecognizer also), and register UITouches and use their force property.
Setup a UIViewController with transparent but blurred background around the edges (together with a modalPresentationStyle .overCurrentContext if i recall correctly), with your desired content in the middle (much like the peek view). Then add a UIPanGestureRecognizer to the center view for dismissal/sliding up the buttons.
And then create a custom animation transition for that UIViewController to be triggered once the force property of the registered UITouches from the subclassed UIGestureRecognizer is high enough. And then reversed once the force property gets low enough.
Concluding notes
I believe this is a bit of a tedious task and there might be a simpler way. For example, a simpler way using a 3rd party library for long pressure gestures (that registers size of the touch), but it would not give the same feel.

How to load another UIViewController to a UIView Example Like UITabbarController

I have a 2 UIViewController(s), I need to be able to change the views at the bottom of the Airtime and Data Plan Upon tap gesture on Airtime and Data Plan!
The yellow line will indicate the active view controller. some thing like tab bar.
Perhaps, the image attached is an android version
Could anyone provide a help on how to go about this.
Thanks
I personally use a library called ICVIewPager
https://github.com/iltercengiz/ICViewPager
This is pretty simple and easy to use with examples. It should put you in the right direction without writing a lot of code.

How to make SWTableViewCell swipe more sticky

I've implemented the SWTableViewCell code in order to allow side swipes to reveal more UI, such as buttons.
Which is working fine, except that the UIScrollview it subclasses is really just too touchy, flicking back and forth like a manic game of ping pong.
I went to make changes to the class, but realised UIScrollView didn't seem to give me the ability to say change the way the scrolling animations work in the way I wanted.
Leaving me thinking that I either need to create my own version of the a Swipe cell, with a pan gesture and a overlay view, instead of a scrollview or find someone who has already solved this problem.
Please check it out sample: https://github.com/runmad/RMSwipeTableViewCell
May be it will helpful to you, Sir
:)
Not sure if this will give you the effect you desire, but you can make it less "jumpy" by altering the decelerationRate. Try:
someScrollView.decelerationRate = UIScrollViewDecelerationRateFast;
If that's the right idea, you can jump-to-definition in Xcode, and checkout the float value, then try your own.

Resources