ios - how to make a slider appear when a button is pressed in Swift? -
i'm making draw application, , want slider appear when user taps on button, example set width of line . can add alert , put slider in ?
welcome stack overflow.
your question more of basic programming question swift question.
i don't think can put slider in alert. apple introduced uialertcontroller class recently, , docs should rather uialertview new development.
a uialertcontroller lets create alerts , action sheets, , add actions. actions shown buttons. there facility adding text fields. don't think there facility adding other view objects sliders however.
the now-deprecated uialertview not set adding custom fields sliders.
you put slider on view somewhere , set it's hidden property true, in buttons action method, set myslider.hidden = false.
however sounds want slider appear on top of ui, go away when user done it.
you create view slider , dismiss button on it, put on top of view controller's content view, , set it's hidden flag true. when user taps button, set hidden = false , view appear on top, rather alert does. you'd set constraints slider-containing view centered on screen , sized appropriately.
Comments
Post a Comment