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

Make annotations property public for CKCluster #8

Closed
stasivanov opened this issue May 11, 2017 · 3 comments
Closed

Make annotations property public for CKCluster #8

stasivanov opened this issue May 11, 2017 · 3 comments

Comments

@stasivanov
Copy link

Sometimes it is very useful to get annotations that are combined under specific cluster to have more flexibility around annotationView text, and not just show count of objects there. Please make it public

@maxep
Copy link
Contributor

maxep commented May 11, 2017

You can have access to a cluster's annotations :

id<CKAnnotation> annotation = cluster.firstAnnotation;
id<CKAnnotation> annotation = cluster.lastAnnotation;
id<CKAnnotation> annotation = cluster[3];

for(id<CKAnnotation> annotation in cluster) {
  ...
}

@stasivanov
Copy link
Author

stasivanov commented May 11, 2017

Thanks. But sometimes there is a specific case, when I need just cluster.annotations. It would be better to make it read only.

Also, I cannot make that "for in loop" works in Swift.

@stasivanov
Copy link
Author

For in loop works with adding extension

extension CKCluster: Sequence { public func makeIterator() -> NSFastEnumerationIterator { return NSFastEnumerationIterator(self) } }

@maxep maxep closed this as completed in 7508363 May 24, 2017
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

2 participants