{"id":22055352,"url":"https://github.com/rodrigofrancisco/operationqueueexample","last_synced_at":"2025-03-23T16:14:40.379Z","repository":{"id":124585100,"uuid":"410067839","full_name":"rodrigofrancisco/OperationQueueExample","owner":"rodrigofrancisco","description":"Example to show how to handle fetched data from REST API using OperationQueue instead GCD","archived":false,"fork":false,"pushed_at":"2021-10-12T16:59:23.000Z","size":423,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T22:20:09.841Z","etag":null,"topics":["example-code","ios-swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodrigofrancisco.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-24T18:41:18.000Z","updated_at":"2021-10-12T16:59:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"998ad086-75bd-43c2-8e74-37e8bba88e86","html_url":"https://github.com/rodrigofrancisco/OperationQueueExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofrancisco%2FOperationQueueExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofrancisco%2FOperationQueueExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofrancisco%2FOperationQueueExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofrancisco%2FOperationQueueExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigofrancisco","download_url":"https://codeload.github.com/rodrigofrancisco/OperationQueueExample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245128130,"owners_count":20565206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example-code","ios-swift"],"created_at":"2024-11-30T16:06:41.971Z","updated_at":"2025-03-23T16:14:40.353Z","avatar_url":"https://github.com/rodrigofrancisco.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Ejemplo de OperationQueue y Networking\nCreado por Rodrigo Francisco \u003crhodfra@gmail.com\u003e\nVersion 1.0, 24.09.2021\n// Ruta base de las imagenes\n:imagesdir: ./README.assets/ \n// Resaltar sintaxis\n:source-highlighter: pygments\n// Iconos para entorno local\nifndef::env-github[:icons: font]\n// Iconos para entorno github\nifdef::env-github[]\n:caution-caption: :fire:\n:important-caption: :exclamation:\n:note-caption: :paperclip:\n:tip-caption: :bulb:\n:warning-caption: :warning:\nendif::[]\n\nProyecto para el diplomado 5G iOS, módulo 3\n\n[source,sh]\nSeptiembre de 2021\nAutor: rhodfra@gmail.com \nswift 5, iOS 13\n\nEl proyecto muestra como realizar una petición a un servicio REST,\npara posteriormente manejar los eventos subsecuentes utilizando \n`OperationQueue`, `Operation` y/o algún otro mecanismo.\n\nPara ejecutar el proyecto simplemente descargue el repositorio y \nejecute el playground.\n\nEl core de este proyecto se encuentra en el archivo \nlink:./NetworkingWithOperation.playground/Contents.swift[Contents.swift]\n\nimage::cover.png[]\n\n[source,swift]\n----\n// MARK:- Fetching information with NSOperations\nlet queue = OperationQueue()\n// We will be using main operation Queue to update UI Components\nlet mainQueue = OperationQueue.main\n\nvar myImage: UIImage?\nvar metadata: ImageMetadata?\n\nlet operationForImage = BlockOperation(block: {\n    print(\"Started image download\")\n    myImage = downloadImage(imageNumber: 1)\n    print(\"Finished image download\")\n})\n\nlet operationForMetadata = BlockOperation(block: {\n    print(\"Started download metadata\")\n    metadata = downloadMetadata(imageNumber: 1)\n    print(\"Finished download metadata\")\n})\n\nqueue.addOperation(operationForImage)\nqueue.addOperation(operationForMetadata)\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigofrancisco%2Foperationqueueexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigofrancisco%2Foperationqueueexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigofrancisco%2Foperationqueueexample/lists"}