title: Swift using of map to set property
body: <p>I have an 4-array segmentedControl with a property fontSize and I want to set the value of this property for all the 4 elements at once.</p>
  
  <p>Typically, I wish to transform this loop to an unique sentence :</p>
  
  <pre><code>// set identic font size for all segments (first, get the minimum font size and then set it for all segments)
  let minimumSize = (segmentedControlAnimated.segments.map{$0.titleLabel!.fontSize}).minElement()
  for i in 0..&lt;segmentedControlAnimated.segmentContent.text.count {
      segmentedControlAnimated.segments[i].titleLabel!.font = UIFont(name: "HelveticaNeue-Medium", size: minimumSize!)
  }
  </code></pre>
  
  <p>Can you help me to do that ?</p>
  
  <p>Thanks, and sorry for my poor English...</p>