Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more RouteStep properties to Obj-C #227

Merged
merged 4 commits into from
Jan 5, 2018
Merged

Conversation

frederoni
Copy link
Contributor

@frederoni frederoni commented Jan 2, 2018

Fixes #117

maneuverType, maneuverDirection, and transportType now bridges to Obj-C.

Another way to expose these properties to Obj-C could be to add an additional computed non-optional bridgableManeuverType if optional chaining syntax is preferred within the framework.

@objc open var bridgableManeuverType: ManeuverType {
    get {
        return maneuverType ?? .none
    }
}

@1ec5 @bsudekum 👀

@@ -669,7 +696,7 @@ open class RouteStep: NSObject, NSSecureCoding {
guard let transportTypeDescription = decoder.decodeObject(of: NSString.self, forKey: "transportType") as String? else {
return nil
}
transportType = TransportType(description: transportTypeDescription)
transportType = TransportType(description: transportTypeDescription)!
Copy link

Choose a reason for hiding this comment

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

This should probably be safely unwrapped.

@bsudekum
Copy link

bsudekum commented Jan 2, 2018

Looks good. It looks like in a few places we're asserting that values are non-optional where as code around either unwraps the value or provides a default fallback.

@frederoni frederoni force-pushed the fred-objc-bridging-117 branch 3 times, most recently from d7afc8a to a216f43 Compare January 3, 2018 14:03
@frederoni frederoni merged commit c3a3aa4 into master Jan 5, 2018
@frederoni frederoni deleted the fred-objc-bridging-117 branch January 5, 2018 15:50
@Niduank
Copy link

Niduank commented Jan 8, 2018

Hi,

When will you release a new MapboxDirections.swift pod which include bridge to ObjC for RouteStep.maneuverX variables ?

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible changes that break backwards compatibility of public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants