I tried to override two methods of a class named DKImagePickerControllerDefaultUIDelegate.
I was able to override the following method.
func layoutForImagePickerController(_ imagePickerController: DKImagePickerController) -> UICollectionViewLayout.Type
But I am unable to override this one.
func imagePickerController(_ imagePickerController: DKImagePickerController, didSelectAssets: [DKAsset])
DKImagePickerControllerDefaultUIDelegate is the link of class I was trying to subclass.
Here is the issue I am getting when I tried to override the method.
You class doesn't have super class. So override method will not work. I tried your given library and it will not work as per your given way. For basic understanding i have created same mimic structure here for you to easily understand.
protocol ATDelegate {
func handleUIChange() -> String
func didSelectAssets()
}
class ATCustomUIDelegate:ATDelegate{
func handleUIChange() -> String {
return ""
}
func didSelectAssets() {
}
}
class ATOverrideCustomUIDelegate:ATCustomUIDelegate{
override func didSelectAssets() {
}
}
Above same case will applies with DKImagePickerControllerUIDelegate.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.