Selamlar , bu dersimizde " Subscript " Nedir , nasıl kullanılır , nerelerde kullanıldığını anlattım . " Subscript Class,Struct,Enum " elemanlara daha rahat ulaşabilmek için kullanılır . Fazla bulunmayan bilinmeyen bir kavramdır . Fakat videodada dediğim gibi apple kitabında bulunmaktadır . Anlatmak istedim . İyi seyirler , İyi dersler .
Greetings, in this lesson we will tell you what "Subscript" is, how it is used, where it is used. "Subscript Class, Struct, Enum" is used to access elements more easily. It is an unknown concept that is not found much. But as I said on video, he is in apple book. I wanted to tell you. Good looking, Good lectures.
Projemizin Kodları
(Project Code)
import UIKit
struct Arac{
var arabalar = ["Murat","Doğan","Şahin","Serçe","Kartal","BMW"]
func arabaSec(index:Int)->String{
return arabalar[index]
}
}
var araba = Arac()
araba.arabaSec(index: 0)
struct Arac2{
var arabalar2 = ["Murat","Doğan","Şahin","Serçe","Kartal","BMW"]
subscript(index:Int)->String{
return arabalar2[index]
}
}
var araba2 = Arac2()
araba2[0]
// [String:String]
// [String:Int]
class Sehirler{
var iller = ["Adana" : 1, "Adıyaman" : 2 , "Ankara" : 6, "İstanbul" : 34]
subscript(key:String) -> Int{
return iller[key]!
}
}
var sehir = Sehirler()
sehir["Ankara"]
sehir["İstanbul"]
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.**
- LESSON I // LESSON II // LESSON III // LESSON IV // LESSON V // LESSON VI // LESSON VII // LESSON VIII // LESSON IX // LESOON X // LESSON XI // LESSON XII // LESSON XIII
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @kerimcaglar I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit