0

What does it mean if I only use the major version number in a Swift availability condition?

Eg, what's the difference between these two conditions?

  1. if #available(iOS 10, *) { /* */ }
  2. if #available(iOS 10.0, *) { /* */ }

Documentation: The Swift Programming Language: Control Flow: Checking API Availability

ma11hew28
  • 121,420
  • 116
  • 450
  • 651
  • 1
    I am fairly sure that there is no difference. – Martin R Mar 02 '17 at 20:48
  • the function that use that code it only run if the iOS is bigger then 10, if not it will not be executed. Is this code there is no difference between then, but you can check for iOS version like, 10.1, 10.2. – José Neto Mar 02 '17 at 20:49

2 Answers2

0

Some API functionality is added in minor revisions. For example, standalone search completion was added in iOS 9.3 (seen here). The major functions are typically updated with major revisions though

Jason
  • 808
  • 6
  • 25
0

There is no difference between 10.0 and 10 in an availability attribute or query in Swift.

Allan
  • 7,039
  • 1
  • 16
  • 26