Selamlar , Bu dersimizde error handling yani hata ayıklama konusunu işledik . Bugün son dersimizi de işleyerek bir konumuza daha elveda diyoruz . Sıradaki konumuz extensions ve generics konusu olacaktır . Yarın bu yapıların videosunu çekeceğim . Bugünlük bu kadar . Görüşürüz . İyi seyirler , iyi dersler .
Greetings, In this lesson we have dealt with error handling. Today we call our last class a goodbye in a position. The next position will be the topic of extensions and generics. Tomorrow I will shoot a video of these structures. That's it for today. Ll see . Good looking, good lessons.
Projemizin Kodları
(Project Code)
import UIKit
**// Error handling - Hata Yakalama**
var ekran = "0.0"
enum HesaplamaHatalari:Error{
case nanHatasi
case InfHatasi
}
func bolme(bolunen:Double, bolen:Double) throws->Double{
guard bolunen != 0 else {
print("Tanımsız Değer")
throw HesaplamaHatalari.nanHatasi
}
guard bolen != 0 else {
print("Inf Hatası")
throw HesaplamaHatalari.InfHatasi
}
return bolunen/bolen
}
do {
try bolme(bolunen: 0, bolen: 0)
} catch HesaplamaHatalari.InfHatasi {
ekran = "HATA"
} catch HesaplamaHatalari.nanHatasi{
ekran = "Tanımsız"
}
//not 100 den büyük olamaz
**## //not negatif olamaz**
**//bolme(bolunen: 1, bolen: 0) // Inf hatası alınır**
**//bolme(bolunen: 0, bolen: 0) // nan hatası alırız**
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
- 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 // LESSON XIV // LESSON XV // LESSON XVI //