Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Swift 3 Support #52

Open
joejcon1 opened this issue Jun 25, 2016 · 15 comments
Open

Swift 3 Support #52

joejcon1 opened this issue Jun 25, 2016 · 15 comments

Comments

@joejcon1
Copy link

Hi,

Are there any intentions for an update to support Swift 3 for this library? If not I'm happy to take a stab at it and submit a PR if you're open to it.

Thanks for a great library!

@danthorpe
Copy link
Owner

Yeah - definitely got plans to update/maintain it for Swift 3. Need to look through the some of the changes in Foundation though - as ideally would like to improve the underlying decimal number maths to be more Swifty/ValueType.

Will have some progress during the week I expect.

@danthorpe
Copy link
Owner

Unfortunately at the moment, this is sort of reliant on Swift 3.0 version of ValueCoding too, which has it's own issues, see: danthorpe/ValueCoding#18.

@danthorpe
Copy link
Owner

danthorpe commented Jul 17, 2016

There is a pull request, #55 which has Swift 3.0 support for Money.

There are a few breaking changes - mostly around Locale getting its name taken by NSLocale, so this is now Localization.

Similarly there are number of other Swift 3.0 style name changes.

@Wilsonilo
Copy link

Hey @danthorpe sorry for the question but to use the branch of Swift 3 with pods... I've being trying to use it and still pulls the one for 2.3, again sorry, may be something really dumb to do.

@damirstuhec
Copy link

@danthorpe I'm still getting lots of errors when building Swift 3 project with your #55 PR.

screen shot 2016-10-15 at 19 12 07

screen shot 2016-10-15 at 19 12 16

@msewell
Copy link

msewell commented Oct 19, 2016

I'm using Money through Cocoapods.

pod 'Money',
     :git => 'https://github.com/danthorpe/Money.git',
     :branch => 'swift/3.0'

Using the latest swift/3.0 branch commit (44199cd) lets me build Money in my Swift 3 app, but since Money.podspec still points to ValueCoding 1.5 as its dependency (instead of ValueCoding 2.x, which is the version written in Swift 3), I cannot use Money through CocoaPods.

What is the recommended workaround for using Money in a Swift 3 app at present? Should I not be using CocoaPods to install Money?

@danthorpe
Copy link
Owner

Hi @msewell - yeah, sorry - known issue r.e. the .podspec will hopefully get this sorted asap - ran out of time at the weekend.

@danthorpe
Copy link
Owner

Done! Sorry it took so long to update - real job and ProcedureKit have got in the way! Anyway, can now do this

pod 'Money', '~> 2'

for CocoaPods, or this:

github "danthorpe/Money" "~> 2"

for Carthage.

@Wilsonilo
Copy link

Thanks @danthorpe for your hard work! T("T)

@simonbarker
Copy link

simonbarker commented Nov 30, 2016

Just updating a project to swift 3 and using the suggest line above

pod 'Money', '~> 2

I get this error on pod install

Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `Money (~> 2)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Money (~> 2)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

I assume I've missed something simple, any help would be great

@dylankbuckley
Copy link

@danthorpe I am getting the same as @simonbarker

@omdika
Copy link

omdika commented Nov 7, 2017

Hi @danthorpe ! I am using Money 2.0.1 for my Swift 3.2 project using Xcode 9.0 and I getting some errors like this:
screen shot 2017-11-07 at 17 45 49 is there something I've missed? thanks

@danthorpe
Copy link
Owner

Hi @omdika - You can point your pod to this branch: feature/MNY-79_updates_for_xcode_9 which builds for Swift 3.2. Please feedback to PR #84 .

It's not yet 100% complete - let me know how you go. There were lots of sneaky changes related to decimal support in Swift 3.2.

@omdika
Copy link

omdika commented Nov 7, 2017

Thanks for your quick help @danthorpe , previous error is missing now. But there is another one:
screen shot 2017-11-07 at 18 40 53
screen shot 2017-11-07 at 18 41 06
have I missed something?

@danthorpe
Copy link
Owner

Yeah, haven't spent much time with custom currencies at the moment, and CustomCurrencyType doesn't exist anymore. Or at least, not at the moment.

Instead, you can try conforming to CurrencyProtocol instead. You are the first person to bump into this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants