Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

URLSession Cookbook - Networking with URLSession on iOS 11 / Xcode 9 / Swift 4

Автор: Kodeco

Загружено: 2017-11-30

Просмотров: 16722

Описание:

Learn about URLRequest and HTTP headers, then create a URLSessionDataTask to POST to a REST API. Also build an Alamofire-inspired PostRouter to create URLRequests.

View the full course over here:

https://videos.raywenderlich.com/cour...

---

About www.raywenderlich.com:

raywenderlich.com is a website focused on developing high quality programming tutorials. Our goal is to take the coolest and most challenging topics and make them easy for everyone to learn – so we can all make amazing apps.

We are also focused on developing a strong community. Our goal is to help each other reach our dreams through friendship and cooperation. As you can see below, a bunch of us have joined forces to make this happen: authors, editors, subject matter experts, app reviewers, and most importantly our amazing readers!

---

From Apple Developer Documentation (https://developer.apple.com/documenta...

URLSession is an object that coordinates a group of related network data transfer tasks.

The URLSession class and related classes provide an API for downloading content. This API provides a rich set of delegate methods for supporting authentication and gives your app the ability to perform background downloads when your app isn’t running or, in iOS, while your app is suspended.

The URLSession class natively supports the data, file, ftp, http, and https URL schemes, with transparent support for proxy servers and SOCKS gateways, as configured in the user’s system preferences.

URLSession supports the HTTP/1.1, SPDY, and HTTP/2 protocols. HTTP/2 support is described by RFC 7540, and requires a server supporting either ALPN or NPN for protocol negotiation.

You can also add support for your own custom networking protocols and URL schemes (for your app’s private use) using URLProtocol.

With the URLSession API, your app creates one or more sessions, each of which coordinates a group of related data transfer tasks. For example, if you’re creating a web browser, your app might create one session per tab or window, or one session for interactive use and another for background downloads. Within each session, your app adds a series of tasks, each of which represents a request for a specific URL (following HTTP redirects, if necessary).

The tasks within a given URL session share a common session configuration object, which defines connection behavior, such as the maximum number of simultaneous connections to make to a single host, whether to allow connections over a cellular network, and so on. The behavior of a session is determined in part by which method you call when creating its configuration object:

The singleton shared session (which has no configuration object) is for basic requests. It’s not as customizable as sessions that you create, but it serves as a good starting point if you have very limited requirements. You access this session by calling the shared class method. See that method’s discussion for more information about its limitations.

Default sessions behave much like the shared session (unless you customize them further), but let you obtain data incrementally using a delegate. You can create a default session configuration by calling the default method on the URLSessionConfiguration class.

Ephemeral sessions are similar to default sessions, but they don’t write caches, cookies, or credentials to disk. You can create an ephemeral session configuration by calling the ephemeral method on the URLSessionConfiguration class.

Background sessions let you perform uploads and downloads of content in the background while your app isn’t running. You can create a background session configuration by calling the backgroundSessionConfiguration(_:) method on the URLSessionConfiguration class.

The session configuration object also contains a reference to URL cache and cookie storage objects that may be used when making requests and handling the responses, depending on the configuration and request type.

The tasks in a session also share a common delegate that lets you provide and obtain information when various events occur—when authentication fails, when data arrives from the server, when data is ready to be cached, and so on. Using a URL Session has a step-by-step list of events that occur when a session is performing a task, and which delegate methods are called as a result.

On the other hand, if you don’t need any of the features provided by a delegate, you can use this API without providing one by passing nil when you create a session.

URLSession Cookbook - Networking with URLSession on iOS 11 / Xcode 9 / Swift 4

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Download and Upload Task - Networking with URLSession on iOS 11 / Xcode 9 / Swift 4

Download and Upload Task - Networking with URLSession on iOS 11 / Xcode 9 / Swift 4

Объединить руководство | Вызов API с использованием Future, DataTaskPublisher | Swift | Xcode

Объединить руководство | Вызов API с использованием Future, DataTaskPublisher | Swift | Xcode

Как использовать шаблон «Координатор» в iOS

Как использовать шаблон «Координатор» в iOS

Swift: вызовы POST API (URLRequest + REST) ​​– Xcode, 2022, iOS для начинающих

Swift: вызовы POST API (URLRequest + REST) ​​– Xcode, 2022, iOS для начинающих

Docker за 20 минут

Docker за 20 минут

СРОЧНО отключи это в Telegram! Защити себя ПРОСТЫМ и ЗАКОННЫМ способом

СРОЧНО отключи это в Telegram! Защити себя ПРОСТЫМ и ЗАКОННЫМ способом

Цены полетели вверх! Липсиц объясняет почему это происходит

Цены полетели вверх! Липсиц объясняет почему это происходит

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Лучший Гайд по Kafka для Начинающих За 1 Час

Лучший Гайд по Kafka для Начинающих За 1 Час

Почему Трамп в последний момент отменил удар по Ирану

Почему Трамп в последний момент отменил удар по Ирану

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

Async Operations with Concurrency - iOS Concurrency with GCD and Operations - raywenderlich.com

Async Operations with Concurrency - iOS Concurrency with GCD and Operations - raywenderlich.com

URLSession: JSON GET & POST Requests | Swift 3, Xcode 8

URLSession: JSON GET & POST Requests | Swift 3, Xcode 8

SSL, TLS, HTTP, HTTPS объяснил

SSL, TLS, HTTP, HTTPS объяснил

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

Экспресс-курс RAG для начинающих

Экспресс-курс RAG для начинающих

The Time Profiler - Practical Instruments with iOS 10 - raywenderlich.com

The Time Profiler - Practical Instruments with iOS 10 - raywenderlich.com

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com