How can this bar be done in iOS? - ios

I really like this popup with the additional functions for the selected listitem under:
But have no idea how this is done. Does anyone know how to do it or has a guide or some keywords for me?
Here is another example:

You could achieve a similar effect by adding a UISegmentedControl with <1 alpha to the view when a cell is selected - hope this helps :)

The keywords to look out for are:
UIToolBar or UISegmentedControl - both using some custom drawing or appearance modifications. Well, you could just as well create an entire custom UIView containing a bunch of UIImageView's.
Additionaly, for that shadow have a look at CALayer's shadowOffset, shadowColor, shadowOpacity, etc. ... properties.

Related

iOS) How to add a divider(==separator) between tabbarItems

I searched this question many times but couldn't get enough information.
So I will use UIButton or UIView to replace UITabbar for customizing issue.
I want to put divider(separator) between two tabbarItems and bottom lines like the image below
But What I made now is below:
How can I make it as I want?
I did customize many view components(UIViewcontroller, UIButton, UITextfiled,UITableViewCell,UICollectionViewCell) but I don't know how to customize tabbarItem
I'm afraid there is no specific option to set a divider in UITabBar. But you can always use a custom tab bar. You can check this out, it has a special property for seperator image:
NMBottomTabBarController for iOS
There is also another option. You may like this :) I also used it myself in one of my app. I made an image that looks like a tab bar with seperator as a background image. Then put the items on it. Easy peasy. For example check this image:
Image Link
I hope this helps.

Create custom UISearchBar Swift

How would I create a custom search bar that looks like this:
I could also use a textfield if that would be easier. How would I create a text field that looks like this using Swift?
Create your customTextField class and inherit it from UITextField.
Make its edges round setting cornerRadius for its layer and color it gray the same way.
Add a UIImageView with on top of the search bar.
Accept touches on the view. On touchesBegan, make the textField becomeFirstResponder and make the image hidden to true.
If you want to make a custom textfield or search bar you are going to have to do it programatically. You can add the search bar or textfield to the view but in order to get a customized look, like the one in the picture below. Also, make sure that you have all the code in the ViewDidLoad() and create an outlet for the item on the view. It isn't hard to do and I'm sure you will get the desired outcome as long as you are willing to go through some trial and error!
Don't worry doing all the customization is a bunch of fun, and give a great feeling after you have solved it!
I hope this helps

Swift - ios - creating ballon buttons

I want to create a set of buttons that will look like this:
(The selected buttons are those with a different background)
Any ideas for a simple implementation?
Are there any known open source implementations for this?
Thanks!
Following is the library which may be use to solve your problem,
For different appearance you need to give the conditional code for that but with out that your problem may solve with this library or code.
You can download the sample code of RRTagController project here.
For rounded corners use UIButton.layer.cornerRadius. if you set corner radius to half of the box you will get circle. For the border color use layer.borderColor = UIColor.redColor().CGColor.
For the background color of the button you can keep track with selected state of the button. Here is an example of using selected state: UIButton state selected
Next thing you could do is to keep data about selected ones, since the best way to do something like this would be UITableView - seems like every row of buttons have same height, and if you want to send that somewhere you can keep track about what items are selected.
I think the best way is to use UICollectionView.

How can I insert a subview below the other subviews

everyone.
I have some labels that I draw them in the xib file, and
add a background view using codes,but the background view
is in the front of these labels, so I cant see them. So,
my question is how can I add a background view below these
labels.
Thank you in advance.
If you Google UIView you'll end up at the documentation - UIView Class Reference
Then you need to look down the list of methods until you find something that sounds like it will roughly fit your needs like these two:
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index
and
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview
At this point you just have to read the descriptions of how the methods behave and pick whichever one is easiest to implement for your design. It's really good for your own learning if you try to find the answer yourself before you ask a question
You can use the method insertSubview:atIndex:
[self.view insertSubview:backgroundView atIndex:0];
You can call this method in Swift 3
view.insertSubview(yourSubView, at: 0)
or
view.sendSubview(toBack: yourSubView)
In IB the subviews of a view are listed in a hierarchy under that view. Subviews which appear above their siblings in that hierarchy will appear below them in the rendered view. So in the example below, the in 99:99 AM label appears under the Sign In button at runtime.
If your background is just a UIImageView, consider adding the view to your NIB and then setting its UIImage at runtime. That way, you don't get confused. Also, what Paul.s said.
Swift 3 and later.
view.insertSubview(theViewYouWantToAdd, at: 0)
https://medium.com/swift-programming/dynamic-layouts-in-swift-b56cf8049b08
Use VerticalLayout as the parent. it is quite simple and effective

Navigation in iOS like this image

I like the navigation that can be seen here:
But I don't know how to do it. Could someone point me to a tutorial how to do it or could tell me some keywords
Add four buttons to your view..arrange them in 2x2 format.
You should do it in Interface Builder..then just make an IBAction for
each button..
For creating odd shaped buttons use - https://github.com/ole/OBShapedButton
It's a fantastic button class that allows buttons that are not just rectangles.

Resources