ribl / FBAnnotationClusteringSwift

Swift translation of FB Annotation Clustering, which clusters pins on the map for iOS.
http://ribl.co/blog/2015/05/28/map-clustering-with-swift-how-we-implemented-it-into-the-ribl-ios-app/
MIT License
311 stars 109 forks source link

Support for Swift 3 #49

Open plflanagan opened 8 years ago

plflanagan commented 8 years ago

Is there an expected date at which this will be coded in Swift 3?

veyhong commented 8 years ago

I need swift 3 support too :(

gchristov commented 8 years ago

Same here. Any updates on this?

danlniel commented 8 years ago

im not sure i trying to pod install with ver 1.0.1 but got so many errors

veyhong commented 8 years ago

Try to convert the code to Swift 3, it very easy. but need to set Use Swift legacy code to No . be sured u need to update cocoapod too. 1.1.0.rc.2

thibaultfloquet commented 8 years ago

The pod from the CocoaPods website is not this repository but a fork : https://github.com/freemiumdev/FBAnnotationClusteringSwift https://cocoapods.org/?q=FBAnnotationClusteringSwift

It's why we have some errors. @freemiumdev Can you do something about that? Thanks :)

Frohmen commented 8 years ago

I also need Swift 3 support, can you please help out

veyhong commented 8 years ago

I use Xcode 8, swift 3, I can compiled no error. Maybe u should try to update your cocoapod to 1.1.0.rc.2.: $ [sudo] gem install cocoapods --pre

falipate commented 8 years ago

I've updated to Xcode 8, swift 3, updated cocoapod to 1.1.0.rc.2 and set "Use Legacy Swift Language Version" to No, yet I'm still getting errors

veyhong commented 8 years ago

What is your error ?

falipate commented 8 years ago

screen shot 2016-10-05 at 3 38 06 pm

veyhong commented 8 years ago

try to set User Swift Legacy to No, and convert this library to Swift 3 by xCode 8: Click Edit->Convert-> To Current swift syntax -> select FBAnnotationClusteringSwift only then wait for converting, I think only few things change u just add accept the change then Clean->Build again

falipate commented 8 years ago

seemed to fix the issue, thanks!

Frohmen commented 8 years ago

I converted the code to Swift 3 but after that I get the following build error: clang: error: linker command failed with exit code 1 (use -v to see invocation) FBAnnotationClusteringSwift compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64

veyhong commented 8 years ago

what is your cocoapod version

Frohmen commented 8 years ago

Never mind I managed to solve it by deleting derived data in Xcode: http://stackoverflow.com/questions/38016143/how-to-delete-derived-data-in-xcode-8

jBjerkli commented 8 years ago

My project has been totally messed up ever since Xcode8/Swift 3.0, one of the factors being the annotation clustering. I am loving the functionality of this, but I am unable to convert it to Swift 3.0. Any conversion guides/tutorials out there for those who had this framework installed in Xcode 7.3/Swift 2.2?

AntonPieter commented 8 years ago

With Swift 3 it didn't work, when I only used the classes (manual install), but it works perfectly when using the pods.

rjuzaszek commented 8 years ago

manually converting classes files to Swift 3, works for me

camel113 commented 7 years ago

Same issue alt text Try to do what @cvhong said but got this message target has already been converted to swift 3.0 syntax

I am using it with cocoapod

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'Project' do
    pod 'Alamofire', '~> 4'
    pod 'DeviceGuru', '~> 1.2'
    pod 'CryptoSwift'
    pod 'Charts'
    pod 'Spring', :git => 'https://github.com/MengTo/Spring.git', :branch => 'swift2'
    pod 'ReachabilitySwift', '~> 2.3'
    pod 'XLPagerTabStrip', '~> 4.0'
    pod "SwiftDate", "~> 3.0"
    pod 'FBAnnotationClusteringSwift'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end
chengsam commented 7 years ago

@camel113 Just comment out the following method:

required override public init(frame: CGRect) {
    super.init(frame: frame)
}