Skip to content
This repository was archived by the owner on May 26, 2019. It is now read-only.

Fix Objective-C compatebility#48

Open
ikorich wants to merge 1 commit intora1028:masterfrom
ikorich:master
Open

Fix Objective-C compatebility#48
ikorich wants to merge 1 commit intora1028:masterfrom
ikorich:master

Conversation

@ikorich
Copy link
Copy Markdown

@ikorich ikorich commented Oct 29, 2016

RAReorderableLayoutDataSource and RAReorderableLayoutDelegate are hidden for Objective-C.
need add

@objc

to protocols

@ra1028
Copy link
Copy Markdown
Owner

ra1028 commented Nov 9, 2016

@ikorich
Could you remove default behavior of RAReorderableLayoutDelegate/RAReorderableLayoutDatasource from these extensions?

@ikorich
Copy link
Copy Markdown
Author

ikorich commented Nov 9, 2016

Hi @ra1028

I don't want remove it, because thats not for obj-c fix,

Also I can fix some issues, just mark it for me

@ra1028
Copy link
Copy Markdown
Owner

ra1028 commented Nov 15, 2016

But, it's not require in @objc optional function.

}

public protocol RAReorderableLayoutDataSource: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to be a re-definition of the same function defined in UICollectionViewDataSource


public protocol RAReorderableLayoutDataSource: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with this one.

@ricsantos
Copy link
Copy Markdown

@ra1028 also any chance of getting this PR merged. It's needed for ObjC compatibility.

@ricsantos
Copy link
Copy Markdown

After further investigation, I'm not convinced that these protocol methods should be marked as optional.

From my testing in an ObjC project using this pod as a dependency, with the Swift 3.2 compiler, if the methods are marked optional then the default implementation provided by the protocol extensions is called instead of the ObjC implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants