Ios collapsable and expandable bottom sheet - ios

I have used bottom sheet behavior in my android project.What is the alternative of bottom sheet behavior in ios? Can you help me about this?
is there any material component in ios like this?

Hi there is so single component on iOS for the same.
Although, you can have two workarounds for the same
First you can make a UIView subclass call it CollapseView and design the view as you want your collapsed bottom view to look
Second you can make another UIView subclass call it ExpandedView
On tap of CollapseView hide it and show ExpandedView and vice versa
You can use animation methods for the hiding and showing
That will give the required collapsing and expanding effects.

Related

Creating a collapsible navigation bar in iOS

I wish to create a collapsible navigation like the one shown in the video linked below (the screen cast is for the android version of the app).
screencast
I'd like to know what classes I should use to accomplish this effect. Also note that the tagline "I am the founder" can vary in length so the expanded layout can vary in length. How would I be able to size the expanded nav bar dynamically (the only example I found had static sizes for the expanded and contracted states)?
Cool question. The best way I can think of would be to not use a navigation bar. Best would be to use a UITableView, have three cells, as shown here:
When the user scrolls and the top cell disappears, you can animate out the second cell as shown in the video using custom animation and viewWillDisappear (tableView protocol function).
Then have a fourth cell you design that appears. This fourth cell is the navigation bar that the user sees after scrolling. Keep this cell at the top until the user scrolls to the top.
Hope this helps!
For this purpose, you can use 3rd party cocoa pod. The link is given below.
https://github.com/vicentesuarez/Swift-FlexibleHeightBar

Swift: Dynamic UIView that pushes UIViews below it after a resize

What I am trying to is emulate the effect of the Jquery .slideDown() effect in Swift for an iOS app.
-I need a UIView to auto-resize based on the length of the text in it.
-The UIView needs to push other UIViews below it down.
-There needs to be a button above the UIView or on it then when tapped will cause a "Slide down" (Showing the extra text and expanding the fit the text). After re-tapping the button the UIView will resize and the text will be hidden.
Below is a GIF of the Jquery .slideDown() effect I would like to mimic in Swift.
Is this possible? Do I need to import a library?
Is this possible?
Yes this is possible using autolayout. Here is a great tutorial on how to get started with autolayout. Here is a brief tutorial on animating autolayout constraint changes. If you setup your constraints properly you should be able to do something as simple as:
myLabel.sizeToFit()
and the requested changes will happen.
Do I need to import a library?
No external libraries are needed. You can however look here to see if something similar exist.

Change content of UICollectionViewCell during interactive transition

I'm playing around with UICollectionView interactive transitions.
The very basic implementation is here.
Now I'm a bit stuck with Cells transitioning.
The idea is to change content of cells simultaneously with interactive layout transition.
Here is how it looks now.
The first layout
And the second layout
When transitioning is finished, I want to change content of cells on second layout.
1) Text label "Some label" should disappear from every cells
2) Text label "Another label" should appear on the right corner of each cell.
Key issue is I want this changes fade in/out according to UICollectionViewTransitionLayout.transitionProgress value during transitioning.
Something very similar implemented in Facebook Paper App.
Take look how content of cells is changing below (click on it).
Is anybody know an elegant way to replicate this effect?
This library will help you achieve what you are trying. If you are interested in custom animations I would suggest you use FB pop library
Well.
The solution is to subclass UICollectionViewCell.
Subclass should contain two UIView. One for big layout & one for small.
Initially UICollectionViewCell shows only small one.
Once we starting to update UICollectionViewTransitionLayout.transitionProgress for example from small to big we should do following steps:
Make an UIImage from big UIView
Put this image above small UIView
Set alpha of the image to 0
Continuously change alpha of UIImage to UICollectionViewTransitionLayout.transitionProgress value
Once transition is done just switch this to UIView
When you transitioning back you should switch big with small.
Done :-)

Creating a fixed footer in viewport in iOS

I want to create a footer fixed to the bottom of the viewport in an iOS app I'm developing (it's my first one, I come from a web dev background). However I'm having difficulty finding information on how to go about this.
What I have in mind is essentially just 3 rectangular buttons next to each other that are just constantly fixed to the bottom of the viewport. I tried dragging a toolbar into my scene as a starting point, but in the interface builder it's placing itself under my table cell, rather than fixing to the bottom. I feel like this is probably easier to do programmatically, but I just don't know where to start.
If someone could at the very least guide me in the right direction I'd really appreciate it. Thank you.
Okay... create/add custom UIView on your main view (self.view)
and set this custom view's frame = (0, 0, 320 , self.view.frame.size.height - 50) /// change value 50 to as per your requirement.
and add all of then UIControls such like textField, tableVie, button ...etc.. on this custom view.
Don't use a UITableViewController. Use a UIViewController, then add a table view and a toolbar. You'll need to implement the UITableViewDelegate protocol in code and then connect the delegate in interface builder.

Custom grouped table or buttons?

I'd like to design a view like this:
Each "section", which looks like a two-cell section in the mockup, are actually or should behave as a whole, I mean, both the blank upper part and the lower part with the disclosure indicator should be an only tappable unit and navigate to another view, I drawed it like two cells because I need the disclosure indicator to be vertically aligned to the bottom.
Should I set two grouped table views with three sections each one? Is it possible to change the corner radius of a grouped table, the space between sections and the right/left margins of the table? And change the alignment of the disclosure indicator?
Or should it be better to design a view like this with buttons? Is it possible to put a custom disclosure indicator in a button, or such symbol is only intended to appear in table cells and may break the iOS Human Interface Guidelines?
Thanks!
Collection views is the best for this.
Each little box with be its on UIView, reminds me of the card app they created in iTunesU, coding together.
Hope that helps.
UICollection view is the best but if you need to support iOS5, in that case you can use plain UITableView create a custom UITableViewCell with the contentView you want with appropriate padding.
I made something like this some time ago.. There are 2 options for you to develop this..
If you are supporting iOS 5.0 and below then you can make a grid view using TableView. (The code is in this tutorial http://www.edumobile.org/iphone/iphone-programming-tutorials/images-display-in-gridview-on-iphone/). Customize it a bit for your button and ImageView size.
If you are only supporting iOS 6.0 and above then you can use CollectionView and then customize it according to your needs.

Resources