'How to add properties in info.plist in iOS
I want to open PDF attachment via email in my own application: I refer two link here:
How do I associate file types with an iPhone application?
where it shows some XML content, and says its added to info.plist.My info.plist is shown like this attachment. How can I add content to info.plist to make it visible as XML document.
My info.plist:
Solution 1:[1]
plist files is nothing more than XML document that Xcode view in his own way. You can Right click -> Open as -> Source Code to get view you want.
Also you can add to plist directly by clicking plus sign or Right click -> Add Row. Default view of plist can give you a suggestions, so I recommend you to use this instead of viewing as XML
Solution 2:[2]
info.plist is a system level plist in iPhone application, you can add properties by adding a property like this:
Solution 3:[3]
Right click on the .plist in Xcode and select "Open As -> Source code"
Solution 4:[4]
may be worth mentioning how to get there..
Info.plist is one of the file below the Main.storyboard or viewController.swift
when you click on it first time it usually is in a table format,so right click the file and 'open as' Source code and then add the code
Solution 5:[5]
If you want to view it as XML, just find the plist file and open it with your favorite editor. Something like TextWrangler. And then add your key-value pairs.
Solution 6:[6]
Solution 7:[7]
XCODE 13
You do not see your info.plist
file in project folder until you try to modify it for the first time (lets say by adding value) in target -> Info - example seen on below:
After you add any value in targets, the info.plist
will be created and available for you somewhere in your project folder (example below)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | lxzhh |
Solution 3 | mprivat |
Solution 4 | Naishta |
Solution 5 | Bourne |
Solution 6 | |
Solution 7 | Mr.SwiftOak |