2017-03-22 4 views
1

나는 아래의 사용자 지정 대리인이 오류를 보여주는 프로젝트를 빌드하는 동안의 ViewController스위프트 컴파일러 충돌

func clickedButtonTitle(_ title:String?,alertTag:Int?) 
{ 
    print(title) 
} 

이 대리자 메서드를 구현하는

import UIKit 
protocol SAlertViewDelegate { 
func clickedButtonTitle(_ title:String?,alertTag:Int?) 
} 
func button1Action(_ sender: UIButton?) { 

    let titleLabel=sender?.titleLabel?.text 
    self.delegate?.clickedButtonTitle(titleLabel!,alertTag: alertTag!) 
    removeFromMainView() 
} 

의 코드가

최근 메시지 표시 신호로 인해 명령이 실패했습니다 : 분할 fau LT : 11 1 'clickedButtonTitle'swift3에

동일한 코드가 빠른 2.3 잘 작동

아니지만 대한 SIL 발광 동안.

답변

0

프로토콜 선언에서 함수 시그니처는 내부 변수 이름을 필요로하지 않으며 원하지 않습니다.

그래서

protocol SAlertViewDelegate 
{ 
    func clickedButtonTitle(_ title:String?,alertTag:Int?) 
} 

는해야

protocol SAlertViewDelegate 
{ 
    func clickedButtonTitle(_ :String?, alertTag:Int?) 
} 

이 수도 있고 오류에 대한 유일한 이유가 될 수 없습니다. 세분화 오류가 발생하면 알려주지 않습니다.

다른 코드 스 니펫이 문맥에 맞지 않아 문제를 일으킬 수있는 다른 정보를 알려주지 못합니다.

관련 문제