Skip to content

Instantly share code, notes, and snippets.

@hsleedevelop
Last active June 20, 2019 06:36
Show Gist options
  • Select an option

  • Save hsleedevelop/13617b40c17255a544f0c8ca4a77c3c0 to your computer and use it in GitHub Desktop.

Select an option

Save hsleedevelop/13617b40c17255a544f0c8ca4a77c3c0 to your computer and use it in GitHub Desktop.
capture test
@IBOutlet weak var collectionView: UICollectionView!
.do(onNext: { [collectionView] offset -> Void in
guard let cv = collectionView else { return }
cv.isUserInteractionEnabled = cv.bounds.width == offset.x
})
.do(onNext: { [weak collectionView] offset -> Void in
guard let cv = collectionView else { return }
cv.isUserInteractionEnabled = cv.bounds.width == offset.x
})
.do(onNext: { [weak self] offset -> Void in
guard let cv = self?.collectionView else { return }
cv.isUserInteractionEnabled = cv.bounds.width == offset.x
})
.do(onNext: { [weak self] offset -> Void in //Expression type '@lvalue Bool' is ambiguous without more context
self?.collectionView.isUserInteractionEnabled = self?.collectionView.bounds.width == offset.x
})
.do(onNext: { [unowned self] offset -> Void in //Expression type '@lvalue Bool' is ambiguous without more context
self.collectionView.isUserInteractionEnabled = self.collectionView.bounds.width == offset.x
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment