Working with Xcode playgrounds really help me figure things out by and for myself and make learning "new" (to me) concepts really "stick".
From what I gathered, primarily when using a Playground with asyncrhonous objects, the following statements should be at the beginning of the playground:
// The following will allow the use asynchronous code in playgrounds.
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely()All is well and good, my code that involve the use of shared NSURLSession works (BTW, my app interfaces with api.themoviedb.org). Well... as long as I am using the unsecured URL (i.e., http://...).
It's quite a different story, though, when I start using secured URL (i.e., https://...). Using the latter gives me the following eror message when making the initial token request:
Error Domain=NSURLERrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be "api.themoviesb.org" which could put your confidential information at risk." UserInfo=***(hidden on purpose - LETorres)***
{NSURLErrorFailingURLPeerTrustErrrKey=<SecTrustRef:0x7ff056107820>,
NSLocalizedRecoverySuggestion=Would youlike to connect to the serveranyway?,
_kCFStreamErrorCodeKey=-9807,NSUnderlyingError=0x7ff0560426d0 "The operation couldn't be completed. (kCFErrorDomainCFNetwork error -1202.)",
NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be "api.themoviedb.org" which could put your cpnfidential information at risk.,
NSErrorFailingURLKey=https://api.themoviedb.org/3/authentication/token/new?api_key=***(hidden on purpose - LETorres)***
....Does anyone how to make "https://..." work in XCode Playground? is there any additional playground configuration that I am missing here?
(BTW, I know that the code using "https://..." work. My app works just fine with it. It is just the Xcode playground that is not playing nice with it at all.)
Any and all helpful hints will be truly appreaciated.
P.S. It would have been nice if this forum allows the uploading of screenshots. :-) If it were, I need not retype the text from my screenshot.