swift ios扩展使用xcode10给出分段错误11
我使用的是swift 3.1,xcode 10 beta,cocapods 1.5.3swift ios扩展使用xcode10给出分段错误11,ios,swift,segmentation-fault,xcode10,Ios,Swift,Segmentation Fault,Xcode10,我使用的是swift 3.1,xcode 10 beta,cocapods 1.5.3 extension WithdrawFlow where Self: ViewcontrollerAnimatedTransition { func navigate() ... } 但编译器在扩展所在行崩溃主要是由于使用了“where Self:ViewcontrollerAnimatedTransition” xcode 9工作正常。但xcode 10给出了以下信息: 在流量下为“导航入流(:)”发射
extension WithdrawFlow where Self: ViewcontrollerAnimatedTransition {
func navigate()
...
}
但编译器在扩展所在行崩溃主要是由于使用了“where Self:ViewcontrollerAnimatedTransition”
xcode 9工作正常。但xcode 10给出了以下信息:
谢谢。我遇到了这个问题,通过使用默认值更改包含
inout
参数的函数,问题得到了解决。告诉我错误的函数是在我的应用程序中第一次调用它
旧的:
///使用指定的着色颜色、图像和脉冲动画创建新的图标按钮
便利初始化(带TintColor tint:inout BehaviorRelay=UIColor.navBarTintColor,
着色图像:UIImage?,
pulseAnimation:pulseAnimation=.CenterRadialByondBounds
) {
self.init(图像:着色图像?.withRenderingMode(.alwaysTemplate))
self.pulseAnimation=pulseAnimation
_=(tint??UIColor.navBarTintColor).asObservable().subscribe(onNext:{[weak self](newColor)中的
self?.tintColor=newColor
self?.imageView?.tintColor=newColor
})
}
新的:
///使用指定的着色颜色、图像和脉冲动画创建新的图标按钮
便利初始化(TinteImage:UIImage?,
pulseAnimation:pulseAnimation=.CenterRadialByondBounds
) {
self.init(图像:着色图像?.withRenderingMode(.alwaysTemplate))
self.pulseAnimation=pulseAnimation
_=UIColor.navBarTintColor.asObservable().subscribe(onNext:{[weak self](newColor)中的
self?.tintColor=newColor
self?.imageView?.tintColor=newColor
})
}