iOS Tutorial – Begin with swift ( day 8 ) – Properties
รู้จักกับ properties properties คือค่าที่ถูกเก็บและเป็นส่วนหนึ่ง class, structure และ enumeration store properties คือ ค่าคงที่ หรือตัวแปรที่ที่ถูกบันทึก ซึ่งจะหาได้ใน class, structure compute properties คือ ค่าที่ถูกคำนวณขึ้น ซึ่งจะหาได้ใน class, structure, enumeration store properties store properties สามารถจะประกาศเป็น ค่าคงที่(ประกาศด้วย let) หรือตัวแปร (ประกาศด้วย var) ก็ได้ ตัวอย่างการใช้ store properties struct TrackInfo{ var length:Int var currentTime:Int } จากตัวอย่าง เราทำการสร้าง Structure ชื่อ TrackInfo สำหรับไว้ทำการบันทึกข้อมูลรายละเอียดของเพลงแต่ละเพลง โดยเราทำการประกาศ ตัวแปร properties ชื่อว่า Read more about iOS Tutorial – Begin with swift ( day 8 ) – Properties[…]
