2. NSURLSESSION
• Introduced in iOS 7
• Meant for downloading & Upload HTTP content
• Highly asynchronous
• Highly configurable
• Use completion handler or delegate
3. TYPES OF SESSIONS
• Default sessions - Uses disk cache and store credentials
• Ephemeral session - Uses no cache and doesn't store
credentials
• Background session - Similar to default but uses separate
process
4. CONFIGURATION
• Private support for caches, support, cookies for single session
• Control cookie policies
• Control HTTPPipelining behavior
• Per-resource timeouts
• Minimum and maximum version ofTLS support
5. KINDS OFTASKS
• Data tasks - downloads data, does not save into file
• Download task - downloads and saves file into a file
• Upload task - send data probably a file
• Stream task -TCP data
6. COCOA CLASSES FOR
STREAMS
• NSStream
• NSInputStream
• Stream to read the data from
• NSOutputStream
• Stream to write data to
7. USING STREAMS
• Create Streams from Socket
• Open
• Implement a delegate to listen to the events