Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios, macos] Make NSPredicate+MGLAdditions public. - #11810

Merged
fabian-guerra merged 1 commit into
release-bobafrom
fabian-expose-predicate-11751
May 4, 2018
Merged

fabian-guerra merged 1 commit into
release-bobafrom
fabian-expose-predicate-11751

Conversation

@fabian-guerra

Copy link
Copy Markdown
Contributor

Fixes #11751 depends on #11610 to land.

@fabian-guerra fabian-guerra added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels May 1, 2018
@fabian-guerra fabian-guerra added this to the ios-v4.0.1 milestone May 1, 2018
@fabian-guerra fabian-guerra self-assigned this May 1, 2018

@julianrex julianrex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not built or tested - but looks good.

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the comments below, please add a blurb to the iOS and macOS changelogs about adding a new -[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:] method and NSExpression.mgl_jsonExpressionObject property.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add documentation for the category and its members so that they show up in the jazzy docset. Also add a mark pragma like the one in NSExpression(MGLAdditions) – it’ll show up as a section heading in the jazzy docset.

#pragma mark Converting JSON Expressions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this category to MGLExpressionAdditions, for consistency with the other categories that back custom functions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this category to MGLAdditions, for consistency with NSExpression(MGLAdditions).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with #11666, rename this method to +predicateWithMGLJSONObject: in Objective-C and init(mglJSONObject:) in Swift.

+ (instancetype)expressionWithMGLJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:));

@1ec5

1ec5 commented May 1, 2018

Copy link
Copy Markdown
Contributor

depends on #11610 to land

As far as I can tell, this PR doesn’t technically depend on #11610, although they do touch the same code, so there will be a merge conflict.

@fabian-guerra
fabian-guerra force-pushed the fabian-expose-predicate-11751 branch from c968920 to 35247e1 Compare May 2, 2018 15:30

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a couple minor documentation issues below.

@param object A Foundation object deserialized from JSON data, for example
using `NSJSONSerialization`.
@return An initialized predicate equivalent to `object`, suitable for use as
the value of a style layer attribute or vector data filter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initialized predicate equivalent to object, suitable for use with the MGLVectorStyleLayer.predicate property.

See the
“[Predicates and Expressions](../predicates-and-expressions.html)”
guide for a correspondence of operators and types between the style
specification and the `NSExpression` representation used by this SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace NSExpression with NSPredicate.

@fabian-guerra
fabian-guerra force-pushed the fabian-expose-predicate-11751 branch from 35247e1 to cb784cd Compare May 4, 2018 16:49
@fabian-guerra
fabian-guerra force-pushed the fabian-expose-predicate-11751 branch from cb784cd to 16f4a9d Compare May 4, 2018 18:37
@fabian-guerra
fabian-guerra merged commit a365dd1 into release-boba May 4, 2018
@fabian-guerra
fabian-guerra deleted the fabian-expose-predicate-11751 branch May 4, 2018 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants