Skip to content

Commit

Permalink
Fix HTMLElement subscript import into Swift by matching getter's type…
Browse files Browse the repository at this point in the history
…s with those of the setter.

Apparently Swift needs the types to match. Oops!

Fixes nolanw#59.
  • Loading branch information
nolanw committed Oct 2, 2016
1 parent a06edd6 commit f021921
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased][]

* Fix `HTMLElement`'s subscripting abilities not getting bridged into Swift (issue #59 revisited).

## [1.0.1][]

* Pass updated html5lib-tests.
Expand Down
2 changes: 1 addition & 1 deletion Sources/include/HTMLElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly, copy, nonatomic) HTMLDictOf(NSString *, NSString *) *attributes;

/// Returns the value of the named attribute, or nil if no such value exists.
- (id __nullable)objectForKeyedSubscript:(id)attributeNameOrString;
- (NSString * __nullable)objectForKeyedSubscript:(NSString *)attributeNameOrString;

/// Sets a named attribute's value, adding it to the element if needed.
- (void)setObject:(NSString *)attributeValue forKeyedSubscript:(NSString *)attributeName;
Expand Down

0 comments on commit f021921

Please sign in to comment.