ChiliLabs / CHIPageControl

A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io
MIT License
3.37k stars 259 forks source link

Ambiguous use of 'borderWidth' #27

Closed leosimas closed 7 years ago

leosimas commented 7 years ago

Hi,

I am trying to use the CHIPageControlAji but in this line: pageIndicator.borderWidth = 1 // this should set the indicator border, right?

I get this error: Ambiguous use of 'borderWidth'

I am using :

  Xcode 8.3.1 
  pod 'CHIPageControl', ' ~> 0.1.3'
  pod 'Material', '~> 2.6.3'
mihailstumkins commented 7 years ago

@leosimas

It seems that Material uses extensions to UIKit classes, which unfortunately redefines a lot of default UIView properties. In your particular case it's borderWidth property is redefined in https://github.com/CosmicMind/Material/blob/master/Sources/iOS/Material%2BUIView.swift#L258

So, if you wish to continue to use both libraries in one project, the only solution to your problem would be not to import Material to the same scope as CHIPageControl.

Also, i should notice that, while Material seems to provide a lot of functionality, the design of it's extensions to UIKit classes might lead to problem with a lot of different third party libraries.

leosimas commented 7 years ago

I created another file without "import Material" still getting the same error. If I find another solution I'll get back here, for now I'll just work without the borderWidth. Thanks for the help, @mihailstumkins.

barankaansert commented 6 years ago

@leosimas Is there any solution for that you did find?

leosimas commented 6 years ago

@barankaansert , not a good one. :( I added the code into the project and made some changes.

AndreyPoznyak commented 3 years ago

this is still relevant