adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
174 stars 74 forks source link

Xcode 10 can't run in swift 4 #128

Open zhangli4659507 opened 5 years ago

zhangli4659507 commented 5 years ago

Xcode 10 can't run in swift 4

dkornev commented 5 years ago

Have anybody found a working signalr (not core) client for swift 5?

buffsldr commented 5 years ago

I am using it as a pod so I do this, which works in Xcode 10.2.1.

swift4_targets = ['foo4', 'SwiftR']
swift4_2_targets = ['foo4_2']

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if swift4_targets.include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
            else
            if swift4_2_targets.include? target.name
                target.build_configurations.each do |config|
                    config.build_settings['SWIFT_VERSION'] = '4.2'
                end

                else
                target.build_configurations.each do |config|
                    config.build_settings['SWIFT_VERSION'] = '5.0'
                end
            end
        end

    end
end
buffsldr commented 5 years ago

@dkornev ^

dkornev commented 5 years ago

@buffsldr Thanks!

iDevo commented 5 years ago

Hi @buffsldr, I assume you implemented this in your Podfile right? Can you share an example of the entire Podfile, unless I am unsure where to place it exactly? Thanks!