Skip to content

ghada - #26

Open
Ghada14133 wants to merge 1 commit into
Tuwaiq-iOS-ContentTeam-2021:mainfrom
Ghada14133:main
Open

ghada#26
Ghada14133 wants to merge 1 commit into
Tuwaiq-iOS-ContentTeam-2021:mainfrom
Ghada14133:main

Conversation

@Ghada14133

Copy link
Copy Markdown

No description provided.

ansButoon.addTarget(self, action: #selector(foo2), for: .touchDown)
view.addSubview(ansButoon)
}
@objc func foo() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

سمي الدوال باسماء لها دلالة مثل
showNextQuestion

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

لو استخدمتي جملة شرطية كان أسهل, لان بحالتك الان راح يصير كراش بمجرد ما يوصل الى آخر index

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentQuestionIndex += 1
if currentQuestionIndex == questions.count {
    currentQuestionIndex = 0
}

let question: String = questions[currentQuestionIndex]
questionLabel.text = question
answerLabel.text = "???"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

شكرا مررره استاذ على ملاحظاتك القيمة.انشاء الله بسوي التعديلات وارفعها.

currentQuestion += 1
}

@objc func foo2() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

نفس الملاحظة بتسمية الدوال

@Almatrafi-A Almatrafi-A left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

يعطيك العافية يا غادة

ansButoon.addTarget(self, action: #selector(foo2), for: .touchDown)
view.addSubview(ansButoon)
}
@objc func foo() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

لو استخدمتي جملة شرطية كان أسهل, لان بحالتك الان راح يصير كراش بمجرد ما يوصل الى آخر index

ansButoon.addTarget(self, action: #selector(foo2), for: .touchDown)
view.addSubview(ansButoon)
}
@objc func foo() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentQuestionIndex += 1
if currentQuestionIndex == questions.count {
    currentQuestionIndex = 0
}

let question: String = questions[currentQuestionIndex]
questionLabel.text = question
answerLabel.text = "???"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants