Skip to content

Instantly share code, notes, and snippets.

View MarcSteven's full-sized avatar
🎯
Focusing on writing code

Marc Steven MarcSteven

🎯
Focusing on writing code
View GitHub Profile
import lldb
import re
import shlex
# This script allows Xcode to selectively ignore Obj-C exceptions
# based on any selector on the NSException instance
def getRegister(target):
if target.triple.startswith('x86_64'):
return "rdi"
//useful to construct the elements of UI fast ,we always write these code in the interface for instance
/*
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.adjustsFontSizeToFitWidth = adjustToFit
label.text = text
label.font = UIFont.preferredFont(forTextStyle: fontStyle)
label.textAlignment = .left
label.textColor = textColor
@MarcSteven
MarcSteven / LargeNumber
Created June 4, 2016 04:12
How to create big number
struct BigInt {
var value:String
func multiply(right:BigInt) ->BigInt {
var a1 = value.characters.reverse().map {Int(String($0))!}
var a2 = right.value.characters.reverse().map {Int(String($0))!}
var product = [Int](count:a1.count + a2.count,repeatedValue:0)
for iterNumber1 in 0..<a1.count {
for iterNumber2 in 0..<a2.count{
let idxIter = iterNumber1 + iterNumber2
import UIKit
class Oven {
var _temperature:Temperature = Temperature()
var temperature :Temperature {
get {return _temperature}
set { _temperature = newValue.copy() }
}
}
class House {
var thermostat :Temperature?
@MarcSteven
MarcSteven / AppDelegate.swift
Created December 14, 2015 01:18 — forked from chriseidhof/AppDelegate.swift
Functional Swift Talk
import UIKit
struct Screen<A> {
let run: (A -> ()) -> UIViewController
}
struct Step<A> {
let build: (navigationController: UINavigationController, callback: A -> ()) -> UIViewController
}