Code Monkey home page Code Monkey logo

ios-cw-18's Introduction

جملة الدوران ForEach

في هذا التمرين سنقوم بعمل صور الإيموجي كما هو موضح بالصورة.

emoji

عمل كود للمصفوفة :

var emooji = ["your emojis here"] 

عمل كود forEach :

ForEach(0..<3) { oneEmoji in

Text("\(emooji[oneEmoji])")

}

تمرين

قم بعمل fork من رابط gitHub ، ثم قم بإنشاء تطبيق جديد في XCode.

1. قم بعمل مصفوفة تحتوي على أشكال الإيموجي، ستكون من نوع string.

2. سيكون هناك ٣ من ForEach و ٣ hstack .وكل ForEach ستكون في hstack ، وهذه الثلاثه ستكون داخل vstack .

3. طريقة ترتيب العناصر المصفوفه موجوده تحت

مساعدة صغيرة : لإظهار نص الإيموجي بجميع اشكاله، فيجب عمل الدوران بهذه الطريقة .

// لعمل الصف الأول للثلاث ٣ ايموجي

ForEach(0..<3) { oneEmoji in

                Text("\(emooji[oneEmoji])")

}

// لعمل الصف الثاني للثلاث ٣ ايموجي، نغير الدوران نخليه من ٣ إلى أقل من ٦

// لعمل الصف الثالث للثلاث ٣ ايموجي، نغير الدوران نخليه من ٦ إلى أقل من ٩


بونس ✨✨✨

يمكن عمل واختصار الخطوة الثانية ب اثنان من ForEach في داخل بعض ، أحدهما سيكون عمودي والآخر أفقي.

مساعدة صغيرة : لإظهار نص الإيموجي بجميع اشكاله، فيجب إدخال هذه العمليات الحسابية البسيطة.

Text("\(emoji[(horizontalForEach+verticalForEach)+verticalForEach+verticalForEach])")

حيث ان horizontalForEach هو forEach الافقي ، و verticalForEach هو forEach العمودي.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.