In the previous lesson,
we looked at different ways that one
view controller can present another.
In this lesson, we're going to learn
about the delegate design pattern.
Many of the most common views in
UIKit use this design pattern,
including text views, pickers,
tables, and collections.
Delegates are used to make important
connections between model, view, and
controller.
We'll start out by focusing on how
the delegate pattern is used with
text fields.
،في الدرس السابق
ألقينا نظرة على طرق مختلفة من الممكن أن تعرض بها
.وحدة تحكم في العرض وحدة أخرى
في هذا الدرس، سنتعلم عن
.نمط تصميم المفوض
العديد من العروض الأكثر شيوعًا في
،UIKit تستخدم نمط التصميم هذا
،بما في ذلك عروض النص، وأدوات الالتقاط
.والجداول، والمجموعات
يستخدم المفوضون لإنشاء
،اتصالات مهمة بين النموذج، والعرض
.ووحدة التحكم
سنبدأ بالتركيز على كيفية استخدام
نمط المفوض مع
.حقول النص
Na lição anterior,
nós vimos as diferentes maneiras de como um
ViewController pode apresentar outro.
Nesta lição, vamos aprender
sobre o padrão de design do delegado.
Muitas das exibições mais comuns no
kit de UI usam esse padrão de design,
incluindo textView, seletores,
tabelas e coleções.
Os delegados são usados para fazer conexões importantes
entre o modelo, a exibição e o
controlador.
Vamos começar nos concentrando em como
o padrão do delegado é usado com
campos de texto.