Bug 27334 - UIView.Animate completion handler delegate does not have a bool in its arguments.
Summary: UIView.Animate completion handler delegate does not have a bool in its argume...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.6.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-02-23 20:42 UTC by Jon Goldberger [MSFT]
Modified: 2015-02-23 21:22 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Goldberger [MSFT] 2015-02-23 20:42:45 UTC
## Description

The native iOS API for UIView animateWithDuration signature is as follows (from Apple's API docs):

+ (void)animateWithDuration:(NSTimeInterval)duration
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion

However the Xamarin delegate for the completion handler does not have the (bool finished) parameter. If I try:

				()=> {  },
				(bool finished)=> {  }

the compiler throws an error that Delegate "System.Action" does not take 1 argument.

Note I only tested this with the Unified API. Version info at the end of this post.

## Steps to reproduce:

1. Open Xamarin Studio and create a new SingleView iOS Unified app project.
2. Add the following code to the ViewDidLoad method (or anywhere, really)

>	()=> {  },
>	(bool finished)=> {  }

3. Build the project.

Expected result: Project will build.
Actual result: Project does not build with the above error. 

## Version info:

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.Mac ===

Version: (Business Edition)

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 98ee412
Build date: 2015-02-11 04:37:05-0500

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.10.2
Darwin Jons-iMac.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 2 Bernie Habermeier 2015-02-23 20:49:47 UTC
Hope to see a fix soon!  Thanks!
Comment 3 Sebastien Pouliot 2015-02-23 21:11:25 UTC
That's an old binding mistake that was not removed in unified (mis-identified) and now needs to stay for API binary compatibility.

To get the same API as described above you need to use `AnimateNotify`. E.g.

	UIView.AnimateNotify (10.0, 
		()=> {  },
		(bool finished)=> {  }
Comment 4 Sebastien Pouliot 2015-02-23 21:22:26 UTC
Added `[Advice]` attributes so the IDE (XS or VS) can show an hint to use the right/better API.

maccore/master 0c8214f8e955e5159813ff7b6f636baba8e3eac6