Show Powerpoint Presentation in iOS - ios

In my app I have dropbox implementation and user can download the documents from dropbox and see that one by one like a slideshow. My Problem is that if user downloads .ppt file then how to show powerpoint presentation with all its animations on iPhone without using other app like slide shark.

Only way is Using the Quick Look Framework.
Use the Quick Look framework to provide previews of items that are in formats you don’t handle—such as iWork or Microsoft Office. This framework affords you more control over the preview process than you get from the UIDocumentInteractionController class—including choosing whether the preview is displayed in the context of a navigation controller or modally (full screen). The primary class in this framework is QLPreviewController, which provides a specialized view for previewing an item. It relies on a delegate for mediating preview actions, and a data source for providing the preview items.
In iOS 4.2 and later, the specialized view presented by a Quick Look preview controller includes an action button with a Print item. If the controller can provide a preview of a file, it can also print it. There is no printing code for you to write.
To display a Quick Look preview controller you can use any of these options:
Push it into view using a UINavigationController object.
Present it modally, full screen, using the
presentModalViewController:animated: method of its parent class,
UIViewController.
Present a document interaction controller (as described in
“Previewing and Opening Files.” The user can then invoke a Quick
Look preview controller by choosing Quick Look from the document
interaction controller’s options menu.
A Quick Look preview controller can display previews for the following items:
Microsoft Office documents (Office ‘97 and newer)
iWork documents
Rich Text Format (RTF) documents
PDF files
Images
Text files whose uniform type identifier (UTI) conforms to the
public.text type (see Uniform Type Identifiers Reference)
Comma-separated value (csv) files

look at UIDocumentationInteractionController, which may be easier than using Quick Look, depending on your needs, you can control animation better then Quick look but need lots of digging.

Related

Files App View Controller?

In Pages, Numbers, and Keynote 3.3 for iOS, Apple has done away with its custom file manager and instead uses the a version of the iOS 11 Files App to allow the user to choose and save files within the applications,
The Files-like document picker User Interface on Pages and Keynote 3.3 for iOS 11:
Is this a publicly available view controller that developers can implement in 3rd-Party Applications?
Apple mentions in a user support document that these apps "work together" to present this view. Link: https://support.apple.com/en-us/HT208077
It is UIDocumentBrowserViewController.
As far as "how did they make it the root view controller of the app? Isn't [it] usually presented from another View Controller?"
Check this page: Adding a Document Browser to Your App.
Always assign the document browser as your app's root view controller.
Don't place the document browser in a navigation controller, tab bar,
or split view, and don't present the document browser modally.
There are a lot of useful resources on that page, but a lot seems to hinge on your app being "Document Based" (About Document-Based Applications in iOS).

Is there a standard iOS UI control which implements open-in like UI?

I want to build open-in like UI (see picture below).
It should include a list of icons representing actions and cancel button. I want pretty much UIAlertController only with icons (vs plain text).
Is there a standard iOS control which does something like or that or will I have to build/find a custom UI control for that?
From Apple's docs, each displayed service/action is a UIActivity, which is an abstract class, displayed in a UIActivityViewController which you can customize. There are several built-in services, and you can create your own w/custom icons. Yes, UIActionSheet was deprecated in iOS8.
The UIActivityViewController class is a standard view controller that
you can use to offer various services from your application. The
system provides several standard services, such as copying items to
the pasteboard, posting content to social media sites, sending items
via email or SMS, and more. Apps can also define custom services.
Your app is responsible for configuring, presenting, and dismissing
this view controller. Configuration for the view controller involves
specifying the data objects on which the view controller should act.
(You can also specify the list of custom services your app supports.)
When presenting the view controller, you must do so using the
appropriate means for the current device. On iPad, you must present
the view controller in a popover. On iPhone and iPod touch, you must
present it modally.
Also see this related question on some image gotchas ...
And this tutorial on adding a custom UIActivity to the view.

UIActivityViewController vs UIDocumentInteractionController in ios

I just read some articles on UIActivityViewController and UIDocumentInteractionController in iOS, but I am very confused about how to use them because both seem the same.
So, when do I use UIActivityViewController or UIDocumentInteractionController?
Is there any difference for Open In... & use UIActivityViewController?
I am very confused about how to use them. Please clarify to me their specific use.
In short, UIDocumentInteractionController deals with files while UIActivityViewController deals with various other services in your app. I'm not one to criticize much but you really should at least try to google and read at least the overview in the iOS Developer Docs.
UIDocumentInteractionController documentation:
A view controller that previews, opens, or prints files whose file format cannot be handled directly by your app.
...
Use this class to present an appropriate user interface for previewing, opening, copying, or printing a specified file. For example, an email program might use this class to allow the user to preview attachments and open them in other apps.
After presenting its user interface, a document interaction controller handles all interactions needed to support file preview and menu display.
You can also use the delegate to participate in interactions occurring within the presented interface. For example, the delegate is notified when a file is about to be handed off to another application for opening. For a complete description of the methods you can implement in your delegate, see UIDocumentInteractionControllerDelegate.
UIActivityViewController documentation:
A view controller that you use to offer standard services from your app.
...
The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services.
Your app is responsible for configuring, presenting, and dismissing this view controller. Configuration for the view controller involves specifying the data objects on which the view controller should act. (You can also specify the list of custom services your app supports.) When presenting the view controller, you must do so using the appropriate means for the current device. On iPad, you must present the view controller in a popover. On iPhone and iPod touch, you must present it modally.
Basically UIActivityViewController shares Data Objects (like Strings or Images) where UIDocumentInteractionController shares whole Documents / Files f.e. a PDF.

UIActionSheet-like control similar to iOS 7 Safari's

I'm trying to create a UIActionSheet similar to Safari's. I haven't been able to find anything in the Apple documentation on how to make a UIActionSheet look like this. Is there a control/API that I am missing that I can use to create what's below, or am I stuck with creating my own UIView and displaying that?
Ninja Edit: This appears to be a UIActivityViewController. Is there any way I can add my own custom actions to it?
That is not a UIActionSheet.
It is a UIActivityViewController:
https://developer.apple.com/library/ios/documentation/uikit/reference/UIActivityViewController_Class/Reference/Reference.html
From Apple's Documentation:
The UIActivityViewController class is a standard view controller that you can use to offer
various services from your application. The system provides several standard services,
such as copying items to the pasteboard, posting content to social media sites, sending
items via email or SMS, and more. Apps can also define custom services.
Your app is responsible for configuring, presenting, and dismissing this view controller.
Configuration for the view controller involves specifying the data objects on which the
view controller should act. (You can also specify the list of custom services your app
supports.) When presenting the view controller, you must do so using the appropriate means
for the current device. On iPad, you must present the view controller in a popover. On
iPhone and iPod touch, you must present it modally.
About the ninja edit : Yes you can add actions to the UIActivityViewController.
See UIActivity on Apple's doc, or this SO question.

Using UIImagePicker in a tabbed UIPopover

I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in there. I have no idea how they did that, is it possible for me to do something like that? I think the main issue is that the Image Picker is it's own navigation controller and it cannot be pushed on to another navigation controller. Any help would be greatly appreciated!
check out this - https://github.com/key1jp/ELCImagePickerController
you can implement it with custom asset library
The built-in image picker is no good.
Create your own image picker and add it to your navigation controller as a normal view. Start from either the Matt Tuzzolo or the MyImagePicker from the WWDC 2010 sample code. Note that you probably want to add image and video preview - I copied the image viewer from MyImagePicker and added a 'add' or 'remove' button to it, and the same for video.
Your image picking is in two steps, one for selecting the group, and one for selecting the assets within the group. I recommend dividing the first step into a two - if there is only one, then go directly to that group, i.e. when you have found the first group, check whether that group was the last (block stop argument). Then push the right view controller.
Obiously modify the size of the thumbnails also, they are iPhone size now. Adding a line of metadata (icon and duration) looks much nicer and is more informative for video.
I also recommend adding a 'click-and-hold' function for extended information after like 2 seconds.
Handle different sources by creating a protocol which gives you what you want, i.e.
-(BOOL)isImageAtIndex:(NSInteger)index;
-(UIImage*)thumbnailForUndex:(NSInteger)index;
-(void)setSelectedAtIndex:(NSInteger)index;
Creating a source which handles local files, included resources and assets is perfectly possible - I use NSURLs and check on the url scheme.
Are you not using UITabBarController for your tabs? You should be able to add a UIImagePickerController directly to viewControllers. I'm not sure whether that is a supported use of the image picker, though; the documentation only mentions displaying it modally or displaying it in a UIPopoverController.
It's not usually useful to look at an Apple app to find out what you can do with various built-in controls, as Apple allows themselves to use private APIs.

Resources