Swift:#selector无法识别?

时间:2016-11-24 22:02:23

标签: ios swift uigesturerecognizer selector

我是swift的新手,我试图从斯坦福大学的演讲中重现这段代码:

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
  <div class="skiptranslate goog-te-gadget" dir="ltr" style="font-size: 0px;">


    
  <div id=":0.targetLanguage">
    <select class="goog-te-combo">
      <option value="">Seleccionar idioma</option>
      <option value="zh-CN">chino (simplificado)</option>
      <option value="fr">francés</option>
      <option value="en">inglés</option>
      <option value="it">italiano</option>
      <option value="vi">vietnamita</option>
    </select>
  </div>
  </div>


<script type="text/javascript">
$(".goog-te-combo").select2();
</script>

然而它给了我错误:

  

&#39;表达式列表中的预期表达式&#39;。

错误指向#selector。 我做错了什么?

1 个答案:

答案 0 :(得分:0)

这个怎么样:

@IBOutlet weak var faceView: FaceView! {
      didSet {
        faceView.addGestureRecognizer(UIPinchGestureRecognizer(target: faceView, action: Selector(FaceView.changeScale)))
    }
}