title: How to have an android like spinner view in iOS?
body: <p><a href="https://i.stack.imgur.com/AsO9E.png" rel="nofollow noreferrer">enter image description here</a>   My requirement is to show the users all the selection options to the user so that he can see all at once an then able to select from those just like it is done with spinner view in android. Currently I am using UI picker view. I am attaching the screen shot of it. Either I want a spinner or want the picker view to show 10 items simultaneously for the same height where it is currently showing three. This is my code:</p>
  
  <pre><code>func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -&gt; UIView {
              var myString = view as! UILabel!
  
              var myStringLength = 0
  
              if( view == nil) {
                  myString = UILabel()
              }
              myString?.textAlignment = .center
  
              var rowText:String
  
              if(pickerView==District){
                  rowText=districts[row]
              }
              else if(pickerView==block)
              {
                   rowText=blocks[row]
              }
              else if(pickerView==management)
              {
                 rowText=managements[row]
              }
              else
              {
                   rowText=categories[row]
              }
  
              var attributedRowText = NSMutableAttributedString(string: rowText)
              var attributedRowTextLength = attributedRowText.length
  
              attributedRowText.addAttribute(NSForegroundColorAttributeName, value: UIColor.blue, range: NSRange(location: 0, length: attributedRowTextLength))
  
              attributedRowText.addAttribute(NSFontAttributeName, value: UIFont(name: "Helvetica", size: 8.0)!, range: NSRange(location: 0 ,length:attributedRowTextLength))
  
              myString!.attributedText = attributedRowText
  
              return myString!
          }
  </code></pre>