Skip to content

Instantly share code, notes, and snippets.

View JFSene's full-sized avatar

Joe JFSene

  • Brazil
View GitHub Profile
@JFSene
JFSene / README-Template.md
Created July 16, 2018 14:07 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JFSene
JFSene / PulseButton.swift
Created October 4, 2017 16:35
Pulse Animation
func animationScaleEffect(view:UIView,animationTime:Float) {
UIView.animateWithDuration(NSTimeInterval(animationTime), animations: {
view.transform = CGAffineTransformMakeScale(0.6, 0.6)
},completion:{completion in
UIView.animateWithDuration(NSTimeInterval(animationTime), animations: { () -> Void in
view.transform = CGAffineTransformMakeScale(1, 1)
})
@JFSene
JFSene / RN-cheat-sheet.css
Created July 5, 2017 14:11
React-Native CSS like style
Valid keys: [
"display",
"width",
"height",
"top",
"left",
"right",
"bottom",
"minWidth",
"maxWidth",
let version = Bundle.main.infoDictionary["CFBundleShortVersionString"] as! String
releaseVersionLabel.text = "v\(version)"
static func alertMessage(errorMessage: String, controller: UIViewController, title: String) {
let alertController = UIAlertController(title: title, message: errorMessage, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default, handler: nil)
alertController.addAction(okAction)
controller.present(alertController, animated: true, completion: nil)
}
static func alertMessageNav(errorMessage: String, controller: UIViewController, title: String, cHandler: @escaping (Void)-> () ) {
let alertController = UIAlertController(title: title, message: errorMessage, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default, handler: {(action:UIAlertAction) in
@JFSene
JFSene / pickerview.swift
Created March 27, 2017 14:36
Add multiple buttons to PickerView's Toolbar
let picker: UIPickerView
picker = UIPickerView(frame: CGRectMake(0, 200, view.frame.width, 300))
picker.backgroundColor = .whiteColor()
picker.showsSelectionIndicator = true
picker.delegate = self
picker.dataSource = self
let toolBar = UIToolbar()
toolBar.barStyle = UIBarStyle.Default
import UIKit
class CollectionViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
@IBOutlet weak var cv: UICollectionView!
let arrayFotos = (1...14).map {
UIImage(named: "\($0).jpg")
}
let cellIdentifier = "CollectionViewCell"
@JFSene
JFSene / btnLabels.swift
Created January 14, 2017 19:36
Setting animation and labels to btns
switch index {
case 0:
UIView.animate(withDuration: 0.3, animations: {
self.btnIniciarOUTLET.setTitle("Próximo", for: .normal)
self.btnIniciarOUTLET.alpha = 1
})
case 1:
UIView.animate(withDuration: 0.3, animations: {
self.btnIniciarOUTLET.setTitle("Próximo", for: .normal)
self.btnIniciarOUTLET.alpha = 1
@JFSene
JFSene / UIView extension for autoLayout
Created January 14, 2017 04:43
A fast and easy autoLayout extesion for your cells
extension UIView {
func anchorToTop(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil) {
anchorWithConstantsToTop(top, left: left, bottom: bottom, right: right, topConstant: 0, leftConstant: 0, bottomConstant: 0, rightConstant: 0)
}
func anchorWithConstantsToTop(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0) {
@JFSene
JFSene / Swift and Soap Web Service
Created November 23, 2016 16:10 — forked from dethbiscuit/Swift and Soap Web Service
Swift and Soap Web Service
//
// Call a soap web service
//
// Add
// NSURLConnectionDelegate
// NSXMLParserDelegate
class MapViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate, NSURLConnectionDelegate, NSXMLParserDelegate{
@IBOutlet weak var mapKit: MKMapView!
var wsUrl : String = "http://mobilewebservice.greenmotion.ch/MobileEvpass.asmx"