Skip to content

iOS 8 support #29

@jtreanor

Description

@jtreanor

Hi there,

Really great project 😄

There are a few issues with getting this up and running in iOS 8.3:

  • 1. The segfault as pointed out in seems to segfault in 7.1 #28. Temporary fix is to not export the offending classes.
  • 2. I get the following error for almost every class (any class that defines a custom init method):
ERROR: Class UIViewController exported more than one init family method via JSExport. Class UIViewController will not have a callable JavaScript constructor function.
Passing 'void (^const _strong)()' to parameter of incompatible type 'JSValue *'

It would be awesome to get this up and running on iOS 8, I'm happy to do the work but I'm just getting my head around it right now.

Do you have any idea what the cause of 1 is and why is just happens for a small set of classes?

Regarding 2, one idea I had is to replace -(instancetype)initWithX: in protocols with a factory method like +(instancetype)createWithX:. For example UIView's protocol could have the method +(instancetype)createWithFrame:(CGRect)frame and UIView+JavaScriptBridge could have:

+ (instancetype)createWithFrame:(CGRect)frame {
    return [[[self class] alloc] initWithFrame:frame];
}

What do you think of this approach? Is there an automatic way to produce the framework headers so this wouldn't all have to be done manually?

I think 3 shouldn't be a big deal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions