This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
#include <cstdio> | |
#define DIREITA -1 | |
#define ESQUERDA 1 | |
#define SOBRE 0 | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the Activity Indicator | |
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) | |
// Add it to the view where you want it to appear | |
view.addSubview(activityIndicator) | |
// Set up its size (the super view bounds usually) | |
activityIndicator.frame = view.bounds | |
// Start the loading animation | |
activityIndicator.startAnimating() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code bellow must be written in your Table View Controller | |
// Remember to use your own classes and properties when creating your own search. | |
// 1. Create a new property in your class | |
// The Search Controller is the responsible to do the "searching magic" | |
let searchController = UISearchController(searchResultsController: nil) | |
// 2. At the viewDidLoad() add those initializations | |
searchController.searchResultsUpdater = self // You will get an error here for now, but it will vanish at step number 5 | |
searchController.dimsBackgroundDuringPresentation = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Creating the AlertController | |
let alert: UIAlertController = UIAlertController(title: "Teste", | |
message: "Aprendendo a fazer alertas", | |
preferredStyle: .alert) | |
// 1.1. Create the actions | |
let okAction = UIAlertAction(title: "OK", style: .default) { (okAction) in | |
// Insert here the code to be executed when the user select the action | |
print("O usuário escolheu: \(okAction.title!)") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Referencias | |
// - https://www.appcoda.com/ios10-user-notifications-guide/ | |
// - http://useyourloaf.com/blog/local-notifications-with-ios-10/ | |
// - https://makeapppie.com/2016/08/08/how-to-make-local-notifications-in-ios-10/ | |
// - https://developer.apple.com/reference/usernotifications | |
//: Local notifications | |
// 1. Importe o framework UserNotifications | |
import UserNotifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dissmiss keyboard iOS | |
// Referências | |
// - http://stackoverflow.com/questions/18755410/how-to-dismiss-keyboard-ios-programmatically | |
// Existem algumas formas de esconder o teclado no iOS | |
// Aqui vamos ver algumas delas! | |
// 1. Implementando o UITextFieldDelegate e quando o usuário | |
// apertar no RETURN do teclado, terminamos a edição. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*: | |
Simples tutorial sobre como utilizar a Camera e a Biblioteca de fotos para capturar imagens e utilizá-las em seu aplicativo | |
Referências: | |
- https://makeapppie.com/2016/06/28/how-to-use-uiimagepickercontroller-for-a-camera-and-photo-library-in-swift-3-0/ | |
- https://turbofuture.com/cell-phones/Access-Photo-Camera-and-Library-in-Swift | |
Antes de qualquer coisa, precisamos pedir autorização do usuário para acessarmos a camera e a biblioteca de fotos. | |
Para isso vá no info.plist e adicione as seguintes chaves: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Como transformar Date em String? | |
let today = Date() | |
// 1: Criamos um NSDateFormatter | |
let dateFormatter = DateFormatter() | |
// 2: Definimos o formato da data | |
dateFormatter.dateFormat = "EEE, dd MMM yyy hh:mm:ss +zzzz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*: | |
## Tutorial de UIPageViewController | |
Referências: | |
- [How to Use UIPageViewController in Swift 2.2](https://spin.atomicobject.com/2015/12/23/swift-uipageviewcontroller-tutorial/) | |
- [How to Move Page Dots in a UIPageViewController with Delegation](https://spin.atomicobject.com/2016/02/11/move-uipageviewcontroller-dots/) | |
- [](https://developer.apple.com/reference/uikit/uipageviewcontroller) | |
- [](https://developer.apple.com/reference/uikit/uipageviewcontrollerdatasource) | |
- [](https://developer.apple.com/reference/uikit/uipageviewcontrollerdelegate) | |
OlderNewer