-
Notifications
You must be signed in to change notification settings - Fork 3
Relecture hhk #9
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
base: master
Are you sure you want to change the base?
Conversation
8. Appels réseaux/Content/part1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not say that JSON is popular because it's small, it's popular because it's simple. And you have options smaller than JSON, such as MessagePack
8. Appels réseaux/Content/part1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to introduce the notion of concrete subclass
8. Appels réseaux/Content/part1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like declaring a baseURL, and also a version that you can always override if need be.
8. Appels réseaux/Content/part3.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes tu as raison mais j'en demande déjà beaucoup dans ce chapitre.
8. Appels réseaux/Content/part2.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je vois ce que tu veux dire. J'imaginais que les autres calls seraient dans d'autres classes donc ça ne pose pas de soucis. Comment tu fais les choses toi ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personnellement j'utilise Alamofire, mais simplement le fait d'avoir un effet de bord quand tu fais ton appel réseau est étrange. Par défaut je ne me soucie pas d'executer mon call plusieurs fois, et lorsque le call est lié à une interface utilisateur, je bloque l'interface quand c'est nécessaire.
8. Appels réseaux/Content/part3.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'en parle déjà dans d'autres cours.
8. Appels réseaux/Content/part3.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne connais pas, je vais regarder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comme dit, ça reste une notion très objective-c. Après réflexion, c'est probablement assez avancé, et même si le parallèle est intéressant, ça risque d'apporter beaucoup de confusion
8. Appels réseaux/Content/part3.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne comprends pas bien de quel schéma tu parles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peut-être avec des petites flèches par ci par là pour indiquer quand on override, quand on fait une injection, mais tu as l'idée
8. Appels réseaux/Content/part1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis d'accord. D'autant plus que ça fait redite avec des cours précédents. Je vais partir sur les callbacks.
8. Appels réseaux/Content/part1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK je vais voir merci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si le JSONSerialization n'est pas une option, j'ai découvert ça en cherchant: https://stackoverflow.com/questions/27723912/swift-get-request-with-parameters?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
(comme quoi on en apprend tous les jours)
URLComponents te permet de créer un peu plus proprement tes requêtes GET, si tu veux revisiter cette partie tu peux utiliser ça
8. Appels réseaux/Content/part4.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu as raison, je n'ai jamais utiliser cette fonctionnalité de Swift, c'est pour ça. Comment tu définirais un protocole du coup ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Nous n'avons pas encore parlé en détail des protocoles. On les a seulement survolés. Un protocol définit un ensemble de méthodes et de fonctions qui vont pouvoir être adoptés par un type. En swift le protocol est un concept très puissant, et peut être adopté par une class, un struct ou même un enum. Il permet ensuite de manipuler des types sans avoir à se soucier de ce qu'il y'a derrière. Je peux créer un protocol Weapon avec une méthode shoot() et une variable ammunition, et je pourrais manipuler différents objets sans savoir si j'utilise un lance-pierre ou une mitraillette."
Voilà une proposition. J'ai fait des drafts en essayant d'expliquer l'histoire de l'implémentation, mais ça devient long, et ça n'est pas vraiment le sujet. Du coup c'est passé sous silence, à expliquer au moment voulu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est top, je le prends tel quel merci !
|
@AmbroiseCollon J'ai rajouté les différents éléments dont on a discuté. Tu me diras si tu besoin d'autre chose. Est-ce que tu veux que je clean ma PR en enlevant ce que j'avais mis comme commentaires pour que tu puisse merger les petites modifs, ou est-ce que tu laisses la PR telle quelle et tu intègres les modifs à la main ? |
|
Merci pour ton aide ! J'ai déjà intégré tes motifs à la main donc pas de problème. Je vais rajouter les derniers éléments merci. |

Overall c'est 👍