Xcode 10.2 Swift Error: Function types cannot be represented in Objective-C unless their parameters and returns can beHow do you document the parameters of a function's closure parameter in Swift 3?Swift to Objective-C header not created in Xcode 6How can method in Swift with inout parameter be used in Objective-C?Protocol with associatedtype doesn't play nice with optionalSwift 2.0 Method cannot be marked @objc because the type of the parameter cannot be represented in Objective-CExpose swift variadic parameter to Objective-CUnable to convert Swift protocol in Objective-C || How to write 'Self' return type of a protocol method of Swift in Objective-CMethod cannot be marked @objc because the type of the parameter 2 cannot be represented in Objective-CMethod cannot be marked @objc because its result type cannot be represented in Objective-CCannot access Swift Framework in Objective-Cfunc in swift for “self” causes error in Xcode

Is there a booking app or site that lets you specify your gender for shared dormitories?

How to prevent Deadlock on SELECT queries?

What does "autolyco-sentimental" mean?

How to open Lightning component in new window

How do I show and not tell a backstory?

What is the difference between "un plan" and "une carte" (in the context of map)?

Repeated! Factorials!

Is there a command-line tool for converting html files to pdf?

Can the Cauchy product of divergent series with itself be convergent?

Did Logical Positivism fail because it simply denied human emotion?

How to win against ants

Can attackers change the public key of certificate during the SSL handshake

Awk to get all my regular users in shadow

…down the primrose path

The warlock of firetop mountain, what's the deal with reference 192?

Why is Heisenberg shown dead in Negro y Azul?

Are valid inequalities worth the effort given modern solver preprocessing options?

Broken bottom bracket?

Is it uncompelling to continue the story with lower stakes?

Which one is more important between endgame studies and tactics?

Why is it to say 'paucis post diebus'?

What are the limitations of the Hendersson-Hasselbalch equation?

“The Fourier transform cannot measure two phases at the same frequency.” Why not?

What does Argus Filch specifically do?



Xcode 10.2 Swift Error: Function types cannot be represented in Objective-C unless their parameters and returns can be


How do you document the parameters of a function's closure parameter in Swift 3?Swift to Objective-C header not created in Xcode 6How can method in Swift with inout parameter be used in Objective-C?Protocol with associatedtype doesn't play nice with optionalSwift 2.0 Method cannot be marked @objc because the type of the parameter cannot be represented in Objective-CExpose swift variadic parameter to Objective-CUnable to convert Swift protocol in Objective-C || How to write 'Self' return type of a protocol method of Swift in Objective-CMethod cannot be marked @objc because the type of the parameter 2 cannot be represented in Objective-CMethod cannot be marked @objc because its result type cannot be represented in Objective-CCannot access Swift Framework in Objective-Cfunc in swift for “self” causes error in Xcode






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I updated Xcode to 10.2 today and I got the following errors:




Method cannot be marked @objc because the type of the parameter 2
cannot be represented in Objective-C



Function types cannot be represented in Objective-C unless their parameters and returns can be
I don't understand why




It was perfectly fine in 10.1.
This is an example that I have been using for years without any issues.
How can I make this code to compile without errors?



@objc public func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) 
// do stuff










share|improve this question





















  • 1





    Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

    – Martin R
    Mar 27 at 2:43












  • @MartinR I removed the element label and that solved the issue see the answer from matt

    – Tibidabo
    Mar 27 at 2:59











  • I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

    – Martin R
    Mar 27 at 3:09












  • @MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

    – Tibidabo
    Mar 27 at 6:18







  • 2





    Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

    – Martin R
    Mar 27 at 12:59

















1















I updated Xcode to 10.2 today and I got the following errors:




Method cannot be marked @objc because the type of the parameter 2
cannot be represented in Objective-C



Function types cannot be represented in Objective-C unless their parameters and returns can be
I don't understand why




It was perfectly fine in 10.1.
This is an example that I have been using for years without any issues.
How can I make this code to compile without errors?



@objc public func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) 
// do stuff










share|improve this question





















  • 1





    Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

    – Martin R
    Mar 27 at 2:43












  • @MartinR I removed the element label and that solved the issue see the answer from matt

    – Tibidabo
    Mar 27 at 2:59











  • I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

    – Martin R
    Mar 27 at 3:09












  • @MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

    – Tibidabo
    Mar 27 at 6:18







  • 2





    Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

    – Martin R
    Mar 27 at 12:59













1












1








1








I updated Xcode to 10.2 today and I got the following errors:




Method cannot be marked @objc because the type of the parameter 2
cannot be represented in Objective-C



Function types cannot be represented in Objective-C unless their parameters and returns can be
I don't understand why




It was perfectly fine in 10.1.
This is an example that I have been using for years without any issues.
How can I make this code to compile without errors?



@objc public func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) 
// do stuff










share|improve this question
















I updated Xcode to 10.2 today and I got the following errors:




Method cannot be marked @objc because the type of the parameter 2
cannot be represented in Objective-C



Function types cannot be represented in Objective-C unless their parameters and returns can be
I don't understand why




It was perfectly fine in 10.1.
This is an example that I have been using for years without any issues.
How can I make this code to compile without errors?



@objc public func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) 
// do stuff







objective-c swift xcode xcode10.2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 12:48







Tibidabo

















asked Mar 27 at 2:38









TibidaboTibidabo

19.6k4 gold badges81 silver badges82 bronze badges




