Giter Club home page Giter Club logo

Comments (4)

davdroman avatar davdroman commented on July 22, 2024

Same here. I can't see the problem there either.

from masonry.

erichoracek avatar erichoracek commented on July 22, 2024

The problem seems to be that the UILayoutPriority type that MASLayoutPrioritys are declared equal to are of type float. AFAIK, floats are not valid as the values of enum—there's a reason why Apple's declaring them as static const and not the same way as Masonry does. LLVM just seems to only now be enforcing this as of Xcode 6 Beta 3.

from masonry.

erichoracek avatar erichoracek commented on July 22, 2024

So the solution would be:

typedef float MASLayoutPriority;
static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;

from masonry.

cloudkite avatar cloudkite commented on July 22, 2024

@eric-horacek thanks for looking into this!

In previous versions xcode5 & xcode6 beta 2 UILayoutPriority is declared as

enum {
    UILayoutPriorityRequired = 1000, // a required constraint.  Do not exceed this.
    UILayoutPriorityDefaultHigh = 750, // this is the priority level with which a button resists compressing its content.
    UILayoutPriorityDefaultLow = 250, // this is the priority level at which a button hugs its contents horizontally.  
    UILayoutPriorityFittingSizeLevel = 50, // When you send -[UIView systemLayoutSizeFittingSize:], the size fitting most closely to the target size (the argument) is computed.  UILayoutPriorityFittingSizeLevel is the priority level with which the view wants to conform to the target size in that computation.  It's quite low.  It is generally not appropriate to make a constraint at exactly this priority.  You want to be higher or lower.
};
typedef float UILayoutPriority;

so this seems like a very recent change in how apple declares non integer enums

If you have time could you submit a PR? 👍

from masonry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.