Skip to content

Commit

Permalink
Playground fixes for Swift 3
Browse files Browse the repository at this point in the history
  • Loading branch information
wokalski committed Nov 5, 2016
1 parent 15ad530 commit fffb43c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Graph.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//: Playground - noun: a place where people can play

import UIKit
import XCPlayground
import PlaygroundSupport

let viewController = GraphViewController(string1: "Playground", string2: "Playful")
let viewController = GraphViewController(string1: "kitten", string2: "sitting")
viewController.view.frame = CGRect(x: 0, y: 0, width: 500, height: 500)
XCPlaygroundPage.currentPage.liveView = viewController.view
PlaygroundPage.current.liveView = viewController.view
12 changes: 6 additions & 6 deletions Graph.playground/Sources/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ extension Trace {
let xDelta = (to.x-from.x)/20

switch type() {
case .Deletion:
case .deletion:
return (CGPoint(x: from.x+xDelta, y: from.y), CGPoint(x: to.x-xDelta, y: to.y))
case .Insertion:
case .insertion:
return (CGPoint(x: from.x, y: from.y+yDelta), CGPoint(x: to.x, y: to.y-yDelta))
case .MatchPoint:
case .matchPoint:
return (CGPoint(x: from.x+xDelta, y: from.y+yDelta), CGPoint(x: to.x-xDelta, y: to.y-yDelta))
}
}()
Expand All @@ -127,11 +127,11 @@ extension Trace {
let arrowLayer = UIBezierPath(arrow: arrow(on: graph)).shapeLayer()

switch type() {
case .Deletion:
case .deletion:
arrowLayer.fillColor = UIColor.red.cgColor
case .Insertion:
case .insertion:
arrowLayer.fillColor = UIColor.green.cgColor
case .MatchPoint:
case .matchPoint:
arrowLayer.fillColor = UIColor.white.cgColor
}
return arrowLayer
Expand Down
10 changes: 8 additions & 2 deletions Graph.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=167&amp;EndingColumnNumber=1&amp;EndingLineNumber=5&amp;StartingColumnNumber=1&amp;StartingLineNumber=5&amp;Timestamp=489366516.224929"
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=163&amp;EndingColumnNumber=1&amp;EndingLineNumber=5&amp;StartingColumnNumber=1&amp;StartingLineNumber=5&amp;Timestamp=499955574.255999"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=167&amp;EndingColumnNumber=27&amp;EndingLineNumber=5&amp;StartingColumnNumber=1&amp;StartingLineNumber=5&amp;Timestamp=489366516.225109"
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=163&amp;EndingColumnNumber=27&amp;EndingLineNumber=5&amp;StartingColumnNumber=1&amp;StartingLineNumber=5&amp;Timestamp=499955574.25617"
lockedSize = "{280, 50}"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=19&amp;CharacterRangeLoc=174&amp;EndingColumnNumber=20&amp;EndingLineNumber=6&amp;StartingColumnNumber=1&amp;StartingLineNumber=6&amp;Timestamp=499955575.464907"
lockedSize = "{1033, 752}"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>

0 comments on commit fffb43c

Please sign in to comment.