Code Monkey home page Code Monkey logo

Comments (3)

erica avatar erica commented on September 4, 2024

This is discussed in-text. "Adding a way for your activity to complete is important, especially when your controller doesn't have a natural endpoint. When your action uploads data to an FTP server, you know when it completes. If it Tweets, you know when the status posts. In this example, it's up to the user to determine when this activity finishes. Make sure your view controller contains a weak property pointing back to the activity, so you can send the did-finish method after your work concludes."

-- E
On Dec 29, 2012, at 10:43 AM, seeker12 [email protected] wrote:

The example app, Activity Controller, Chapter 8 / example 10, demonstrates a "roll your own activity", presenting a UIActivityViewController passing a UIActivity subclass instance, MyActivity, in the applicationActivities array. The MyActivity instance returns a TextViewController instance from its activityViewController method.

The presentation of the custom activityViewController and handling of the activityItems data works as described, however, though the -(void)done method handler is called by the TextViewController Done button event, in the iPad simulator and on an iPad device, the custom activityViewController (TextViewController) is not dismissed.

Per Apple UIActivity Class Reference documenting activityViewController:
"Discussion
The default implementation of this method returns nil. Subclasses that provide additional UI using a view controller can override this method to return that view controller. If this method returns a valid object, the system presents the returned view controller for you, instead of calling the performActivity method. On iPad, your view controller is presented inside of a popover. On iPhone and iPod touch, your view controller is presented modally.

Your custom view controller should provide a view with your custom UI and should handle any user interactions inside those views. Upon completing the activity, do not dismiss the view controller yourself. Instead, call the activityDidFinish: method and let the system dismiss it for you.

Note: If the view controller returned by this method presents additional view controllers, you are responsible for presenting and dismissing those view controllers. However, you must not dismiss the view controller returned by this method."

The custom activityViewController is presented in full screen modal view, rather than in a popover as the docs describe, and,
The activityViewController is not dismissed when the UIActivity activityDidFinish: method is called.
Is this an Apple bug? Or is there something I'm not doing correctly?

Thanks for the awesome book and recipes!


Reply to this email directly or view it on GitHub.

from ios-6-cookbook.

erica avatar erica commented on September 4, 2024

Apparently this is a known issue for the iPad. Radars 12545554 / 12545600. Workarounds (e.g. adding completion handler to activity controller) do not seem to work at this time. I'll keep watching this to see if anything resolves.

from ios-6-cookbook.

ostapHorbach avatar ostapHorbach commented on September 4, 2024

Did you find solution to this issue?

from ios-6-cookbook.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.