Skip to content

Instantly share code, notes, and snippets.

View DanielAsher's full-sized avatar
🕺

Daniel Asher DanielAsher

🕺
  • LEXI LABS
  • London
View GitHub Profile
@DanielAsher
DanielAsher / Hello.swift
Created January 18, 2020 09:51
Saying hi in swift
func sayHi() -> String {
return "Hello Dubi"
}
//: Playground - for Noa 💝
// http://adventofcode.com/2017/day/1
// author: Daniel Asher
func string2Array(number: String) -> [Int] {
var result: [Int] = []
for numeral in number {
result.append(Int(String(numeral))!)
}
return result
@DanielAsher
DanielAsher / SubscribeToTweaksViewController.rx_pressedDone.swift
Last active May 12, 2016 15:44
RxSwift DelegateProxy for SwiftTweak's TweaksViewController
guard let tweakWindow = UIApplication.sharedApplication().keyWindow as? TweakWindow else { return }
let tweaksViewController = tweakWindow.tweaksViewController
tweaksViewController.rx_pressedDone
.subscribeNext { isPressed in
self.dismissViewControllerAnimated(true) { return }
}.addDisposableTo(self.disposeBag)
self.presentViewController(tweaksViewController, animated: true, completion: nil)
@DanielAsher
DanielAsher / NavigationController.playground.swift
Created April 24, 2016 21:23
Demonstrates disappearing NavigationBar button in interactive playgrounds
import Foundation
import UIKit
import XCPlayground
struct UI {
let button = UIButton(frame: CGRect(x: 30, y: 30, width: 300, height: 30))
let vc = UIViewController()
init(title: String, buttonText: String? = nil) {
if let buttonText = buttonText {