Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Add UserProperties::removeProperty api #157

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
}
}
```
* New `UserProperties.removeProperty(forReference:)` API to remove unwanted Readium CSS properties (contributed by [@ettore](https://github.com/readium/r2-shared-swift/pull/157)).


## [2.0.1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,13 @@ public class UserProperties {
public func getProperty(reference: String) -> UserProperty? {
return properties.filter { $0.reference == reference }.first
}

/// Removes a property matching a ReadiumCSS reference.
/// - Parameter ref: The CSS reference of the property to be removed.
public func removeProperty(forReference ref: ReadiumCSSReference) {
properties.removeAll {
$0.reference == ref.rawValue
}
}

}