Error handling Hata ayıklama

in #utopian-io7 years ago (edited)

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**






  • 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

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.18
TRX 0.16
JST 0.030
BTC 64236.48
ETH 2519.13
USDT 1.00
SBD 2.66