Skip to content

Instantly share code, notes, and snippets.

View ivangodfather's full-sized avatar
🍂

Ivan Ruiz ivangodfather

🍂
View GitHub Profile
$body = file_get_contents('php://input');
$customer = $body['customer'];
ini_set("log_errors", 1);
ini_set("error_log", "$root/php-error.log");
error_log(print_r($customer, true));
Optional({"right":{"test2":"test2","test1":"test1"},"wrong":[{"test2":"test2","test1":"test1"},{"test2":"test2","test1":"test1"}],"again_right":{"dummy2":{"test2":"test2","test1":"test1"},"dummy1":{"test2":"test2","test1":"test1"}},"again_wrong":[{"test2":"test2","test1":"test1"},{"test2":"test2","test1":"test1"}]})
Optional(again_right%5Bdummy2%5D%5Btest2%5D=test2&again_right%5Bdummy2%5D%5Btest1%5D=test1&again_right%5Bdummy1%5D%5Btest2%5D=test2&again_right%5Bdummy1%5D%5Btest1%5D=test1&again_wrong%5B%5D%5Btest2%5D=test2&again_wrong%5B%5D%5Btest1%5D=test1&again_wrong%5B%5D%5Btest2%5D=test2&again_wrong%5B%5D%5Btest1%5D=test1&right%5Btest2%5D=test2&right%5Btest1%5D=test1&wrong%5B%5D%5Btest2%5D=test2&wrong%5B%5D%5Btest1%5D=test1&wrong%5B%5D%5Btest2%5D=test2&wrong%5B%5D%5Btest1%5D=test1)
var currentSelectedAddress: Address? {
get {
if currentSelectedAddress == nil {
return (addresses.count > 0) ? addresses.first : nil
}
return currentSelectedAddress
}
set { ///???
UIView.beginAnimations(nil, context: nil)
UIView.setAnimationDuration(1)
UIView.setAnimationCurve(UIViewAnimationCurve.EaseIn)
let radians = CGFloat(180 * M_PI / 180)
arrowImageView.transform = CGAffineTransformMakeRotation(radians)
UIView.commitAnimations()
UIView.animateWithDuration(1.0, animations: { () -> Void in
self.arrowImageView.transform = CGAffineTransformMakeRotation(CGFloat(180 * M_PI))
}) { (succeed) -> Void in
}
func annotationView() -> MKAnnotationView {
let annonView = MKAnnotationView(annotation: self, reuseIdentifier: "annotation")
annonView.enabled = true
annonView.canShowCallout = true
let image = UIImage(named: "incident")
let imageView = UIImageView(frame: CGRectMake(0, 0, image!.size.width, image!.size.height))
imageView.image = image?.imageWithRenderingMode(.AlwaysTemplate)
let level = Model.getLevelWithId(incident.levelId)
var color = (level?.color != nil) ? level?.color : UIColor.redColor()
if let data: AnyObject = data where JSON(data)["cost_id"].intValue > 0 {
completion(succeed: true, costId: JSON(data)["cost_id"].intValue)
return
}
var customObject: CustomObject? {
if self.customObject == nil {
self.customObject = CustomObject()
}
return self.customObject
}
var childVC: UIViewController?
@IBOutlet weak var containerView: UIView!
func ChangeViewController() {
childVC?.willMoveToParentViewController(nil)
childVC?.view.removeFromSuperview()
childVC?.removeFromParentViewController()
childVC = storyboard?.instantiateViewControllerWithIdentifier("identifier") as? UIViewController
if let childVC = childVC {
addChildViewController(childVC)