Swift Class Struct yapısı kavramı,

in #utopian-io7 years ago (edited)

Selamlar , Bugün " Class Struct " Yapısından bahsettim . Kodlamadaki bu yapılarımız , farklı tiplerde eleman içerebilir ve dosya içinde tutulacak kayıtları oluşturmakta kullanılır . Videoda anlatmaya çalıştım ve kodlama şekillerinden örnekler verdim . Kafanız karışmaması için videoyu 2 ye böldüm . İyi seyirler , iyi dersler .

Greetings, Today I mentioned "Class Struct" Structure. These constructions in coding can include elements in different types and are used to create records to be kept in a file. I tried to tell the videoda and gave examples of the coding styles. I was bumped up to video 2 to avoid confusion. Good looking, good lessons.



Projemizin Kodları
(Project Code)


import UIKit

**// Class ve Struct (Sınıf ve Yapılar)**

**//Nesne Tabanlı Programlamanın Temeli - OOP**

**//Farklar**

**// 1- Miras alma olayı Class'a has özelliktir**

**// 2- Struct için init zorunlu değildir**

class Arac{

    

    var tekerlekSayisi:Int

    var renk:String

let bmw = Arac()

bmw.renk = "Siyah"

bmw.tekerlekSayisi = 5

bmw.renk

bmw.tekerlekSayisi

class Araba:Arac  Araba sınıfı Arac sınıfından miras aldı - inherit Arac = super calass base class

{

    var model = 0

    var yakitTipi = "Benzinli"

}

let araba = Araba()

print("araba renk: \(araba.renk)")

let araba2 = araba

print("araba2 renk : \(araba2.renk)")

araba.model

araba.yakitTipi = "Tüplü"

araba.renk = "Beyaz"

print("araba yeni renk: \(araba.renk)")

print("araba2 son renk: \(araba2.renk)")

 Reference Type -> örnek alınan nesneyi değiştirince değere referans alınan diğer değerlerde değişir

Value Type -> String,Int,Dict,Enum,Struct,Double

var a = 5

var b = a

a = 6

print("a son değeri: \(a)")

print("b son değeri: \(b)")

 Miras olayı Struct yapısında yoktur





  • Video ya ingilizce çeviri yapana " 1 SBD " Ödül verilecektir

  • The person who makes video or english translation will be awarded "1 SBD".


Videoma ingilizce çeviri yapabilirsiniz
English subtitles can be added to the video.

Kodlara github adresimden'de ulaşabilirsiniz
You can access the code file from my "Githup" account

Önceki derslerimiz / Previous lessons.**




Posted on Utopian.io - Rewarding Open Source Contributors



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @kerimcaglar I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 57653.84
ETH 2354.20
USDT 1.00
SBD 2.35