How to make a drop down menu in Swift [duplicate] - ios

This question already has answers here:
Making a drop down list using swift? [closed]
(5 answers)
Closed 7 years ago.
My idea is that, in order to provide to the user different options to choose it would be very interesting to include some type of IBOutlet with a drop down menu on it.
This is how it should be seen.
How is the best way to do this?
Any suggestion would be very appreciated.

Presuming that the down arrow is a button to trigger the drop-down that you've illustrated, the first suggestion that comes to mind is to create an IBAction for that button that presents a table view as a child view controller. This table view will list out the "different options".

You could always use a UIAlertController. Apple suggests that developers follow the same consistent design throughout the entire OS. As a plus, UIAlertController is pretty easy to use. (Beware though, UIAlertView is deprecated. Don't use it by mistake.)
You could also (if you have a lot of choices) use a UIPickerView.

Related

is it possible to hide the backlink button on ios? [duplicate]

This question already has an answer here:
Status bar back to previous app from multiple open apps
(1 answer)
Closed 11 months ago.
Is it possible to hide the backlink button on ios? Specifically I mean the button in the top left you see after tapping a deeplink in one app that opens another app. In the image it shows as "Deeplinks1".
This feature is built into IOS. There is no way to disable this feature as it has nothing to do with flutter or even programming with swift.
This is default iOS behavior, and hiding backlinks is not recommended. Even if you achieve it in whatever way, the app will be rejected on apple store
This answer could not be the best, but I used it before.
When you pop a page, the os(doesn't matter ios or android) will show a back button.
In this case, I used a property in the parent that tells which page should be rendered and totally forgot the pop method. for example:
_page == 1 ? pageOne() : _page == 2 ? pageTwo() : errorPage(),
I hope that this helps you.

Is there a checkbox in Swift? [duplicate]

This question already has answers here:
How to create radio buttons and checkbox in swift (iOS)?
(20 answers)
Closed 5 years ago.
I'm looking for a checkbox component in Swift. UISwitch seems not so handy because there I found no way to define a label for it.
Very good I find the component the iPhone used when turning on and off the personal hotspot. But I do not know what it is?
There's no native radio button in iOS. As you can see in iOS, Apple uses UISwitch as mention by Sweeper.
Now if you aim to achieve something like this, then you can make your own control or use some 3rd party open source libraries like VKCheckBox. https://github.com/vladislav-k/VKCheckbox
I've been using this custom control and you can integrate it by either Cocoapods or by merely importing its one and only class to your project.
No, there is no checkbox control available on iOS but i was achieve it using CZPicker view, it's allows to select single and multiple options from list
Please check this URL : https://github.com/chenzeyu/CZPicker
Thanks
I have cerated checkbox with uibutton subclass -- using image and title both and adjsuting title and image with title offset and image offset.
Put a property isSelected -- On DidSet I change the image of button for select/unselect.
2.On click of button I toggle the property isSelected
On click button I triger a delegate call back for get buttons selected/unselect state in view controller.
Hope It will help.

Xamarin iOS project need suggestion

I am developing a survey app using Xamarin and Mvvmcross. Can some one help with suggesting a way to build a View to display questionnaire. These questionnaire will be supplying from my View Model as a List of question with Question Text, Answer options. Based on a flag I need to prompt the questionnaire with input type as drop down or Text boxes. Number of questions can be vary.
In Android I achieved it using MvxGridView and Layout templates. But not sure how to do it in iOS.
You could look up UITableView or UICollectionView and UITextFields and UIPickerView
Wellcome to Xamarin, about your question you can just take look the code I wrote for others, it's a tableview include custom cell to display images, you can just modify the MyTableCell.cs class to display anything you want.
Custom cell tableview(Xamarin.iOS)
If you still need some help, just leave it here, I will check latter.
Hope it can help you.

Xcode: Can you add a Storyboard midway through development [duplicate]

This question already has an answer here:
Started making my app, now need story boards
(1 answer)
Closed 9 years ago.
I started developing an application, adding and coding up view controllers manually. I was wondering whether it was possible to add a storyboard after development has started? The reason I ask is that if I create a blank storyboard project with one or more linked view controllers, I do not see any of the traditional view switching code. I assume that the storyboards are doing something clever behind the scenes which I cannot see.
So if I already have two view controllers and then add a storyboard, will I damage any of the code I have already written for example?
No, adding the storyboard won't damage any code. You can (I believe) copy the nibs one by one into your storyboard.
There are some things to be aware of, though:
You don't use initWithNib anymore, you use [self.storyboard instantiateViewControllerWithIdentifier:]
Storyboards are much better, and may lead to increased productivity *.
* Your mileage may vary.

IOS facebook app slide option menu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
SplitView like Facebook app on iPhone
I need a control that will split a screen into 2 different views when click.
It is kind of like this [1]: http://i51.tinypic.com/2112zwh.png
I had used inferis/view deck but it screw out my navigation controller.
Basically it can't perform any segue
I am using StoryBoard with navigation controller and also tab controller.
Anyone has any idea how to have this kind of menu but works with storyboard and navigation controller, tab controller?
I made a video (3 parts) on youtube on how to make a sliding menu like the on you are looking for. I show you how to set up the project and get everything linked up.
http://www.youtube.com/watch?v=tJJMyzdB9uI
You will have to create UINavigationControllers instead of plain UIView controllers if you want to use that tutorial, but its basically just selecting one or the other.
The cool thing about ECSlidingViewController (Its the one I use) is that just about everything you want to configure (how far a view slides, the animations, left or right side) is done with a single line of code (sometimes 2 or 3 lines)
Try it out and see if it works for you?
I used the JTRevealSidebar Project to build mine. I used storyboards, and segues in my project and got everything working without any troubles. Take a look at the demos, and it should be pretty easy to implement. If you have any specific issues when you do get it implemented feel free to post questions about your issues.

Resources