PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 16, 2022

[FIXED] How to get rid of warning "Result of call 'resignFirstResponder()' is unused"?

 July 16, 2022     ios, swift, warnings     No comments   

Issue

Since I converted my code to Swift 3, I got a warning whenever I don't use the result of UITextField's resignFirstResponder() method.

enter image description here

There's no bugs ( at least for now ) but I don't really like to have warnings like that. So my questions:

  • Should I actually use the results of this kind of call ? And if the answer yes, what should I do with them ?
  • If the answer is no : how can I get rid of these warnings ?

Solution

As Shaggy D already said this warnings can be ignored safely.

If you don't want to see them at all in your project you may set GCC_WARN_UNUSED_VALUE to false/NO in Build Settings.

Or just add let _ = before resignFirstResponder():

let _ = resignFirstResponder()


Answered By - user28434'mstep
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing