Skip to content

Instantly share code, notes, and snippets.

Yasmin Benatti yabenatti

Block or report user

Report or block yabenatti

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yabenatti / uFeature.podspec
Created Mar 7, 2019
Example of a podspec
View uFeature.podspec
# Be sure to run `pod spec lint uFeature.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
# To learn more about Podspec attributes see
# To see working Podspecs in the CocoaPods repo see
# do |s| = 'uFeature'
View HelloWorldObjc.m
- (NSString *)getName {
return @"Yasmin Benatti";
- (void)helloWorld {
NSLog(@"Hello %@", [self getName]);
[self helloWorld];
View helloWorldSwift.swift
func getName() -> String {
return "Yasmin Benatti"
func helloWorld() {
print("Hello " + getName())
View TableViewTutorial03.swift
extension ViewController : UITableViewDelegate {
//1 - método chamado quando uma linha é selecionada
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
//2 - método para definir a altura de cada linha
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 44
View TableViewTutorial02.swift
extension ViewController : UITableViewDataSource {
//1 - primeiro método obrigatório
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
//2 - segundo método obrigatório
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
//3 - crie uma célula com o mesmo identificador de quando registramos a classe
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell", for: indexPath)
View TableViewTutorial01.swift
import UIKit
class ViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
// Do any additional setup after loading the view, typically from a nib.
View DelegateTutorialSecondViewController.swift
import UIKit
protocol SecondViewControllerProtocol {
func didDoSomethingOnSecondViewController(message: String)
class SecondViewController: UIViewController {
//MARK: - Variables
var delegate: SecondViewControllerProtocol?
View DelegateTutorialFirstViewController.swift
import UIKit
class FirstViewController: UIViewController, SecondViewControllerProtocol {
// MARK: - Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "FirstToSecondSegue" {
if let vc = segue.destination as? SecondViewControllerProtocol {
vc.delegate = self
View UIAlertControllerSelectedAnimal.swift
func selectedTheAnimal(animal: Animal) {
let alert = UIAlertController(title:, message: "Selected the: \(", preferredStyle: .alert)
let action = UIAlertAction(title: "OK", style: .cancel, handler: nil);
self.present(alert, animated: true, completion: nil)
View HideKeyboard.swift
// MARK: - Keyboard
@IBAction func hideKeyboard(_ sender: Any) {
You can’t perform that action at this time.