View stringParser.swift
import Foundation
typealias ParseResult = (output: Any, rest: Substring)?
func stringParser(input: Substring) -> ParseResult {
if input[input.startIndex] != "\"" {
return nil
}
var isEscape = true
let index = input.index() {
View string-parser.swift
import Foundation
typealias ParseResult = (output: Any, rest: Substring)?
func stringParser(input: Substring) -> ParseResult {
if input[input.startIndex] != "\"" {
return nil
}
var isEscape = true
func inspectChar(char: Character) -> Bool {
View LayoutExample9.swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
view.backgroundColor = UIColor.lightGrayColor()
var hLayout = HorizontalFitLayout(height: 150)
hLayout.backgroundColor = UIColor.cyanColor()
view.addSubview(hLayout)
View LayoutExample8.swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
view.backgroundColor = UIColor.lightGrayColor()
var vLayout = VerticalFitLayout(width: view.frame.width)
vLayout.backgroundColor = UIColor.cyanColor()
view.addSubview(vLayout)
View LayoutExample7.swift
class VerticalFitLayout: VerticalLayout {
override init(width: CGFloat) {
super.init(width: width)
}
required init(coder aDecoder: NSCoder) {
View LayoutExample6.swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
view.backgroundColor = UIColor.lightGrayColor()
var hLayout = HorizontalLayout(height: 200)
hLayout.backgroundColor = UIColor.cyanColor()
view.addSubview(hLayout)
View LayoutExample5.swift
class HorizontalLayout: UIView {
var xOffsets: [CGFloat] = []
init(height: CGFloat) {
super.init(frame: CGRectMake(0, 0, 0, height))
}
required init(coder aDecoder: NSCoder) {
View LayoutExample4.swift
class VerticalScreenLayout: VerticalLayout {
init() {
super.init(width: UIScreen.mainScreen().bounds.width)
}
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
View LayoutExample3.swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
view.backgroundColor = UIColor.lightGrayColor()
var vLayout = VerticalLayout(width: view.frame.width)
vLayout.backgroundColor = UIColor.cyanColor()
view.addSubview(vLayout)
View LayoutExample2.swift
class VerticalLayout: UIView {
var yOffsets: [CGFloat] = []
init(width: CGFloat) {
super.init(frame: CGRectMake(0, 0, width, 0))
}
required init(coder aDecoder: NSCoder) {