I had the same situation when I was uploading images via url. I executed the logic in the function and made it private. Then I called the function into vievDidLoad. But when I removed the private mark, there was no more error. Maybe someone will help.