Skip to content

Support project Catalyst #2012

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

Merged
merged 2 commits into from
Jun 23, 2019
Merged

Conversation

iamDecode
Copy link
Contributor

Using RxSwift in an iOS app compiled for Mac currently yields nasty errors because UIWebView is deprecated and not supported in UIKit for Mac:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_UIWebView", referenced from:
      objc-class-ref in RxWebViewDelegateProxy.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The official documentation states #if !targetEnvironment(UIKitForMac) is the best way of dealing with these issues (source).

This PR adds some extra conditions to support compiling with project Catalyst.

@iamDecode iamDecode changed the base branch from master to develop June 19, 2019 18:08
@freak4pc
Copy link
Member

This is excellent! If this works in Xcode 10 and builds, I'm all for it. Let's wait for CI.

@freak4pc
Copy link
Member

So, RxCocoa fails build because of a warning that the targetEnvironment is unknown.

I'd really want to find away around this, if you have any ideas.

image

I thought wrapping it in a #if compiler(>=5.1) would work but it doesn't seem like it.

@iamDecode
Copy link
Contributor Author

I've stared at this for a while, but I cant seem to find my way around this. It is parsed, even if we do something like #if false && targetEnvironment(UIKitForMac) or nesting as @freak4pc suggested. I was not able to silence that specific warning; that does not seem possible for Swift other than silencing all warnings for the target (relevant source).

@freak4pc
Copy link
Member

@iamDecode I opened a bug in Swift Compiler:
https://bugs.swift.org/browse/SR-10973

There seems to be a fix here, we might need to pull this in and bite the bullet, but let me think of options until tomorrow:
swiftlang/swift#25593

@kzaher
Copy link
Member

kzaher commented Jun 22, 2019

I think it should be ok to just add --allow-warnings to podfile verification.

It's probably better to allow users to use it with warnings than have it fail.

@freak4pc
Copy link
Member

Yup. That would be the only option here - it’s a parser but which was fixed but only for Xcode 11. Can you add it to Travis ? @iamDecode

@iamDecode
Copy link
Contributor Author

@freak4pc sure thing, I updated it! I added a bit of logic to only add --allow-warnings argument for the RxCocoa target, would be a bit much to add it globally.

Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants