Skip to content

Instantly share code, notes, and snippets.

@mauricioconde
mauricioconde / DetailNoteViewController.Swift
Last active August 29, 2019 21:15
iOS Programming. Cretate a Simple Table View App - View Controller for 'Detail note' view
import UIKit
class DetailNoteViewController: UIViewController {
@IBOutlet var titleLbl: UILabel!
@IBOutlet var descLbl: UILabel!
@IBOutlet var dateLbl: UILabel!
@IBOutlet var iconImg: UIImageView!
var note: Note!
@mauricioconde
mauricioconde / TableViewController.swift
Last active August 29, 2019 21:15
iOS Programming.Cretate a Simple Table View App - ViewController
import Foundation
class TableViewController: UITableViewController {
let updateSound = URL(fileURLWithPath: Bundle.main.path(forResource: "update", ofType: "mp3")!)
var audioPlayer = AVAudioPlayer()
var refreshCntrl:UIRefreshControl!
var items: [Note] = []
// MARK: - Life cycle
@mauricioconde
mauricioconde / Note.swift
Last active August 29, 2019 21:16
iOS Programming. Cretate a Simple Table View App - POJO for manage new Note objects
import UIKit
struct Note {
var title: String
let shortDesc: String
let fullDesc: String
let createdTime: Date
let img: String
var formattedDate: String {
@mauricioconde
mauricioconde / NoteCell.swift
Last active August 29, 2019 21:16
iOS Programming. Cretate a Simple Table View App - Script to manage custom UITableViewCell
import UIKit
@IBDesignable class NoteCell: UITableViewCell {
static let nibName = "NoteCell"
static let cellID = "NoteCell"
@IBOutlet var titleLbl: UILabel!
@IBOutlet var descLbl: UILabel!
@IBOutlet var dateLbl: UILabel!
@IBOutlet var iconImg: UIImageView!