Skip to content

Instantly share code, notes, and snippets.

View LeoAOliveira's full-sized avatar

Leonardo Amorim de Oliveira LeoAOliveira

View GitHub Profile
@LeoAOliveira
LeoAOliveira / PrivacyPolicy
Last active May 24, 2019 23:36
Travelling+ Privacy Policy
Travelling+ Privacy Policy
Information on the app
We do not collect any data from our users. The only data used for the app functionalities
are stored within the phone. At any moment you can delete the data in the app by deleting the app.
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
// Provém um objeto de célula para cada linha.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath)
}
// Retorna o número de linhas para a tabela.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
import UIKit
class TableViewCell: UITableViewCell {
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var titleLabel: UILabel!
}
// Provém um objeto de célula para cada linha.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as! TableViewCell
// Parte 2: Configurar o conteúdo da célula.
cell.titleLabel!.text = "Título"
cell.layer.backgroundColor = UIColor.white as! CGColor
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource {
// ...
}
// MARK: - Table View
// Provém um objeto de célula para cada linha.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath) as! TableViewCell
// Parte 2: Configurar o conteúdo da célula.
cell.titleLabel!.text = "Título"
import UIKit
class CollectionViewCell: UICollectionViewCell {
@IBOutlet weak var collectionViewTextLabel: UILabel!
}
// Retorna o número de itens para a collection.
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
// Provém um objeto de célula para cada item.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
// Parte 1: Buscar uma célula do tipo apropriado.
let cellCollection = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionCell", for: indexPath) as! CollectionViewCell