efremidze / Haptica

Easy Haptic Feedback Generator 📳
MIT License
759 stars 43 forks source link

Update Hapticable.swift #7

Closed Kirow closed 5 years ago

Kirow commented 5 years ago

'cannot assign to property' fix

Checklist

Motivation and Context

this change will solve cannot assign to property: 'self' is immutable error for cases when trying to assign property inside subclass c-tor

Sample code:

class MyButtonSubclass: UIButton {
    override init(frame: CGRect) {
        super.init(frame: frame)
        isHaptic = true
        hapticType = .impact(.heavy)
    }
}
efremidze commented 5 years ago

Thanks!!!!!