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 CoreLocation | |
class LocationManager: NSObject, CLLocationManagerDelegate { | |
//MARK: Object to Access Location Services | |
private let locationManager = CLLocationManager() | |
//MARK: Set up the Location Manager Delegate | |
override init() { | |
super.init() |
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
struct Product { | |
let name: String | |
let type: String | |
let description: String | |
let imageName: String | |
} | |
struct ProductPageView: View { | |
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 SwiftUI | |
import SpriteKit | |
protocol SquareGameLogicDelegate { | |
var totalScore: Int { get } | |
mutating func addPoint() -> Void | |
} | |
// 1. Conform the ContentView to the SquareLogicDelegate protocol |
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
// CoffeeTimeApp.swift | |
// Created by Tiago Pereira on 23/07/21. | |
import SwiftUI | |
@main | |
struct CoffeeTimeApp: App { | |
// 8. Set up our class as the application delegate | |
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate |
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
// Xcode 13 + iOS 15 | |
struct CareKitDetailedCardView: View { | |
var body: some View { | |
VStack(alignment: .leading) { | |
// The header of the card | |
// - Photo, Full Name and Professional Title | |
HStack { | |
Circle() | |
.frame(width: 40, height: 40) | |
.foregroundColor(.gray) |
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
/* | |
O que é um Property List (PList)? | |
- Ref: [Apple: About Info.plist](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html) | |
- Ref: [Apple: Introduction to Property Lists](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html) | |
- Ref: [](https://makeapppie.com/2016/02/11/how-to-use-property-lists-plist-in-swift/) | |
É um tipo de arquivo que pode armazenar informações de maneira estruturada. | |
Um plist é um arquivo que utiliza um notação XML para organizar a informaçã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
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
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
/*: | |
## 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) | |
NewerOlder