Great tutorial! Explained very clearly and concise. I have one question: How can I tell the PhotoManager Class is a Singleton? How the singleton is defined? Thanks!
Yes you should use a private init purely out of good practice so a unknown programmer cannot instantiate it by accident the wrong way. Also the way this tutorial writes the Singleton is a bit clunky. We tend to write a Singleton like this in Swift “static let shared = PhotoManager()”.
@lwang3rock I’d agree with @override777 here. When the tutorial’s updated, we can make those changes, specifically it would look like this inside of the class definition:
private override init() { }
static let sharedManager = PhotoManager()
Hi, I still dont get what’s the difference between execute task async with barrier flag and execute task sync as you did with write and read photos, can you help me to understand?
Thanks for the great stuff!!.
By going through this tutorial, I assume that DispatchQueue.main is same as DispatchQueue.global(qos: .userInteractive). Because you have mentioned that qos - .userInteractive runs on main thread. Is that so??
I was doing some research on this as it’s an interesting question. I actually don’t know but suspected that they are different. I saw you ask this on StackOverflow, were you able to come to a conclusion?
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]