Rxswift: Swift 4.2 macOS kCAMediaTimingFunctionEaseInEaseOut has been renamed

Created on 31 Jul 2018  路  13Comments  路  Source: ReactiveX/RxSwift

macOS app won't build because of "kCAMediaTimingFunctionEaseInEaseOut" has been renamed to "CAMediaTimingFunctionName.easeInEaseOut" error.

Expected outcome:
The build should succeed and the app should launch.

What actually happens:
macOS app won't build because of below error

kCAMediaTimingFunctionEaseInEaseOut" has been renamed to "CAMediaTimingFunctionName.easeInEaseOut

Self contained code example that reproduces the issue:

  No code since it's a problem while building it.

**RxSwift/RxCocoa/RxBlocking/RxTest version/commit**

  RxSwift / RxCocoa - 4.2 (Branch: develop #1707 - 64394bcc936e876621561a2f56a39c1ec7f75b2d)

**Platform/Environment**

  - [ ] iOS
  - [O] macOS
  - [ ] tvOS
  - [ ] watchOS
  - [ ] playgrounds

**How easy is to reproduce? (chances of successful reproduce after running the self contained code)**

  - [O ] easy, 100% repro
  - [ ] sometimes, 10%-100%
  - [ ] hard, 2% - 10%
  - [ ] extremely hard, %0 - 2%

**Xcode version**:

Xcode - 10.0 (Beta 4)
```

Installation method:

  • [x] CocoaPods
  • [ ] Carthage
  • [ ] Git submodules

I have multiple versions of Xcode installed:
(so we can know if this is a potential cause of your issue)

  • [ ] yes (which ones)
  • [x] no

Level of RxSwift knowledge:
(this is so we can understand your level of knowledge
and formulate the response in an appropriate manner)

  • [x] just starting
  • [ ] I have a small code base
  • [ ] I have a significant code base

Most helpful comment

I've published a new release 4.3.1. If it doesn't work now, feel free to reopen the issue and provide me with the exact cocoapod command that I can run in this repo and that demonstrate the issue.

I've also added additional pod tests to travis. https://github.com/ReactiveX/RxSwift/blob/master/.travis.yml#L36

All 13 comments

The code seems fine on our side, and also - I can't reproduce this. Would you want to provide a reproducible example?

https://github.com/ReactiveX/RxSwift/blob/7242124ac809533a9f4aaee0880af54d587bf903/RxCocoa/Deprecated.swift#L358-L364

Below is the part where the error occurs

https://github.com/ReactiveX/RxSwift/blob/7242124ac809533a9f4aaee0880af54d587bf903/RxCocoa/Deprecated.swift#L398-L399

The error comes out in above saying

'kCAMediaTimingFunctionEaseInEaseOut' has been renamed to 'CAMediaTimingFunctionName.easeInEaseOut'
Replace 'kCAMediaTimingFunctionEaseInEaseOut' with 'CAMediaTimingFunctionName.easeInEaseOut'

And if I fix the code like below it works fine like a charm.

transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
transition.type = CATransitionType(rawValue: transitionType)

Since I'm using develop branch with Swift 4.2 / Xcode 10 Beta 5 it may not occur to older XCode's or lower swift versions.

So about reproducing, I really didn't actually insert any RxSwift codes. I just created a new project and imported RxSwift.

@rhals000327 how are you importing the framework? I had this same issue when using cocoapods, so after pod install I manually changed my swift version to '4.0' in the build settings of RxSwift and RxCocoa in the Pods.xcodeproj file

@bitwit I've installed it using pod install. It should work fine with swift 4.0. But I need it with 4.2 as for it I used RxSwift 4.2 Version. I want to point out that it should be fixed with RxSwift 4.2/RxCocoa 4.2 since it should target Swift 4.2 Version.

Yep, this issue is preventing me from pushing updates to a CocoaPod that depends on RxSwift, as there's no way to change a dependency's build settings from a Podspec,

This should be resolved in #1741

@rhysforyou As I commented in your PR - This issue was already resolved in the 4.3.0 release. Can you describe what's the issue you're having?

@freak4pc I had the same issue while working on the release of RxGesture.

I have RxCocoa 4.3.0 with Swift 4.2 and have this same chunk failing:
https://github.com/ReactiveX/RxSwift/blob/7242124ac809533a9f4aaee0880af54d587bf903/RxCocoa/Deprecated.swift#L398-L399

capture d ecran 2018-09-18 a 01 50 37

Yep, still seeing the issue with my RxActions framework, the error I get is this:

$ pod spec lint

 -> RxActions (0.1.0)
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
    - ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - ERROR | xcodebuild:  RxCocoa/RxCocoa/Deprecated.swift:398:81: error: 'kCAMediaTimingFunctionEaseInEaseOut' has been renamed to 'CAMediaTimingFunctionName.easeInEaseOut'
    - NOTE  | xcodebuild:  QuartzCore.kCAMediaTimingFunctionEaseInEaseOut:3:12: note: 'kCAMediaTimingFunctionEaseInEaseOut' was obsoleted in Swift 3
    - ERROR | [OSX] xcodebuild:  RxCocoa/RxCocoa/Deprecated.swift:399:43: error: cannot assign value of type 'String' to type 'CATransitionType'
    - ERROR | [OSX] xcodebuild:  RxCocoa/RxCocoa/macOS/NSTextField+Rx.swift:41:24: error: method does not override any method from its superclass

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 4 errors.

You can see the relevant Podspec here: https://github.com/rhysforyou/RxActions/blob/f2ae97b1ada29e99f8eff7a0465844072e450a3a/RxActions.podspec

@rhals000327, until pod will be updated you can use:
pod 'RxCocoa', git: 'https://github.com/ReactiveX/RxSwift', branch: 'master'

I've updated master with additional fixes and added pod lint tests with two versions of Swift. Please check out these changes, if they work for you, I'll publish this tomorrow.

@kzaher it works great for RxGesture 馃憤

I've published a new release 4.3.1. If it doesn't work now, feel free to reopen the issue and provide me with the exact cocoapod command that I can run in this repo and that demonstrate the issue.

I've also added additional pod tests to travis. https://github.com/ReactiveX/RxSwift/blob/master/.travis.yml#L36

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trungp picture trungp  路  3Comments

hannesstruss picture hannesstruss  路  3Comments

trant picture trant  路  3Comments

jaumard picture jaumard  路  3Comments

Z-JaDe picture Z-JaDe  路  3Comments