I've been asked to see if I can make something similar to the sidebar that's available in the iOS-app made by Issuu.
It's basically like any other "hamburger" swipe menu, but the main content view gets a curly 3d-transformation while the view is being moved. My question to you guys is how this 3d-transformation can be done (which libraries/frameworks should I look at) and what would you say is best practice when drawing such animations while swiping?
Edit: Video of the animation: http://mrcs.se/ZUBp
Related
I'm building a to-do app in Swift as a practice project, and would like to make it so that when the user swipes from left to right on a task in the list, my "completed" boolean in the task becomes true. Similar how in the native Mail app, swiping right on an email marks it read.
I came across the onDelete() function provided by Apple that handles right to left swipes, but as far as I can tell there's no code for left to right swipes. I think that makes it ok to implement a left to right swipe, but I can't find any examples of how to do so in SwiftUI. I think this question was asked once on Stack Overflow here, but the answer only pertained to deleting and moving.
that called gestures and for swipe gesture you can see the documentation here - https://developer.apple.com/documentation/uikit/uiswipegesturerecognizer
and if you don't want to make it from scratch then you can use library for it and the kind of functionality you want go for this library SwipeCellKit here is link https://cocoapods.org/pods/SwipeCellKit with this you can easily make the kind of functionality you want.
iOS 15
You can define any number of actions with .swipeActionis modifier for either leading, or trailing side of the cell with the given view as the label and give them a tint color like:
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
I'm looking to recreate the functionality that's show in this video for the picture:
https://www.youtube.com/watch?v=zEREoIcoQHE
A long press is done, a view appears, and when the user swipes up far enough, the options come up at the bottom. If the user continues to drag up higher and then lets go, the main view animates to bounce back down to the middle of the screen. If the user swipes all the way down, the view animates away.
I recognize there is a lot going on here and a lot of different pieces and that this is a very broad question. I'm more or less looking for a place to get started with it. The only thing I really recognize here is I guess a scrollview. I know how to do all of the basic stuff with presenting and dismissing the different views, but the dragging and the scrolling and the snapping back into place is where I'm not sure where to begin.
Is that all just scrollView code I need to learn? For example I guess there's a way to detect when the scroll has been scrolled far enough up to trigger presenting the options view. What is making the view bounce back into place after dragging up and releasing? etc.
What tools are used to achieve this kind of behavior?
If I am not mistaken thats the "Apple's" 3D touch APIs magic ✨
Check out their documentation
You might be interested in :
ViewControllerPreviews: Using the UIViewController previewing APIs, which demonstrates peek (preview) and pop (commit), as well as peek quick actions
Reference: https://developer.apple.com/library/content/samplecode/ViewControllerPreviews/Introduction/Intro.html#//apple_ref/doc/uid/TP40016546
How should I go about creating a menu like in Hotstar, where one can make a half swipe on the menu below the navigation bar? I suppose using a container rather than carousel view would be more suitable.
I am including a Hotstar app screenshot to illustrate my intent:
NOTE:
I am not looking for frameworks implementing the drawer / side menu.
What you're looking for here, in fact, is a sliding tab bar. The philosophy of the UI element you describe is that it switches content (with or without animations - that's up to your preference/taste).
For start, I can point you to M13InfiniteTabBar or ZRScrollableTabBar but I'm sure there are many others (these are the ones I had the chance to try out). Both of them are implemented in Objective-C as you marked in the tags.
Of course they are not exactly what you showed in terms of design, but they aren't hard to customize.
Are you looking Like this side menu
https://github.com/mikefrederick/MFSideMenu
After wasting lot of time searching, I am finally posting this question, hoping I get an answer.
I want to have a widget in iOS, which has the similar functionality of Sliding Drawer in Android. (Like the bar at the bottom, and on pulling it, it shows up a new view).
Any help would be greatly appreciated.
Thanks
A few similar questions that might help you out:
Making a pull out tray - (iOS)
iOS: Sliding UIView on/off screen
I recently made a drawer container controller and put it up on Github:
https://github.com/saldavonschwartz/DrawerContainerController
While not exactly the same (you are asking about a vertical single view sliding up/down), you might want to download the code and take a look. My approach might as well work for what you are trying to do: basically, creating a container controller which can host another controller and its view and present its view in a custom way.
Specifically, you might want to look at:
-replaceContainedController:forIdentifier: for how you would go about adding child view controllers the 'Apple' way.
-didPanContent: and -translateContentContainerViewToPosition:animated:completion: for the sliding animation from input of a UIPanGestureRecognizer