Post

Replies

Boosts

Views

Activity

Comment on How to tap a row in a UIPickerView
TapGesture will activate when you tap anywhere in the picker, on a row which may be different from selection, isn't it ? And tapping will not change the selection. That could be misleading. Or pickerTapped must first identify which row was tapped, which is not so easy. Or limit the tap to the center of the picker which is where the selection is.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’21
Comment on How to make a button that will print words when i press it.
For more fun, change as:     let citiesEU = ["Paris", "Toulouse", "London", "Milan", "Berlin", "Rome", "Madrid", "Lisbon", "Athens", "Brussels"]            let citiesUS = ["New York", "San Francisco", "Washington", "Dallas", "Cupertino", "Seattle", "Miami", "Chicago", "Detroit", "Phoenix"]                      class Responser: NSObject {     //Method to be called     var tag: Int = 0     @objc func printname() {         var value = "" // 0         switch tag {         case 1: value = citiesEU.randomElement() ?? "No EU city" //  (1...10).randomElement() ?? 1         case 2: value = citiesUS.randomElement() ?? "No US city" //  (11...20).randomElement() ?? 2         default: value = "No city" // 0         }         lbl.text = value // "(value)"     } }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’21
Comment on dfg
Is it a test ? A joke ? A mistake ? A bet ? In any case, not very appropriate for the forum unless you explain your purpose. Have a good day.
Sep ’21