プロジェクトをSwift 3に変換しました。次のコードに問題があります。これはSwift 3では使用されていないようです。>>> - 実際にはどういう意味ですか? Swift 3での使用方法は?スイフト3 - これはどういう意味ですか?
fileprivate func addImageToView(_ view: UIView, image: UIImage?) -> UIImageView? {
guard let image = image else { return nil }
let imageView = Init(UIImageView(image: image)) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.alpha = 0
}
view.addSubview(imageView)
// add constraints
[NSLayoutAttribute.left, .right, .top, .bottom].forEach { attribute in
(view, imageView) >>>- { $0.attribute = attribute }
}
imageView.layoutIfNeeded()
return imageView
}
これはビューの制約で動作するカスタム演算子です。[Constraint +](https://github.com/xhamr/fave-button/blob/master/Source/Helpers/Constraints%2B.swift)と同じです。 )が、エラーは何ですか? – xhamr
こんにちは@ xhamrエラーは演算子の結果は使用されていません - それはSwift 3の後に表示され始めました、どうすれば修正できますか? – rrdev
オペレータがいるライブラリの作者は、結果として使用されない関数のswift3に準拠するためにメソッドを '@ discardableResult'とマークする必要があります。 – xhamr