Skip to content

Instantly share code, notes, and snippets.

View halilozel1903's full-sized avatar
🦅
The rest of the world was black and white 🖤 🤍

Halil Özel halilozel1903

🦅
The rest of the world was black and white 🖤 🤍
View GitHub Profile
@IBAction func btnClicked(_ sender: Any) {
// Alert ile ilgili işlemler yapılacak.
}
@IBAction func btnClicked(_ sender: Any) {
// alert dialog ile ilgili ayarlar yapıldı.
let alert = UIAlertController(title: "Alert", message: "Very critical alert", preferredStyle: .alert)
let okButton = UIAlertAction(title: "OK", style: .cancel, handler: nil) // tamam butonu tanımı
alert.addAction(okButton) // action eklendi.
// yapıları görüntülemede kullanılır.
self.present(alert, animated: true, completion: nil) // completion : işlem sonrası birşeyler yapılacak mı ?
}
@IBAction func signClicked(_ sender: Any) {
}
@IBOutlet weak var usernameTxt: UITextField!
@IBOutlet weak var passwordTxt: UITextField!
@IBOutlet weak var passwordAgainTxt: UITextField!
if usernameTxt.text == "" && passwordTxt.text == "" {
let alert = UIAlertController(title: "Alert", message: "Username and Password is empty", preferredStyle: .alert)
let okButton = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alert.addAction(okButton)
self.present(alert, animated: true, completion: nil)
}
else if passwordTxt.text == ""{
@IBAction func changeClicked(_ sender: Any) {
}
var number = 0 // number adında bir degisken tanımlandı.
@IBOutlet weak var image: UIImageView! // image tanımlandı.
@IBAction func changeClicked(_ sender: Any) {
if number == 0 {
image.image = UIImage(named: "tr.png")
number = number + 1
}else if number == 1{
image.image = UIImage(named: "az.gif")
number = number - 1
}
@IBOutlet weak var imageView: UIImageView! // image view tanım
@IBOutlet weak var etFruit: UILabel! // label tanımı
override func viewDidLoad() {
super.viewDidLoad()
imageView.isUserInteractionEnabled = true // tıklanabilirlik özelliği eklendi.
let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.changePic))
imageView.addGestureRecognizer(gestureRecognizer) // Ekrana yapılan dokunmaları takip eden metoddur.
}