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

  • SEARCH
  • Home
  • 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 6075861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:32:30+00:00 2026-05-23T10:32:30+00:00

The UIView class has a class method: + (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations

  • 0

The UIView class has a class method:

+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion

It’s the first time I’ve seen an argument like the animation and completion arguments. What do I write in this place:animations:(void (^)(void))animations ? What does (^) and void mean?

  • 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-23T10:32:30+00:00Added an answer on May 23, 2026 at 10:32 am

    What your are seeing there is Objective-C’s block syntax. The syntax is completely obtuse, frustrating, and mind-numbing, but what it is doing is actually very simple.

    A block is logically equivalent to a closure in other languages such as JavaScript, so ignoring the nasty syntax you can think of the signature being something along the lines of:

    function transitionWithView(view, duration, options, animationFunction, onComplete);
    

    …where animationFunction and onComplete are closures (or blocks, to use the Objective-C parlance). Basically you can think of them as function pointers that preserve the state of the context in which they are created.

    Anyhow, the (^) token in Objective-C simply denotes a block. The type that precedes it denotes the return-type of the block (so void in your example, meaning that neither block returns a value), and the types that follow it in parenthesis denote any arguments that the block takes (so none for animations, and a BOOL called ‘finished’ for the completion block.

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

Sidebar

Related Questions

I'm concerned that this is impossible, because +setAnimationDelegate: of UIView is a class method.
I am working on a project where I have a class which has UIView
I have a class that inherits from UIView, and this class has some controls
I need to create a class that will present a UIVIew and has a
I have a custom view that subclasses UIView. It has a touchesEnded event, however
I have a UIView in my class (besides the original view) made in interface
I have GraphicView class that inherits from UIView. Its initWithFrame method is: @implementation GraphicsView
I have a UIView class which I am currently removing from my view by
I have a UIView custom class and the object created by this class has
I am new to iphone development.I have created a UIview controller class and added

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.