• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by serenefox · Mar 19, 2014 at 08:15 PM · iosiphoneipad

Platform Dependent Compilation iOS vs iPhone

Ok so this may be a stupid question but I can't find the answer for it. In the documentation on this subject, it only shows #if UNITY_IPHONE, but in the editor/monodevelop I noticed #if UNITY_IOS is in there too.

Now my question is, does #if UNITY_IPHONE cover the iPad as well or is that what #if UNITY_IOS is for? If the iPhone compilation does cover both what is the iOS compilation for? I am trying to build a game for iPhone and iPad but i am not sure which compilation to use for them.

Thanks!

Comment
liortal
neonblitzer

People who like this

2 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image supernat · Mar 20, 2014 at 09:30 PM 0
Share

I would guess UNITY_IPHONE is the original macro, and they added UNITY_IOS later because it is more generic, but they should work the same. I can't guarantee that. Unity doesn't even mention UNITY_IOS in their documentation. Perhaps you can test this and post the proper answer for future peeps. If you want to test specific platforms, look at iPhone.generation which is of type iPhoneGeneration.

avatar image serenefox · Mar 21, 2014 at 05:21 AM 0
Share

Thanks for replying, I would definitely test this and let everyone know, but I only have an iPhone 4 and no iPad. So i cant do a proper test, unless the iPad simulator were to work with it. Besides my game is still in the early stages of development, so it might be a while before I get to it.

3 Replies

  • Sort: 
avatar image

Answer by ChorcheRnR · Jul 15, 2015 at 10:48 AM

According to the documentation, UNITY_IPHONE is deprecated and recommends to use UNITY_IOS, but basically they are the same.

Comment
Vjosey

People who like this

1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Tekksin · Dec 15, 2014 at 01:11 PM

lines 19-22

https://books.google.com/books?id=toCfAwAAQBAJ&pg=PA158&lpg=PA158&dq=Platform+Dependent+Compilation+does+UNITY_IPHONE+cover+the+ipad&source=bl&ots=FPYLZF6lcW&sig=InaxbuW-HPYEAyxSprJz6rs0GaA&hl=en&sa=X&ei=2d2OVLqSH4mqgwSFv4TQDA&ved=0CCkQ6AEwAg#v=onepage&q=Platform%20Dependent%20Compilation%20does%20UNITY_IPHONE%20cover%20the%20ipad&f=false

Comment
neonblitzer

People who like this

-1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Vjosey · Mar 16, 2016 at 05:46 PM

UNITY_IPHONE is Deprecated. Use UNITY_IOS instead.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta on June 13. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

iphone like date pickers 1 Answer

WWW in iOS does not set user agent header 1 Answer

Getting an error in unity WebGL on IOS when trying to emit something to javascript 0 Answers

iOS camera and terrain size 0 Answers

Are soft shadows supported on iOS ? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges