Swift compiler segmentation fault when building

后端 未结 30 2649
南旧
南旧 2020-11-29 03:59

Adding a (convenient) computed height property to UIView in my UIViewExtension.swift file is causing the Swift compiler to segfault...

30条回答
  •  情话喂你
    2020-11-29 04:50

    This error happened to me when I tried to override weak variable from parent class.

    In base class:

    weak var stripeViewDelegate : StripeViewDelegate? = nil    
    

    Derived class:

    override weak var stripeViewDelegate : StripeViewDelegate? = nil {
        didSet {
            self.stripeView.delegate = stripeViewDelegate
    
        }
    

    The error disappeared when I removed =nil from derived class.

提交回复
热议问题