Problems with delegate
func colorViewController(_ colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor) does not work.
Because here: self.delegate?.colorViewController(self, didChangeColor: color)
self.delegate always nil, despite that I set it
I fixed this by deleting weak here:
public WEAK var delegate: EFColorSelectionViewControllerDelegate?
Maybe I did something wrong?
Probably something wrong, the delegate pattern is usually used with weak references in order to avoid a reference cycle
You are probably getting rid of the delegate object after presenting the EFColorPicker (and likely causing a memory leak in your program)
How are you setting the delegate? It is a view controller? Does the program retains it after presenting the color picker?
func show(controller: SettingsViewController) {
let navCtrl = UINavigationController(rootViewController: colorSelectionController)
navCtrl.navigationBar.backgroundColor = UIColor.white
navCtrl.navigationBar.isTranslucent = false
navCtrl.modalPresentationStyle = UIModalPresentationStyle.popover
navCtrl.popoverPresentationController?.delegate = controller
}