Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6779905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:26:36+00:00 2026-05-26T16:26:36+00:00

The void (^)(void) syntax of the ‘completion’ argument type implemented by the UIViewController method:

  • 0

The void (^)(void) syntax of the ‘completion’ argument type implemented by the UIViewController method:

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion

has piqued my curiosity and I have been unable to find any documentation for it. Please could someone help explain its purpose/meaning?

Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:26:37+00:00Added an answer on May 26, 2026 at 4:26 pm

    Here’s the discussion of blocks from my book:

    http://www.apeth.com/iOSBook/ch03.html#_blocks

    There’s an example there, but here’s an example that’s closer to the sort of thing you’re asking about:

    [self transitionFromViewController:fromvc
                      toViewController:tovc
                              duration:0.4
                               options:UIViewAnimationOptionTransitionFlipFromLeft
                            animations:nil
                            completion:^(BOOL done){
                                [tovc didMoveToParentViewController:self];
                                [fromvc removeFromParentViewController];
                            }];
    

    The completion block takes one parameter, a BOOL called “done”, but this is not used by its code. The idea is that the animation is performed and then the code in the completion block is run.

    It’s very important to be comfortable with blocks because they are the way of the future. For example, view animation in iOS 4 uses them, as explained in the “Block Based View Animation” section of my book (read first about the old way, then read about the new iOS 4 way):

    http://www.apeth.com/iOSBook/ch17.html#_view_animation

    In iOS 5 blocks are even more important; there are more and more situations where they are not optional.

    Also blocks are the way to use GCD (grand central dispatch), which is far and away the best way to do multi-threading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Syntax error on Token Void, @ expected run cannot be resolved to a type
I was going through Jeffrey Palermo's book and came across this syntax. private void
printf(pointer: %d\n, sizeof(*void)); This line results in a syntax error because of the *.
Can I do this in C++ (if yes, what is the syntax?): void func(string*
Visual studio 2008 isn't catching syntax errors. for example: Tpc_feed(void); compiles fine. this: Tpc_feed(void);;;;;;;
It seems the compiler is not going let this syntax fly. void main() {
C++ provides a syntax for checked exceptions, for example: void G() throw(Exception); void f()
A question about threads in C/C++... C++0x syntax #include <thread> void dummy() {} int
Does anyone know the syntax for an out-of-declaration template method in a template class.
I've seen the syntax before and it's close to the form of public void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.