NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import UIKit //spinner imgView resim degistirme

class ViewController: UIViewController,UIPickerViewDataSource,UIPickerViewDelegate {


var rdizi = ["aslan.jpg","kedi.jpg","kopek.jpg","tavsan.jpg"]
var adizi = ["Aslan","Kedi","Kopek","Tavşan"]

@IBOutlet weak var lbltext: UILabel!
@IBOutlet weak var resim: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return Int(rdizi.count)
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return rdizi[row].description
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
resim.image = UIImage(named: rdizi[row])
lbltext.text = adizi[row]

}

}
------------------------------------------------
import UIKit //spinner vize final

class ViewController: UIViewController,UIPickerViewDelegate,UIPickerViewDataSource {

var vize = 10
var final = 10
var NotDizi = [10,20,30,40,50,60,70,80,90,100]

@IBOutlet weak var picker2: UIPickerView!
@IBOutlet weak var lblSonuc: UILabel!
@IBOutlet weak var picker1: UIPickerView!
override func viewDidLoad() {
super.viewDidLoad()

}



func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return NotDizi.count


}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return String(NotDizi[row])
}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
if pickerView == picker1
{
vize = NotDizi[row]

}
if pickerView == picker2
{
final = NotDizi[row]

}


}


@IBAction func btnClicked(_ sender: Any) {

var ort = ( Double(vize) * 0.40) + (Double(final) * 0.60)

switch ort {
case 0...30 :

lblSonuc.text = ort.description


case 31...60 :

lblSonuc.text = ort.description
self.view.backgroundColor = UIColor.black

default: lblSonuc.text = "büt"
}

}


}


import UIKit //hesap makinesi

class ViewController: UIViewController {


@IBOutlet weak var txtS1: UITextField!

@IBOutlet weak var txts2: UITextField!

@IBOutlet weak var lblSonuc: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.

}


@IBAction func topla(_ sender: Any) {
var sonuc = Int(txtS1.text!)! + Int(txts2.text!)!
lblSonuc.text = sonuc.description
self.view.backgroundColor = UIColor.green
}

@IBAction func cıkar(_ sender: Any) {
var sonuc = Int(txtS1.text!)! - Int(txts2.text!)!
lblSonuc.text = sonuc.description
self.view.backgroundColor = UIColor.red
}

@IBAction func bol(_ sender: Any) {
var sonuc = Int(txtS1.text!)! / Int(txts2.text!)!
lblSonuc.text = sonuc.description
self.view.backgroundColor = UIColor.purple
}

@IBAction func carpma(_ sender: Any) {
var sonuc = Int(txtS1.text!)! * Int(txts2.text!)!
lblSonuc.text = sonuc.description
self.view.backgroundColor = UIColor.blue
}
@IBAction func temizle(_ sender: Any) {
self.view.backgroundColor = UIColor.black
txtS1.text = ""
txts2.text = ""
lblSonuc.text = "Sonuc :"
txts2.placeholder = "Sayı 1"
txtS1.placeholder = "sayı 1"
}

}

------------------------

import UIKit //tarih

class ViewController: UIViewController {


@IBOutlet weak var lbldakika: UILabel!
@IBOutlet weak var lblgun: UILabel!
@IBOutlet weak var lblsaat: UILabel!
@IBOutlet weak var datepicker: UIDatePicker!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}


@IBAction func picker(_ sender: Any) {
let tarih = DateFormatter()
tarih.dateFormat = "dd:MM:yyyy"
let strTarih = tarih.string(from: datepicker.date)
lblgun.text = "Tarih :" + strTarih
tarih.dateFormat = "hh:mm"
lblsaat.text = tarih.string(from: datepicker.date)
}
}
--------------------
import UIKit //resim tıklama resim degistirme

class ViewController: UIViewController {
var i = -1
@IBOutlet weak var imgView: UIImageView!



@IBOutlet weak var lblSonuc: UILabel!

var resimDizi = ["aslan.jpg","kedi.jpg","kopek.jpg","tavsan.jpg"]

var acıklamaDizi = ["aslan resmi","kedi resmi" ,"kopek resmi", "tavsan resmi"]

override func viewDidLoad() {
super.viewDidLoad()

let tiklaResim = UITapGestureRecognizer(target: self, action: #selector(tiklamaIslemi))
imgView.addGestureRecognizer(tiklaResim)
imgView.isUserInteractionEnabled = true

let lblDegistir = UITapGestureRecognizer(target: self, action: #selector(ResimTikla))

lblSonuc.addGestureRecognizer(lblDegistir)
lblSonuc.isUserInteractionEnabled = true



}

@objc func tiklamaIslemi()
{
i = i + 1
if i >= resimDizi.count
{
i = 0
}

imgView.image = UIImage(named: String(resimDizi[i]))
lblSonuc.text = acıklamaDizi[i].description

}

@objc func ResimTikla()
{
i = i + 1
if i >= acıklamaDizi.count
{
i = 0
}

imgView.image = UIImage(named: String(resimDizi[i]))
lblSonuc.text = acıklamaDizi[i].description

}



}
--------------------

import UIKit //spinner sıralama

class ViewController: UIViewController,UIPickerViewDelegate,UIPickerViewDataSource
{


var sayiDizi = [10,20,30,40,50,60,70,80,90]
var islemler = ["Toplamları","Ortalaması","KücükdenBüyüge","Büyükden Kücüge","En Kücük","En Büyük"]

@IBOutlet weak var pickerView: UIPickerView!

@IBOutlet weak var lblResult: UILabel!


override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return Int(islemler.count)
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}

func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {

return islemler[row].description

}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {

if row == 0
{
var toplam:Int = 0

for i in 0..<sayiDizi.count
{
toplam = toplam + sayiDizi[i]
lblResult.text = toplam.description

}

}


if row == 1
{
var toplam:Int = 0

for i in 0..<sayiDizi.count
{
toplam = toplam + sayiDizi[i]
var ort = toplam/sayiDizi.count
lblResult.text = ort.description

}

}

if row == 2
{
var sonuc = sayiDizi.sorted()
lblResult.text = sonuc.description
}

if row == 3
{
lblResult.text = sayiDizi.sorted(by: >).description
}

if row == 5
{
lblResult.text = sayiDizi.max()?.description
}

if row == 4
{
lblResult.text = sayiDizi.min()?.description
}







}



}
-----------------
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.