A question about iPhoneX. I want put Launch Image of iPhoneX( 1125px × 2436px) in common folder. Not in LaunchImage source. What's the Launch Image names of iPhoneX? just like 'Default-iOS8-736h#3x', I can not found the name in https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/ .
You can add static launch image for iPhone X, only add:
Default-375w-812h#3x.png
Following the convention it should be named Default-812h#3x.png (and Default-Landscape-812h#3x.png) (812 is the actual height in points).
And looks like currently there is no way to use storyboard-powered launch screen and have pixel perfect images for both iPhone X and old plus sizes models.
You can add static launch image for iPhone X with old project with simple step:
1, Select Assets.xcassets select launch image folder.
2, Check "iOS 8.0 and later" in the right Attribute inspector panel.
3, An iPhone X place holder will appear, drag an image 375w812h # 3x to it and you are done.
If the launchImage source name is 'LaunchImage'.
The name should be
[UIImage imageNamed:#"LaunchImage-1100-2436h#3x.png"]
PS: how to find it ?
step 1. Open the bundle directory like /Users/hite/Library/Developer/CoreSimulator/Devices/5CFE3CFA-94F8-45EC-BAC5-xxx2/
Find your application file like myFit.app, and Show Package Contents .
search for the 3x.png to get the image name.
You can define the names in your Info.plist using the UILaunchImages Key:
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-812h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 812}</string>
</dict>
</array>
Landscape images would work the same.
Related
I integrated share extension in my application. This is my plist file for share extensions.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
I am receiving warning in Xcode that if I use Truepredicate then apple will reject my application. So I tried adding other activation rule as mentioned below
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
But if I remove Truepredicate and add above rules my share extension does not show any more. With truepredicate share extensions works perfectly fine.
Can anyone help me what should I do here?
I had integrated share extensions for music related apps.
There was mistake in My Plist file that's why was facing such issue.
Posting this answer just because may be in future if someone will do such mistake so my answer could help out!
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
This is working perfectly fine!
You have to wrap your new keys such as NSExtensionActivationSupportsWebURLWithMaxCount
inside a dictionary tag.
Put this back in your code:,
NSExtensionActivationRule, this key needs to reference the dictionary of new keys.
I don't write apps for ios, so I'm not sure why <string>TRUEPREDICATE</string> is the default. I just know it allows all data types to be passed implicitly. Data types must be explicitly as shown below.
Example:
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsText</key>
<false/>
</dict>
<key>NSExtensionPointName</key>
<string>com.apple.ui-services</string>
<key>NSExtensionPointVersion</key>
<string>1.0</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ui-services</string>
I'm trying to import a ZIP file via the built-in 'Open With...' function.
Here's what I have added to my Info.plist file:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>ZIP Archive</string>
<key>CFBundleTypeIconFile</key>
<string>zip</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>ZIP </string>
</array>
<key>CFBundleTypeExtensions</key>
<array>
<string>zip</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/zip</string>
<string>application/x-zip</string>
<string>application/x-zip-compressed</string>
</array>
</dict>
</array>
However, my app is not appearing when the 'Open With...' view is launched. Why is this?
Your problem is that you've failed to declare the relevant uniform type identifier (UTI). For many file types you need to either import or export a UTI; for zip files you needn't bother because it's on the list of UTIs that the system inherently recognises.
So it should be sufficient simply to add the following to your document type:
<key>LSItemContentTypes</key>
<array>
<string>com.pkware.zip-archive</string>
</array>
Expanding on #Tommy's answer you can add this value using Xcode in your project as shown:
I have successfully registered my app to open PDF files by including the following in my info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
</dict>
</array>
However, I cannot seem to register my app to open any image files, I have tried to register not only for the base image UTI, but also specific types like png and jpg. Is it possible to register to open image files?
Bad news - cannot be done. Wish these things would be stated in the docs.
open plist with Source code and add this for document.
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
i hope this usefull for you.
Open the plist with an editor...
Capitalization, etc is critical, recommend specifying both lower case and upper case file extensions.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>jpg</string>
<string>JPG</string>
</array>
<key>CFBundleTypeName</key>
<string>Images</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
Then save the file. App should now be registered to handle this type of file.
I have a problem registering image file types to my application. I tried adding the code below to my plist but nothing happens.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Scary Bug Document</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>LSItemContentTypes</key>
<array>
<string>public.image</string>
</array>
</dict>
</array>
I noticed that I can register for other file types, such as text (changing the public.image to public.text) but it just won't work with images (the "Open In .." menu is not showing my app).
What could be causing this, and how could I fix it?
It is now possible to open images from the mail app in iOS 7, it's just somewhat convoluted:
Tap and hold the image.
Tap on Quick Look so the image goes fullscreen.
Tap the image to show the top toolbar.
Tap the open in button at the top right.
Scroll the list to the left to find your app.
Be sure to set up your bundle document types for the image types you are interested in.
Dimitri Bouniol response that it works in iOS 7 via quick look is correct.
The following additions to my in info.plist below are how I got it to work for my app.
Still have not figured out how to get share in photos or camera roll to work.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>myapp image</string>
</array>
<key>CFBundleTypeName</key>
<string>public.png</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>public.png</string>
<string>public.jpeg</string>
</array>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.image</string>
</array>
<key>UTTypeIdentifier</key>
<string>public.png</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>PNG</string>
<key>public.filename-extension</key>
<array>
<string>png</string>
</array>
<key>public.mime-type</key>
<string>image/png</string>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>public.jpeg</string>
<key>UTTypeReferenceURL</key>
<string>http://www.w3.org/Graphics/JPEG/</string>
<key>UTTypeDescription</key>
<string>JPEG image</string>
<key>UTTypeIconFile</key>
<string>public.jpeg.icns</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.image</string>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>JPEG</string>
<key>public.filename-extension</key>
<array>
<string>jpeg</string>
<string>jpg</string>
</array>
<key>public.mime-type</key>
<string>image/jpeg</string>
</dict>
</dict>
</array>
Try:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Scary Bug Document</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>LSItemContentTypes</key>
<array>
<string>public.png</string>
<string>public.jpg</string>
</array>
</dict>
</array>
Also, see this other answer on StackOverflow
After doing a bit of research it seems that is not possible to register the app for images.
Thanks for your answers.
public.image is an abstract type, try registering for public.png or public.jpeg etc
Per Apple's documentation, "to add the document type do the following:
Click on the disclosure button for Document Types to open the document types.
In the “Types” section fill in the UTI for the new type.
For the key value type: CFBundleTypeRole.
For the value type: Editor.
For the key value type: LSHandlerRank.
For the value type: Owner."
This works for me using public.image as the UTI.
OS will not allow you to open images in your app. I also tried myself a lot of permutation & combination, and confirmed from a few more posts in Apple Support.
I have a settings bundle in my app.. containing root.plist
now i have a screen which contains a checkbox..
on pressing the check box i want to change the BOOL value for DefaultValue key of PSToggleSwitchSpecifier in the plist.
Since its being done at runtime.. my question is that .. can the file be changed at runtime and if yes.. give an idea how to do it??
here is the plist:
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>DefaultValue</key>
<string></string>
<key>Key</key>
<string>Username</string>
<key>Title</key>
<string>Username</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string></string>
<key>IsSecure</key>
<true/>
<key>Key</key>
<string>Password</string>
<key>Title</key>
<string>Password</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string> <-----toggleSwitch
<key>Title</key>
<string>Remember</string>
<key>Key</key>
<string>CheckBox</string>
<key>DefaultValue</key> <----- Default Value
<false/> <---- want to change this value
</dict>
</array>
<key>Title</key>
<string>Settings</string>
</dict>
</plist>
thank you in advance ;)
Because the settings bundle resides inside your app's bundle, you cannot change it at runtime, only at compile-time.
You can, however, use NSUserDefaults to set the value at runtime, and the settings application will automatically reflect this. It will be saved elsewhere, though. You can just read it back the same way as you would do with the settings bundle, also through NSUserDefaults.
Note that you shouldn't read from the settings bundle directly, as it makes no sense. You should always fetch and set user defaults using NSUserDefaults. When the user makes a change in the settings application, NSUserDefaults will reflect this automatically. They will always be kept in sync.
You can not modify files with the application bundle..