Skip to content

Commit

Permalink
Merge pull request #35 from Flinesoft/work/#24-unowned-issue
Browse files Browse the repository at this point in the history
Make playground run again
  • Loading branch information
Jeehut authored May 13, 2019
2 parents 839d8e4 + 70f42c1 commit 246ece3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions UsageExamples.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ myString.clamped(to: ..."c")
//: ### clamp(to:)
//: In-place `mutating` variant of `clamped(to:)`

var myNum = 3
myNum.clamp(to: 0 ... 2)
myNum
var myNum2 = 3
myNum2.clamp(to: 0 ... 2)
myNum2

//: ## StringExtension
//: ### string.strip
Expand Down Expand Up @@ -371,8 +371,12 @@ print(weak)
//: `Unowned` is a wrapper to store unowned references to a `Wrapped` instance.
//: ### Unowned(_:)
//: Initialize with an object reference.
var unowned = Unowned(text)
print(unowned)

// This is commented out as there's a bug with Swift playgrounds that would cause a crash if these lines weren't commented.
// See https://github.com/Flinesoft/HandySwift/issues/24 for reference.

// var unowned = Unowned(text)
// print(unowned)

//: ## Withable
//: Simple protocol to make constructing and modifying objects with multiple properties more pleasant (functional, chainable, point-free).
Expand Down

0 comments on commit 246ece3

Please sign in to comment.