From f0219217ba24d593fb83c04532152f031c836e05 Mon Sep 17 00:00:00 2001 From: Nolan Waite Date: Sun, 2 Oct 2016 10:38:03 -0300 Subject: [PATCH] Fix HTMLElement subscript import into Swift by matching getter's types with those of the setter. Apparently Swift needs the types to match. Oops! Fixes #59. --- CHANGELOG.md | 2 ++ Sources/include/HTMLElement.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d205d73..7e134ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/Sources/include/HTMLElement.h b/Sources/include/HTMLElement.h index e77ba14..63c38f2 100644 --- a/Sources/include/HTMLElement.h +++ b/Sources/include/HTMLElement.h @@ -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;