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

fatal error: value failed to bridge from Swift type to a Objective-C type #10

Open
JDSX opened this issue Mar 24, 2016 · 7 comments
Open

Comments

@JDSX
Copy link

JDSX commented Mar 24, 2016

I get an error when changing the default text attributes, any help on how to change the default text font ?

@hussc
Copy link

hussc commented Apr 1, 2016

When you change the default font, try to change the emphasis attributes and the strong attributes..

@indragiek
Copy link
Owner

@JKinGH Please post the code that you're using.

@JDSX
Copy link
Author

JDSX commented Apr 7, 2016

I was trying to change the font within the textViewController by passing it a string

    if let font = UIFont(name: "Lato-Thin", size: 26) {
        attributes.defaultAttributes[NSFontAttributeName] = font
    } 

@hussc
Copy link

hussc commented Apr 8, 2016

@JKinGH assuming that you have a bold version of this font with the name "Lato-Bold", you can use:

        if let boldFont = UIFont(name: "Lato-Bold", size: 26) {
            attributes.emphasisAttributes = [NSFontAttributeName: boldFont]
            attributes.strongAttributes = [NSFontAttributeName: boldFont]
        }

@JDSX
Copy link
Author

JDSX commented Apr 8, 2016

I am able to change the attributes of bold or any other, but for default text which has no style applied I cannot seem to change the font, even system fonts such as Helvetica.

@indragiek
Copy link
Owner

@JKinGH You mentioned that you "get an error" when the font is changed. What is the error? Or does it just not use the font you specify?

@indragiek
Copy link
Owner

Just realized the error is in the title, sorry. Do you know which value it's failing to bridge?

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

3 participants