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

OS X errors with swift 4 #2819

Closed
jethmalani opened this issue Sep 22, 2017 · 13 comments
Closed

OS X errors with swift 4 #2819

jethmalani opened this issue Sep 22, 2017 · 13 comments

Comments

@jethmalani
Copy link

I am getting multiple error when building with swift 4. Does your swift 4 release support OS X as well as iOS? I am on version 3.0.4.

@jethmalani
Copy link
Author

Here is an example of the error "Type 'NSAttributedStringKey' (aka 'NSString') has no member 'font'"

@zanesc
Copy link

zanesc commented Sep 23, 2017

Seeing same issues. 63 errors in total.

UPDATE: downgraded to 3.0.3 and everything is fine now.

@larryonoff
Copy link
Contributor

larryonoff commented Sep 23, 2017

The same issue.

@thierryH91200
Copy link
Contributor

https://developer.apple.com/documentation/foundation/nsattributedstringkey
are you sure ??

an example

attrString = NSMutableAttributedString(string: newValue!)
                attrString?.setAttributes([
                    NSAttributedStringKey.foregroundColor: NSColor.black,
                    NSAttributedStringKey.font: NSFont.systemFont(ofSize: 12.0)
                    ], range: NSMakeRange(0, attrString!.length))

it's fine

@martaGonz
Copy link

same here

@thierryH91200
Copy link
Contributor

look at demo OS X "PieDemoViewController.swift"

@zanesc
Copy link

zanesc commented Sep 24, 2017

I don't see what looking at a demo will do. The project simply would not build.

@lfchockey
Copy link

I'm also having the same problem with iOS. I tried downgrading to 3.0.3 which did not help. I also tried to manually go through and 'fix' all of the bugs that were highlighted in XCode (there were upwards of 100 in total) and I think I did more damage than good.
Most of the bugs were in relation to a dictionary type mismatch: NSAttributedStringKey : Any and String : AnyObject

Now, my app completely crashes every time I try to display a Chart
Could someone please give me a recommendation on what I should do? Remove Charts completely and reinstall (I used Carthage)?

I'm surprised more people are not having the same issue after upgrading XCode

Thank you

@jethmalani
Copy link
Author

jethmalani commented Sep 24, 2017

I believe your issue is that you have not set the correct swift version language for the pod that you are using or your project as a whole. This is something that I am sure a lot of people are having issues with. If you create a stack overflow issue, I would be more than happy to answer your question there and then link to it here so that the most people will benefit from it. You can link to the stack overflow issue here so I can go ahead and post an answer there.

@lfchockey
Copy link

I just created a question at stackoverflow:
https://stackoverflow.com/questions/46392602

I appreciate your help!

@jethmalani
Copy link
Author

I just posted an answer. I hope that helps.

@pmairoldi
Copy link
Collaborator

This seems resolved. Closing.

@Prathapreddy26
Copy link

Please help me out with this error!!!

    NSDictionary(object: UIFont(name: "Roboto-Medium", size: 14)!,forKey: NSAttributedStringKey.font as NSCopying) as? [String : Any];

Error showing like this...

Cannot assign value of type '[String : Any]?' to type '[NSAttributedStringKey : Any]?

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

No branches or pull requests

8 participants