Cosmos
Cosmos copied to clipboard
Type 'UIAccessibilityTraits' (aka 'UInt64') has no member 'adjustable'
Please consider submitting the following information (if relevant):
- Library setup method: file, Carthage, CocoaPods or Swift Package Manager.
- Version of the library. Example: 8.0.
- Xcode version. Example: 8.3.3.
- OS version. Example: iOS 10.3.2.
Library setup method: f CocoaPods Version of the library. current Xcode version: 9.4
@Faizulkarim, the current version of the library was updated for the newer version of Swift and Xcode 10. Try version 16, as described here.
Library setup method: manual version of Library: current(Downloaded from github) xcode: 10.1 ios version: 12.1.2
Instead of UIAccessibilityTraits.adjustable :UIAccessibilityTraits.none
, i tried UIAccessibilityTraitAdjustable
and UIAccessibilityTraitNone
@DarisMathew, thanks for reporting the issue. Did you change UIAccessibilityTraits.adjustable
to UIAccessibilityTraitAdjustable
and it worked? What is 'Swift Language Version" setting in the Build Settings of your target? The current UIAccessibilityTraits.adjustable
syntax is for Swift 4.2.
hello Evgenii,
yeah it worked that way and you are right i was using the version 4 and not 4.2! Thanks for your response.
On Thu, Feb 21, 2019 at 8:54 AM Evgenii Neumerzhitckii < [email protected]> wrote:
@DarisMathew https://github.com/DarisMathew, thanks for reporting the issue. Did you change UIAccessibilityTraits.adjustable to UIAccessibilityTraitAdjustable and it worked? What is 'Swift Language Version" setting in the Build Settings of your target? The current UIAccessibilityTraits.adjustable syntax is for Swift 4.2.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evgenyneu/Cosmos/issues/130#issuecomment-465847300, or mute the thread https://github.com/notifications/unsubscribe-auth/AbeHdDRmyMLzcwS7vtv-dDjvAEdIV67rks5vPhF7gaJpZM4Zb4Fs .
-- Best Regards, Daris Mathew J.
I went to Build Settings and checked the Swift version which was set at 4.2
I had errors on this line:
view.accessibilityTraits = settings.updateOnTouch ?
UIAccessibilityTraits.adjustable :UIAccessibilityTraits.none
I had to change it to:
view.accessibilityTraits = settings.updateOnTouch ?
UIAccessibilityTraitAdjustable :UIAccessibilityTraitNone
Thanks, @LanceSamaria. That's weird, UIAccessibilityTraits.adjustable
should work fine in Swift 4.2 and 5.0. For which target was the Swift Language Version set to 4.2? There can be multiple targets in one project, and they can have different Swift Language Version settings.
Also, if you are using CocoaPods, check the targets of the Pods project as well.
@evgenyneu hi, thanks for the response. If there are multiple targets how do I check the one you want me to check on?
Btw that wasn't the only error, I also had a problem on this line:
imageLayer.contentsGravity = CALayerContentsGravity.resizeAspect
and the error was:
To fix I followed this answer: https://stackoverflow.com/a/53444498/4833705
imageLayer.contentsGravity = kCAGravityResizeAspect
Now the error is gone:
hi, thanks for the response. If there are multiple targets how do I check the one you want me to check on?
Click a target, go to "Build Settings" and check the Swift Language Version for this target:

imageLayer.contentsGravity = kCAGravityResizeAspect Now the error is gone:
That's fine, it looks like you used Swift 3 syntax before.
@evgenyneu Your correct it was set at 4.0 and my main project actually uses 4.2
@evgenyneu now that I set it to 4.2 the original settings work fine.
Thanks for teaching me something new :) :) :)
Maybe you should highlight the fact that after people download your pod they should check the pod's target and make sure the Swift language version matches the main projects Swift language version. I read a couple of other posts that had similar problems to what I had
@LanceSamaria, no worries
aybe you should highlight the fact that after people download your pod they should check the pod's target and make sure the Swift language version matches the main projects Swift language version.
Thanks for advice. I though CocoaPods would set the Swift Language Version automatically for the library target on install. What version of CocoaPods are you using pod --version
?
Hi @evgenyneu, I use Xcode version 10.2.1, swift 5.0, pod version 1.6.1, and the Cosmos library version 19.0.3, but I still get error:

although Cosmos Target, I've set it to swift 4.2:
I've clean and build but still get this error. Am I miss something?
@tommyaja, the settings look right to me, it should work. No idea, sorry. You can try using Swift 5.0 instead, if it helps.
Found what I needed here to fix the errors after installing the Cosmos pod.
Thx 👍