We've got one more segue
option to explore.
There's a third way to present a view
controller using only a storyboard
segue, no code.
But don't worry.
I haven't forgotten that we still
need to figure out how these
two view controllers should communicate.
We'll get those dice values set,
I promise.
We're going to take this segue that
we added earlier and delete it.
And we'll replace it with a segue that
goes directly from the roll the dice
button to the dice view controller.
We also need to remove the action
from this roll the dice button.
The action that's connected
to touch up inside, that is.
And finally, let's close our
outline view for a second.
Open up the utilities pane,
click on that segue, and
go into the attributes inspector.
That's where we'll set the storyboard
identifier for this segue.
And we're going to call it rollDice.
And now we'll run it.
Our view is appearing as expected,
but still no dice.
I think it's time to get these two view
controllers talking to each other.
لدينا خيار
.تنقل سلس آخر يلزم علينا التعرف عليه
توجد طريقة ثالثة لتقديم وحدة تحكم في view
باستخدام تنقل سلسة في لوحة عمل، وليس
.تعليمة برمجية
!لكن لا تقلقوا
لم أنس أننا لا زلنا بحاجة إلى تحديد طريقة
التواصل بين
.وحدتي التحكم في view هاتين
،وسنحصل على مجموعة قيم الزهر هذه
.أعدكم بذلك
وسنأخذ هذا التنقل السلس
.الذي أضفناه مسبقًا، ثم سنحذفه
وسنجعل مكانه تنقلا سلسًا
ينتقل مباشرة من زر تحريك الزهر
.إلى وحدة التحكم في عرض الزهر
كما أننا بحاجة أيضًا إلى إزالة الإجراء من
.من زر تحريك الزهر هذا
وهذا الإجراء مرتبط
.باللمس في الداخل هذا
وأخيرًا، دعونا نغلق عرض المخطط
.لثانية
،ثم نفتح جزء الأدوات المساعدة
وننقر فوق هذا التنقل السلس، ثم
.نذهب إلى فاحص السمات
وهذا هو الموضع الذي سنعين فيه معرف
.لوحة العمل لهذا التنقل السلس
.وسنسميه rollDice
.وسنقوم الآن بالتشغيل الآن
،يظهر العرض الخاص بنا كما هو متوقع
.لكن لا يزال الزهر غير موجود
أعتقد أن هذا هو وقت الحصول على وحدتي التحكم في view
.هاتين اللتين تتواصلان مع ببعضهما البعض
Temos mais uma opção de sequência
para explorar.
Há uma terceira maneira de apresentar um view
controller usando apenas uma sequência de
storyboard, nenhum código.
Mas não se preocupe.
Eu não me esqueci de que ainda
precisamos descobrir como esses
dois ViewControllers vão se comunicar.
Vamos definir os valores desses dados,
eu prometo.
Vamos pegar essa sequência que
adicionamos anteriormente e vamos excluí-la.
E nós vamos substituí-la por uma sequência que
vai diretamente do botão
Roll the dice até o DiceViewController.
Nós também precisamos remover a ação
desse botão Roll the dice.
A ação que está conectada
à touch up inside, é isso.
E, finalmente, vamos fechar a nossa
exibição de estrutura de tópicos por um segundo.
Abra o painel de utilitários,
clique na sequência e
vá para o Attributes Inspector.
É aí que vamos definir o identificador de storyboard
para essa sequência.
Vamos chamá-lo de rollDice.
Agora vamos executá-lo.
Nossa exibição está aparecendo como esperávamos,
mas ainda não há dados.
Eu acho que é hora de fazer com que esses viewcontrollers
se comuniquem.