19.6k4 gold badges81 silver badges82 bronze badges










  • 1





    Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

    – Martin R
    Mar 27 at 2:43












  • @MartinR I removed the element label and that solved the issue see the answer from matt

    – Tibidabo
    Mar 27 at 2:59











  • I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

    – Martin R
    Mar 27 at 3:09












  • @MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

    – Tibidabo
    Mar 27 at 6:18







  • 2





    Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

    – Martin R
    Mar 27 at 12:59












  • 1





    Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

    – Martin R
    Mar 27 at 2:43












  • @MartinR I removed the element label and that solved the issue see the answer from matt

    – Tibidabo
    Mar 27 at 2:59











  • I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

    – Martin R
    Mar 27 at 3:09












  • @MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

    – Tibidabo
    Mar 27 at 6:18







  • 2





    Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

    – Martin R
    Mar 27 at 12:59







1




1





Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

– Martin R
Mar 27 at 2:43






Is that a member function of a class? – My Xcode 10.2 complains “Cannot create a single-element tuple with an element label” with the Fix-it “Replace 'outPut: ' with ''”

– Martin R
Mar 27 at 2:43














@MartinR I removed the element label and that solved the issue see the answer from matt

– Tibidabo
Mar 27 at 2:59





@MartinR I removed the element label and that solved the issue see the answer from matt

– Tibidabo
Mar 27 at 2:59













I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

– Martin R
Mar 27 at 3:09






I know that is does. But if I cannot reproduce the exact error message as reported then I wonder if the exact code was posted :)

– Martin R
Mar 27 at 3:09














@MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

– Tibidabo
Mar 27 at 6:18






@MartinR Sorry, you are right. I simplified it... It should have more than one element in the tuple. it should be: func myFunction(inputString: String, handler:@escaping ((success: Bool, outPut: NSArray)) -> Void) // do stuff

– Tibidabo
Mar 27 at 6:18





2




2





Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

– Martin R
Mar 27 at 12:59





Now it gets interesting: Your closure argument has an extra pair of parentheses, apparently Swift 4 ignores that but Swift 5 does not. If you remove that extra pair: handler:@escaping (success: Bool, outPut: NSArray) -> Void then you'll get a clear error message “Function types cannot have argument labels; use '_' before 'outPut'” already in Swift 4/Xcode 10.1. – So what changed is not the forbidden external parameter names (they are already forbidden in Swift 4), but how the compiler treats the extra pair of parentheses.

– Martin R
Mar 27 at 12:59












1 Answer
1






active

oldest

votes


















2














Delete the phrase outPut:. It was always illegal; Swift 5 just tightens up at last.



So:



@objc public func myFunction(inputString: String, handler:@escaping (NSArray) -> Void) {





share|improve this answer

























  • You should not be using NSArray either but that’s a different issue.

    – matt
    Mar 27 at 2:43











  • Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

    – Tibidabo
    Mar 27 at 2:57






  • 2





    @Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

    – Martin R
    Mar 27 at 3:01











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55368967%2fxcode-10-2-swift-error-function-types-cannot-be-represented-in-objective-c-unle%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Delete the phrase outPut:. It was always illegal; Swift 5 just tightens up at last.



So:



@objc public func myFunction(inputString: String, handler:@escaping (NSArray) -> Void) {





share|improve this answer

























  • You should not be using NSArray either but that’s a different issue.

    – matt
    Mar 27 at 2:43











  • Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

    – Tibidabo
    Mar 27 at 2:57






  • 2





    @Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

    – Martin R
    Mar 27 at 3:01
















2














Delete the phrase outPut:. It was always illegal; Swift 5 just tightens up at last.



So:



@objc public func myFunction(inputString: String, handler:@escaping (NSArray) -> Void) {





share|improve this answer

























  • You should not be using NSArray either but that’s a different issue.

    – matt
    Mar 27 at 2:43











  • Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

    – Tibidabo
    Mar 27 at 2:57






  • 2





    @Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

    – Martin R
    Mar 27 at 3:01














2












2








2







Delete the phrase outPut:. It was always illegal; Swift 5 just tightens up at last.



So:



@objc public func myFunction(inputString: String, handler:@escaping (NSArray) -> Void) {





share|improve this answer













Delete the phrase outPut:. It was always illegal; Swift 5 just tightens up at last.



So:



@objc public func myFunction(inputString: String, handler:@escaping (NSArray) -> Void) {






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 27 at 2:40









mattmatt

352k53 gold badges576 silver badges769 bronze badges




352k53 gold badges576 silver badges769 bronze badges















  • You should not be using NSArray either but that’s a different issue.

    – matt
    Mar 27 at 2:43











  • Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

    – Tibidabo
    Mar 27 at 2:57






  • 2





    @Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

    – Martin R
    Mar 27 at 3:01


















  • You should not be using NSArray either but that’s a different issue.

    – matt
    Mar 27 at 2:43











  • Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

    – Tibidabo
    Mar 27 at 2:57






  • 2





    @Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

    – Martin R
    Mar 27 at 3:01

















You should not be using NSArray either but that’s a different issue.

– matt
Mar 27 at 2:43





You should not be using NSArray either but that’s a different issue.

– matt
Mar 27 at 2:43













Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

– Tibidabo
Mar 27 at 2:57





Thank you Matt. It did the trick. Is there any way to assign phrases to the variables that is not illegal?

– Tibidabo
Mar 27 at 2:57




2




2





@Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

– Martin R
Mar 27 at 3:01






@Tibidabo: You can define the parameter as handler: @escaping (_ output: NSArray) -> Void. That also allows to document the parameter, see stackoverflow.com/a/38669796/1187415.

– Martin R
Mar 27 at 3:01









Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55368967%2fxcode-10-2-swift-error-function-types-cannot-be-represented-in-objective-c-unle%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현