#Information we collect and store
We do not collect any data from our users. the only data we use for this app functionalities are stored within the phone. The stored data can be deleted by the user at any moment by deleting the app.
#Information we collect and store
We do not collect any data from our users. the only data we use for this app functionalities are stored within the phone. The stored data can be deleted by the user at any moment by deleting the app.
#Contact Information
Contact us here: cahortega@outlook.com
lazy var dias: [UIButton] = [dom, seg, ter, qua, qui, sex, sab] |
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var dom: UIButton! | |
@IBOutlet weak var seg: UIButton! | |
@IBOutlet weak var ter: UIButton! | |
@IBOutlet weak var qua: UIButton! | |
@IBOutlet weak var qui: UIButton! | |
@IBOutlet weak var sex: UIButton! | |
@IBOutlet weak var sab: UIButton! |
override func viewDidLoad() { | |
super.viewDidLoad() | |
dom.tag = 1 | |
seg.tag = 2 | |
ter.tag = 3 | |
qua.tag = 4 | |
qui.tag = 5 | |
sex.tag = 6 | |
sab.tag = 7 |
let diaDaSemanaAtual = Calendar.current.component(.weekday, from: Date())-1 | |
//Este é o valor que irá nos mostrar em que dia da semana estamos (Ex: segunda, terça, etc). | |
//O -1 é necessário para igualar as posições do dia com as posições dos botões no vetor | |
var diaAtual = Calendar.current.component(.day, from: Date()) | |
//Dia atual (Ex: 1, 2, 31, etc). | |
var mesAtual = Calendar.current.component(.month, from: Date()) | |
//Mês atual (Ex: janeiro, fevereiro, etc). | |
//Esse valor é necessário para verificarmos o número de dias de cada mês |
dias[diaDaSemanaAtual].backgroundColor = UIColor.systemTeal | |
dias[diaDaSemanaAtual].titleLabel?.font = .systemFont(ofSize: 13, weight: .semibold) |
func calendario() { | |
var diaDepois = diaAtual | |
var diaAntes = diaAtual | |
for dia in diaDaSemanaAtual ... 6 { //Para saber qual é o próximo dia | |
dias[dia].setTitle("\(diaDepois)", for: .normal) | |
switch mesAtual { | |
case 1, 3, 5, 7, 8, 10, 12: //Meses com 31 dias | |
if diaDepois == 31 { | |
diaDepois = 1 |
func calendario() { | |
var diaDepois = diaAtual | |
var diaAntes = diaAtual | |
for dia in diaDaSemanaAtual ... 6 { //Para saber qual é o próximo dia | |
dias[dia].setTitle("\(diaDepois)", for: .normal) | |
switch mesAtual { | |
case 1, 3, 5, 7, 8, 10, 12: //Meses com 31 dias | |
if diaDepois == 31 { | |
diaDepois = 1 |
override func viewDidLoad() { | |
super.viewDidLoad() | |
dias[diaDaSemanaAtual].backgroundColor = UIColor.systemTeal | |
dias[diaDaSemanaAtual].titleLabel?.font = .systemFont(ofSize: 13, weight: .semibold) | |
dom.tag = 1 | |
seg.tag = 2 | |
ter.tag = 3 | |
qua.tag = 4 | |
qui.tag = 5 |