私はちょっと誤解しています。 - (Void)を使用してコードを書き込もうとしたが、エラー "Expected declaration
"または時には "Binary operator '-' cannot be applied to operands of type 'UIFont' and '(Void).Type'
"が表示されます。Swiftの「期待される宣言」エラーを修正するには?
どうしてですか?迅速にこの機能を正しく使用する正しい方法は何ですか?
{
- (Void)keyboardWillShow { //>> showing me the error "Binary operator '-' cannot be applied to operands of type 'UIFont' and '(Void).Type'"
// Animate the current view out of the way
if (self.view.frame.origin.y >= 0)
{
[self setViewMovedUp:YES];
}
else if (self.view.frame.origin.y < 0)
{
[self setViewMovedUp:NO];
}
}
}
おかげ
スウィフトプログラミング言語のための[Appleのドキュメント](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/index.html)を通読してください。 –
問題の原因となっている実際のコードで質問を更新してください。 – rmaddy
これはSwiftコードではなくObjective-Cコードです。 [Swift Programming Language](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/)の本をお読みください。 – rmaddy