Swift version: 5.4
To find the minimum of two numbers, either both integer or both floating point (not mixed!), use the
min() function. For example:
let first = 10 let second = 15 let smallest = min(first, second)
SPONSORED Stream’s latest iOS Chat SDK release provides a better developer experience with new docs, customizable attachments, and UI components, and under-the-hood performance improvements.
Available from iOS 2.0
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
Link copied to your pasteboard.