akosma / SwiftMoment

A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.
http://akosma.github.io/SwiftMoment
BSD 2-Clause "Simplified" License
1.61k stars 147 forks source link

Swift 3 compatibility? #70

Closed plastus closed 8 years ago

plastus commented 8 years ago

Has anyone tried using this framework in a Swift 3 project? Does it auto-convert without issues?

grahammccarthy commented 8 years ago

I'm using this fork for now, until It is supported:

pod 'SwiftMoment', :git => 'https://github.com/madhavajay/SwiftMoment.git', :branch => 'swift-3'
qgliu commented 8 years ago

any timeline to merge the swift-3 branch to master?

phucnd0604 commented 8 years ago

@grahammccarthy it say cannot find the git

grahammccarthy commented 8 years ago

Hmm... This line is directly pulled from my podfile and I was just able to pull it down.

pod 'SwiftMoment', :git => 'https://github.com/madhavajay/SwiftMoment.git', :branch => 'swift-3'

Here is the link directly to that branch where you can grab the code manually: https://github.com/madhavajay/SwiftMoment/tree/swift-3

I don't know if/when @akosma will get around to updating this repo.

keith-kurak commented 8 years ago

I can't tell what causes this, but when downloading @madhavajay's fork via cocoapods, the bundle identifier becomes "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}" (effectively org.cocoapods.SwiftMoment). On MomentFromNow.swift:89, it tries to load bundle "com.akosma.SwiftMoment" and fails, thus returning empty string for any Moment.fromNow() calls. In Xcode, I changed the beginning of the bundle identifier to "com.akosma" and then it worked again.

That org.cocoapods isn't in the source itself, so it seems like Cocoapods adds that.

akosma commented 8 years ago

Just updated the library to use Swift 3 exclusively.