Bind new mac-only APIs from xcode 8.3 - #1602
Conversation
|
Build failure |
spouliot
left a comment
There was a problem hiding this comment.
Seems there was not much added in 10.12.4 :)
| [Mac (10, 12, 4)] | ||
| [Async (ResultTypeName="SFValidationResult")] | ||
| [Export ("validateContextMenuItemWithCommand:inPage:userInfo:validationHandler:")] | ||
| void ValidateContextMenuItem (string command, SFSafariPage page, [NullAllowed] NSDictionary<NSString, NSObject> userInfo, Action<bool, NSString> validationHandler); |
There was a problem hiding this comment.
Please create a delegate type instead of Action<bool, NSString> (and drop the ResultTypeName). That should be the case for > 1 parameter, unless the 2nd one is an NSError.
The former is easier to use, because the parameters are named. The later requires extra documentation to be useful.
There will soon be a test to catch those (at least in master) once I'm finished adding missing Async.
There was a problem hiding this comment.
It won't let me do it without the ResultTypeName (or ResultType) on the Async:
error BI1023: bmac: Async method Void ValidateContextMenuItem(System.String, SafariServices.SFSafariPage, Foundation.NSDictionary`2[Foundation.NSString,Foundation.NSObject], SafariServices.SFValidationResult) with more than one result parameter in the callback by neither ResultTypeName or ResultType
There was a problem hiding this comment.
@timrisi you right, it's still needed :) However the current generated code is
public class SFValidationResult {
// constructors
public SFValidationResult (bool arg1, Foundation.NSString arg2);
// properties
public bool Arg1 { get; set; }
public Foundation.NSString Arg2 { get; set; }
}
By using a delegate the properties will be named based on the parameters.
There was a problem hiding this comment.
I understand the benefit of using the delegate instead, and am happy to do that, I just wanted to make sure I wasnt' missing something since you said said to remove the ResultTypeName and it wouldn't let me :).
dalexsoto
left a comment
There was a problem hiding this comment.
Ok once Sebastien's comment is fixed
spouliot
left a comment
There was a problem hiding this comment.
Stop! this PR targets cycle9 not xcode8.3 branch
|
Build success |
|
@spouliot Moved to be based on the xcode8.3 branch instead of cycle 9 and updated the target for the PR |
|
Build failure |
|
Build |
|
Build failure |
1 similar comment
|
Build failure |
|
Known failure |
No description provided.