Skip to content

Instantly share code, notes, and snippets.

View PedroFarina's full-sized avatar

Pedro Giuliano Farina PedroFarina

  • Apple Developer Academy | Mackenzie
  • São Paulo
View GitHub Profile
@PedroFarina
PedroFarina / nodes.swift
Last active June 24, 2019 21:57
Types of nodes
import SpriteKit
var nodeGenerico = SKNode()
var nodeComTexto = SKLabelNode()
var nodeComImagem = SKSpriteNode(imageNamed:"imagem.jpg")
var nodeRetangular = SKShapeNode(rect: CGRect(x: 0, y: 0, width: 20, height: 10))
@PedroFarina
PedroFarina / SpriteNodeWithPhysics.swift
Created June 11, 2019 04:46
SpriteNode with PhysicsBody
public class SpriteNodeWithPhysics : SKNode{
var nodeComImagem:SKSpriteNode? //Node que guardará nossa imagem
init(imageNamed:String){
super.init()
nodeComImagem = SKSpriteNode(imageNamed: imageNamed) //Inicializador que cria um node com imagem a partir de um caminho
let texturaDaImagem:SKTexture? = SKTexture(imageNamed: imageNamed) //Inicializador que cria uma textura a partir de um caminho
guard let nodeComImagem = nodeComImagem, let textura = texturaDaImagem else{ //Garantindo que conseguimos criar nossa imagem e textura
fatalError("Não foi possível achar a imagem")
@PedroFarina
PedroFarina / physicsBody.swift
Created June 18, 2019 21:34
Physics Body Constructors
import SpriteKit
var nodeGenerico = SKNode()
//Corpo físico a partir de uma imagem
nodeGenerico.physicsBody = SKPhysicsBody(texture: SKTexture(imageNamed: "name.jpg"), size: CGSize)
//Corpo físico a partir de dois pontos
nodeGenerico.physicsBody = SKPhysicsBody(edgeFrom: CGPoint, to: CGPoint)
@PedroFarina
PedroFarina / GameScene.swift
Created June 19, 2019 20:58
Adding a delegate to a Scene
class GameScene: SKScene, SKPhysicsContactDelegate{
override func sceneDidLoad() {
self.physicsWorld.contactDelegate = self
}
func didBegin(_ contact: SKPhysicsContact) {
//Começou o contato
}
func didEnd(_ contact: SKPhysicsContact) {
@PedroFarina
PedroFarina / nodes.swift
Created June 24, 2019 21:56
Setting up some physicsBodies
//UInt32 é qualquer valor inteiro entre 0 e 4294967295
if let pb = nodeGenerico.physicsBody{
pb.categoryBitMask = UInt32
pb.collisionBitMask = UInt32
pb.contactBitMask = UInt32
}
@PedroFarina
PedroFarina / contact card
Created August 7, 2019 00:18
Pedro Giuliano Farina Contact
Email me at: pedrogfarina@gmail.com
@PedroFarina
PedroFarina / Privacy Policy.md
Created August 7, 2019 00:36
Life Giver Privacy Policy

Privacy Policy

Pedro Giuliano Farina built the Life Giver app as a Free app. This SERVICE is provided by Pedro Giuliano Farina at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Life Giver unless otherwise defined in this Privacy Policy.

@PedroFarina
PedroFarina / Privacy Policy.md
Last active November 6, 2019 19:41
QR Bell Privacy Policy

Privacy Policy

Pedro Farina, Wolfgang Walder, Julia Santos built the QR Bell app as a Free app. This SERVICE is provided by Pedro Farina, Wolfgang Walder, Julia Santos at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at QR Bell unless otherwise defined in this Privacy Policy.

@PedroFarina
PedroFarina / Privacy Policy.md
Last active December 28, 2019 21:33
Tokyo Jack Privacy Policy

Privacy Policy

Pedro Giuliano Farina, Pedro Guedes, Eloisa Falcão, Felipe Petersen, Iago Salomon, Luiz Henrique Carvalho, Guilherme Enes and Joaquim Pessoa Filho built the Tokyo Jack app as a Free app. This SERVICE is provided by Pedro Giuliano Farina at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Tokyo Jack unless otherwise defined in this Privacy Policy.

@PedroFarina
PedroFarina / SiriKit.md
Last active March 24, 2020 19:02
Siri Infos

Siri Kit

Criar uma integração com a Siri no seu aplicativo pode ser útil para muitas coisas, mas a mais encontrada na pesquisa e no meu próprio interesse é a facilidade, removendo barreiras para quem usa seu app.

Pré requisitos

A implementação da Siri está disponível apenas a partir do iOS 12.

Como funciona