Giter VIP home page Giter VIP logo

autolayout-helper-swift's People

Contributors

danieladias avatar madhikarma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autolayout-helper-swift's Issues

Bug: fillSuperview not offsetting right and bottom margins properly

The fillSuperview method should use the bottom and right constant margins and apply them as negative constants to the addBottomConstraint and addHeightConstraint methods.

The original version of this extension did that so I think there's been a regression or a typo since we cleaned up the file for OSS.

The fix would be to update fillSuperview to apply right and bottom constants as negative values.

Note. the same thing happened on the Obj-C port ustwo/autolayout-helper-ios@d9fc906 :)

cc @danieladias @jamaine-ustwo

CocoaPods support

  • Create a Podfile for the project
  • Test that it works

Ideally after #3 so we know if there's any cross over there

UIView+Layout additions from other projects

Hey @madhikarma over the past couple weeks @aamctustwo has added some cool helper methods to 'UIView+Layout' , may be some stuff you find useful or interesting to you!

Aaron added some methods to search and retrieve constraint objects via an string identifier so you can change individual layout constraints having called 'fillSuperview'

Jam

Travis CI support

  • Updated project to build on Travis CI
  • Update README to a link to the latest status using Travis CI

Sources folder

The sources folder appears to be in the Root and duplicated within the project which causes a problem making changes within Xcode and Pods not picking it up.

Prefixes

Should we prefix methods and the extension (category) itself?

This is common practice to avoid name space clashes in Obj-C when adding methods via a category of a Cocoa Framework class

Whilst the class is prefixed by the Swift module itself in Swift, when looking around a lot of Swift frameworks prefix both the class and methods still so maybe we should do the same

Thoughts please?

Make methods public

So that they can be accessible outside their module I.e. CocoaPods

Note. Use open instead for allowing subclassing / overriding if applicable otherwise public

Add Pod Lib Lint Test to CI

Summary

Add a pod lib lint test to the CI script to ensure that the pod stays valid on all targets in the podspec.

Details

This could either be done after the Xcodebuild test script using the command above or, if you want to also migrate to Fastlane, you could use the pod_lib_lint command in the Fastfile (see https://github.com/ustwo/formvalidator-swift/blob/master/fastlane/Fastfile as an example).

In either case, a Gemfile with CocoaPods in it should also be added to ensure a pinned version of CocoaPods is used for the linting.

Notes

For more detail on linting a Pod see: https://guides.cocoapods.org/terminal/commands.html#pod_lib_lint

Make all toView: parameters an optional UIView (for consistency)

Description

I recently changed to non optionals for certain methods to be non-optional (see 5c09f94) but I'm rethinking and wondering if its better that Cocoa crashes inside UIKit if you send in a nil superview instead of it being a no-op (does nothing)

Solutions

  • We could / should change back to optionals also so its easier to integrate and consistent across all methods. Note if you use a method that needs a toView then it will crash when the constraint is created
  • Or we could go one step further and make some use default params to reduce method chaining
  • Other??

What do you think? @danieladias @chris59david @jamaine-ustwo

Note. should merge PR #1 first

Support for Leading, Trailing etc

There are some attributes not support by the helper as Leading, Trailing etc

I'm not 100% sure but this may be an issue if the new right to left language support is for those layout attributes specifically

https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/SupportingRight-To-LeftLanguages/SupportingRight-To-LeftLanguages.html

To resolve we could add new methods such as addLeadingConstraint or addTrailingConstraint
and advise to use those for labels instead of addLeftConstraint or addRightConstraint

We should also see how the new support works

cc @danieladias @jamaine-ustwo @chris59david

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.