GitXplorerGitXplorer
T

from-closures-to-async-await

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
112c9cd2a9edcc45198c07e74f3a017d92641f65

Update README.md

TTiagoMaiaL committed 3 years ago
Unverified
fe83d488de4055e456d7af13e8e11ff29f60636e

Rename the fetchProfile task instance

TTiagoMaiaL committed 3 years ago
Unverified
3e47e3448a6ef61ed368382ecc31c016e1415389

Update the project README.md

TTiagoMaiaL committed 3 years ago
Unverified
a160407bf0ac5be3358a3d9b6579ff188c3da2b8

Update the project to use Xcode 13 beta 4

TTiagoMaiaL committed 3 years ago
Unverified
6e54a0002a8951e6a29f25be936b8df8d2d2e0f7

Add sample app screenshot

TTiagoMaiaL committed 4 years ago
Unverified
b78ee92794cda7a8cd585a5b30e5b4eebc47b36c

Add README.md descriptions

TTiagoMaiaL committed 4 years ago

README

The README file for this repository.

From swift closures to async/await

This is a first look at how async/await works in Swift. To experiment with structured concurrency, this repository demonstrates how to refactor a closure based UIKit app to use async/await and Tasks instead.

About the app

This repository contains a very simple app that fetches a profile from Github. It was first implemented using the callback based URLSession, then it was refactored to use the new async/await features.

Refactoring

Once the repository is cloned, there are some tags with each step of this refactoring process:

  • start-async-work -> contains the initial callback based code, ready to be refactored
  • async-httpclient -> the first refactoring effort: make the http client perform() method an async function
  • async-profileservice -> add async versions of the profile service methods
  • async-viewmodel-imagefetcher -> turn the viewmodel and the imagefetcher methods into async functions
  • async-call-from-controller -> initiates the async from a non-async code

Note: most refactoring was done using a toolchain from 05-14-2021, however, the most recent commits to this repository use the latest beta version of Xcode 13 (beta-4).

Useful links: