iOS Scope bar without search - ios

Is it possible to use such a scope bar like in the phone app http://d.pr/i/xTGQ
without a Search field? I want to use it as a button, but the UITabBar is too large for that.
Thanks for help!

That's just an UISegmentedControl I think. You can create one of those in Interface Builder and use it as usual.

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

Trying to make UISearchController function like language settings in iPhone in Swift

I currently have implemented a UISearchController which is currently working fine. Here are the attached screens that show how:
However, what I would like to do is implement it in a way that looks like how Apple implemented their language selection option in settings on the iPhone:
In Apple's implementation, the search bar does not hide the navigation bar when it is active. Does anyone know how to achieve this functionality in Swift instead of the conventional way which I have implemented currently? Just wondering.
There is a property called hidesNavigationBarDuringPresentation in the UISearchController class that by default is true that handle what do you want, so put it in false and you can achieve keep the navigation bar during the presentation as Apple do in the Language options:
searchbBarController.hidesNavigationBarDuringPresentation = false
I hope this help you

Calabash iOS how to tap the back button item

Guys just cant figure out how to tap on BackButtonItem from Navigation Bar with Calabash framework, I'm setting accessibilityLabel like this:
self.navigationItem.leftBarButtonItem?.accessibilityLabel = "goBack"
and trying to test it like this with no luck:
touch("* marked:'goBack'")
touch_transition('navigationItemButtonView first',
"* marked:'#{goBack}'")
The problem is that UINavigationItem, UITabBarItem, and UIToobarItem are converted, at runtime, to Views. For example, a UITabBarItem is converted to a UIToobarButton. In the conversion, the accessibilityIdentifier and accessibilityLabel are not preserved.
# This will probably get you the left navbar button
query("UINavigationItemButtonView index:0")
There are ways to enforce that an accessibilityIdentifier is preserved, such as making the navigation item from a custom view.
Take a look at the briar bars/navbar.rb for inspiration. I do not recommend using briar in your project; its life is uncertain (I am the maintainer).
I'd recommend trying query "all * marked:'goBack'" and if that still doesn't return any results, just try a query "all *" and see if the label shows up in the results.
You could also try setting the accessibilityIdentifier of the view - generally that's the preferred way to set up views for automation.
Just updating it might be helpful for someone who wish to use default back button
touch('navigationItemButtonView first')
This will take you back.
Found from calabash predefined steps.

Create custom keyboard within app not external

How am I able to create a keyboard that is already enabled in the app, or is it just buttons put next to each other to make it seem like a keyboard. Like the image below
http://i.imgur.com/qIoxR0a.png
you can use to the UIButton element or UIView with TouchBegan. But don't keyboard extension because different controller.
You can use ETCustomKeyboard which is mostly like same as you need.
And the output of that is show into below image:
You can modify this as per your need.
And HERE is one more same like that.
Hope this will help.
Create the keyboard as an ordinary UIView, and make it the inputView for your text field. There is more information in Apple's Custom Views for Data Input page.

Resources