The IOS system version is judged

Source: Internet
Author: User

IOS macros define the system version of the judgment

#define IOS7 ([[[Uidevice Currentdevice] systemversion] floatvalue] >= 7.0)#define Ios7later ([Uidevice currentdevice].systemversion.floatvalue >= 7.0f)#define Ios8later ([Uidevice currentdevice].systemversion.floatvalue >= 8.0f)#define Ios9later ([Uidevice currentdevice].systemversion.floatvalue >= 9.0f)#define Ios9_1later ([Uidevice currentdevice].systemversion.floatvalue >= 9.1f)#define Ios10_1later ([Uidevice currentdevice].systemversion.floatvalue >= 10.1f)A lot of people are using this method, I also used this method of macro definition, but in the development environment of Xcode has already defined a lot of system version discriminant macro definition contains iOS, MAC, TVOS, watchOS of the system version of the macro, as follows:

Just use the following method when you are using it.#ifdef __IPHONE_7_0new feature code for//IOS7#endifor by using:#if __iphone_os_version_max_allowed >= __iphone_7_0new feature code for//IOS7#endif (__iphone_os_version_max_allowed This definition is in the simulator-ios7.0/usr/include/availabilityinternal.h file)It's done.

The IOS system version is judged

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.