Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通信処理 #62

Open
LeoAndo opened this issue Apr 30, 2022 · 3 comments
Open

通信処理 #62

LeoAndo opened this issue Apr 30, 2022 · 3 comments
Labels

Comments

@LeoAndo
Copy link
Owner

LeoAndo commented Apr 30, 2022

URL例

https://sysbird.jp/toriko/api/?apikey=guest&keyword=%E3%82%AB%E3%83%AC%E3%83%BC%E5%91%B3&format=json&max=10
@LeoAndo LeoAndo added the webAPI label Apr 30, 2022
@LeoAndo
Copy link
Owner Author

LeoAndo commented Apr 30, 2022

Codable

Codableプロトコルに準拠することで、JSONのデータ項目名とプログラムの変数名を同じ名前にすると、
JSONを変換した時に、一括して変数にデータを格納することができる。

Codableプロトコルを採用するだけで、JSOnデータとSwiftオブジェクトを双方向にマッピングすることができます。

https://github.com/LeoAndo/ios-training/blob/7432b8d38361873e7a2649f2d5e23af96cc3c6ff/MyOkashi/MyOkashi/OkashiData.swift#L23:L35

@LeoAndo
Copy link
Owner Author

LeoAndo commented Apr 30, 2022

@LeoAndo
Copy link
Owner Author

LeoAndo commented Apr 30, 2022

プロセスとスレッドの関係

コンピュータの世界で、プロセスとはプログラムの実行時に生成されるメモリのこと。
スレッドとは、プロセスから派生するプログラムの処理の流れを意味します。
最近のiOSデバイスは、マルチコアプロセッサが搭載されています。
マルチコアプロセッサが搭載されているt、複数のプロセスを並列で実行することができます。

メインスレッドはプロセスに1つ存在します。その他のスレッドは複数ありそれぞれに処理が行われます。

スクリーンショット 2022-05-01 0 27 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant