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
import UIKit | |
class ViewController: UIViewController { | |
/* | |
Como adicionar elementos na interface pelo código? | |
Cada componente da interface no iOS é um objeto da classe UIView ou que herda da classe UIView. | |
Componentes como botões, labels, image views e table views, possuem sua respectiva classe que por consequência herda de UIView. | |
Toda UIViewController, ou seja, classe que herda de UIViewController, possue uma propriedade chamada view. Essa propriedade se refere a tela da view que a view controller comanda. Quando vamos adicionar componentes na interface pelo código temos que adicionar o componente na view da view controller. |
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
/*: | |
## Usando UserDefaults | |
- [API Reference: UserDefaults](https://developer.apple.com/reference/foundation/userdefaults) | |
O User Defaults é uma forma que temos para armazenar informações a respeito da aplicação, como pequenas configurações e preferências do usuário. | |
Nele podemos armazenar informações em um dicionário. Os tipos de dados que podemos armazenar são: | |
- Data |
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
import UIKit | |
/*: | |
#### Animações básicas | |
- Ref: [Getting Started](https://www.raywenderlich.com/146603/ios-animation-tutorial-getting-started-2) | |
- Ref: [Custom View Controller Presentation Transitions](https://www.raywenderlich.com/146692/ios-animation-tutorial-custom-view-controller-presentation-transitions-2) | |
Para animar componentes do UIKit podemos utilizar o método de animação básico | |
*/ |
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
/*: | |
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
// 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
#include <iostream> | |
#include <cmath> | |
#include <cstdio> | |
#define DIREITA -1 | |
#define ESQUERDA 1 | |
#define SOBRE 0 | |
using namespace std; |
NewerOlder