From d8c9ca2e64e017753430b4d9752b5ff51a4799fa Mon Sep 17 00:00:00 2001 From: Neil Pankey Date: Tue, 15 Dec 2015 20:09:28 -0800 Subject: [PATCH 1/2] Doc comments for property extensions --- Source/Property.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Property.swift b/Source/Property.swift index 1ff3b2e..5c2e21a 100644 --- a/Source/Property.swift +++ b/Source/Property.swift @@ -9,27 +9,33 @@ import ReactiveCocoa extension PropertyType where Value == Bool { + /// The conjunction of `self` and `other`. public func and(other: P) -> AndProperty { return AndProperty(terms: [AnyProperty(self), AnyProperty(other)]) } + /// The conjunction of `self` and `other`. public func and(other: AnyProperty) -> AndProperty { return AndProperty(terms: [AnyProperty(self), other]) } + /// The disjunction of `self` and `other`. public func or(other: P) -> OrProperty { return OrProperty(terms: [AnyProperty(self), AnyProperty(other)]) } + /// The disjunction of `self` and `other`. public func or(other: AnyProperty) -> OrProperty { return OrProperty(terms: [AnyProperty(self), other]) } + /// A negated property of `self`. public func not() -> NotProperty { return NotProperty(source: AnyProperty(self), invert: true) } } +/// Specialized `PropertyType` for the conjuction of a set of boolean properties. public struct AndProperty: PropertyType { public let terms: [AnyProperty] @@ -44,10 +50,12 @@ public struct AndProperty: PropertyType { } } + /// Creates a new property with an additional conjunctive term. public func and

(other: P) -> AndProperty { return AndProperty(terms: terms + [AnyProperty(other)]) } + /// Creates a new property with an additional conjunctive term. public func and(other: AnyProperty) -> AndProperty { return AndProperty(terms: terms + [other]) } @@ -57,6 +65,7 @@ public struct AndProperty: PropertyType { } } +/// Specialized `PropertyType` for the disjunction of a set of boolean properties. public struct OrProperty: PropertyType { public let terms: [AnyProperty] @@ -71,10 +80,12 @@ public struct OrProperty: PropertyType { } } + /// Creates a new property with an additional disjunctive term. public func or

(other: P) -> OrProperty { return OrProperty(terms: terms + [AnyProperty(other)]) } + /// Creates a new property with an additional disjunctive term. public func or(other: AnyProperty) -> OrProperty { return OrProperty(terms: terms + [other]) } @@ -84,6 +95,7 @@ public struct OrProperty: PropertyType { } } +/// Specialized `PropertyType` for the negation of a boolean property. public struct NotProperty: PropertyType { private let source: AnyProperty private let invert: Bool @@ -96,6 +108,7 @@ public struct NotProperty: PropertyType { return source.producer.map { $0 != self.invert } } + /// A negated property of `self`. public func not() -> NotProperty { return NotProperty(source: source, invert: !invert) } From 357513f1b74012ed0e3631d71cdc11e5671bc7ba Mon Sep 17 00:00:00 2001 From: Neil Pankey Date: Tue, 15 Dec 2015 20:13:13 -0800 Subject: [PATCH 2/2] Missing doc comments --- Source/Foundation/NSData.swift | 3 +-- Source/UIKit/UILabel.swift | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Foundation/NSData.swift b/Source/Foundation/NSData.swift index d3983f1..652c419 100644 --- a/Source/Foundation/NSData.swift +++ b/Source/Foundation/NSData.swift @@ -10,8 +10,7 @@ import Foundation import ReactiveCocoa extension NSData { - /// Read the data at the URL. - /// Sends the data or the error. + /// Read the data at the URL, sending the result or an error. public class func rex_dataWithContentsOfURL(url: NSURL, options: NSDataReadingOptions = NSDataReadingOptions()) -> SignalProducer { return SignalProducer { observer, disposable in do { diff --git a/Source/UIKit/UILabel.swift b/Source/UIKit/UILabel.swift index de67fae..8cfb425 100644 --- a/Source/UIKit/UILabel.swift +++ b/Source/UIKit/UILabel.swift @@ -14,7 +14,8 @@ extension UILabel { public var rex_text: MutableProperty { return associatedProperty(self, keyPath: "text") } - + + /// Wraps a label's `textColor` value in a bindable property. public var rex_textColor: MutableProperty { return associatedProperty(self, key: &textColor, initial: { $0.textColor }, setter: { $0.textColor = $1 }) }