0

The number of segments in my Segmented Control needs to change depending on the number of matching words the program finds.

Can I do this?

"mySegmentedControl.numberOfSegments" looks like the right command but doesn't work.

Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
  • Hi - I read that posting and surely the number of segments should be dictatable with a command like, mySegmentedControl.numberOfSegments = X, in the same way the literals in segments can be. That is why I posted the questin and phrased it differently. Makybe I should have made the point stronger. What they seem to be doing in starting with a nul segment controller and appending to it. – Edward Hasted Feb 16 '17 at 11:37
  • The code I used in the end was: for count in stride(from: 0, to: myArray.count, by: 1) { fromSegmentController.insertSegment(withTitle: "A1", at: count, animated: false) } – Edward Hasted Feb 16 '17 at 15:47

0 Answers0