This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).
PHP 5.6 installed with Homebrew.
Download the following files from Oracle website (yes, you need to create an account and accept terms):
| //addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
| (function(win, doc){ | |
| if(win.addEventListener)return; //No need to polyfill | |
| function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
| function addEvent(on, fn, self){ | |
| return (self = this).attachEvent('on' + on, function(e){ | |
| var e = e || win.event; | |
| e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
| e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |
| class PickerSource : NSObject, UIPickerViewDelegate, UIPickerViewDataSource { | |
| var data: [[String]] = [] | |
| var selectionUpdated: ((component: Int, row: Int) -> Void)? | |
| // MARK: UIPickerViewDataSource | |
| func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { | |
| return data.count | |
| } |
| import UIKit | |
| class SimplePickerView : UIPickerView { | |
| class SimplePickerViewModel : NSObject, UIPickerViewDelegate, UIPickerViewDataSource { | |
| var titles: [String] | |
| var selectionHandler: ((_ pickerView: UIPickerView, _ row: Int, _ title: String) -> ())? | |
| init(titles: [String], selectionHandler: ((_ pickerView: UIPickerView, _ row: Int, _ title: String) -> ())? = nil) { |
This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).
PHP 5.6 installed with Homebrew.
Download the following files from Oracle website (yes, you need to create an account and accept terms):
| import Foundation | |
| import UIKit | |
| extension UIControl { | |
| func listen(_ action: @escaping () -> (), for controlEvents: UIControlEvents) -> AnyObject { | |
| let sleeve = ClosureSleeve(attachTo: self, closure: action, controlEvents: controlEvents) | |
| addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents) | |
| return sleeve | |
| } | |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| #---------------------------------------------------------------- | |
| # PREVENT YOUR CODEBASE GETTING SPOILED BY DEVELOPERS | |
| # - YOU NEED TO THIS pre-commit file (without any extension) | |
| # at ".git/hooks/" folder. | |
| # - THEN TRY TO PUT WRONG STYLED/LINT CODE | |
| #---------------------------------------------------------------- | |
| branch="$(git rev-parse --abbrev-ref HEAD)" | |
| #---------------------------------------------------------------- |