Skip to content

Commit

Permalink
Update SoulverCore framework (v1.0.2)
Browse files Browse the repository at this point in the history
- Adds support for time zones conversions, laptimes, multipliers, iso8601 formatting, if statements and more.
- Adds support for pulling currencies from the European Central Bank with no API key required.
  • Loading branch information
zcohan committed Apr 12, 2020
1 parent 48922b0 commit 1d145e3
Show file tree
Hide file tree
Showing 99 changed files with 76,924 additions and 2,437 deletions.
6 changes: 5 additions & 1 deletion MacSample/MacSample/SoulverCoreExamples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ class SoulverCoreExamples {

func updateCurrencyRatesExample() {

// Use the .popular default currency set to fetch 33 popular currency rates from the European Central Bank (updated every weekday).

CurrencyList.shared.defaultCurrencySet = .popular

CurrencyList.shared.refreshRates { (success) in

if success {
Expand All @@ -329,7 +333,7 @@ class SoulverCoreExamples {
let calculator = Calculator(customization: .standard)
let result = calculator.calculate("10 USD in EUR")
print(result.stringValue)

}

}
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let result = calculator.evaluate("123 + 456")
print("The answer is \(result.stringValue)") // prints 579
```

SoulverCore has a lot of features for day-to-day math, including unit calculations, calendar calculations, rate calculations, and percentage phrase functions. It also cleverly ignores "meaningless" words:
SoulverCore has a lot of features for day-to-day math, including unit calculations, calendar calculations, rate calculations, percentage phrase functions, and time zone conversions. It also cleverly ignores "meaningless" words:

```swift
calculator.evaluate("$10 for lunch + 15% tip") // $11.50
Expand All @@ -41,6 +41,7 @@ calculator.evaluate("40 as % of 90") // 25%
calculator.evaluate("$150 is 25% on what") // $120
calculator.evaluate("$25/hour * 14 hours of work") // $350.00
calculator.evaluate("January 30 2020 + 3 months 2 weeks 5 days") // 19 May
calculator.evaluate("9:35am in New York to Japan") // 10:35 pm
```

## Variables
Expand Down Expand Up @@ -149,16 +150,20 @@ print(lineCollection[2].result!.stringValue) // 30

## Currency Rates

The standard customization comes with rates for 170 real-world currencies, that were accurate at the time the framework was last compiled. To fetch the latest rates, use SoulverCore's shared `CurrencyList`:
The standard customization comes with rates for 170 real-world currencies, that were accurate at the time the framework was last compiled. You can update these currencies to the latest rates by setting valid API key credentials for [CurrencyLayer](https://currencylayer.com) and [Nomics](https://nomics.com) on the shared CurrencyList. Alternatively use the `.popular` default currency set to pull 33 currency rates from the [European Central Bank](https://exchangeratesapi.io), no API key required.

To fetch the latest rates, use SoulverCore's shared `CurrencyList`:

```swift

CurrencyList.shared.defaultCurrencySet = .popular // 33 popular currencies from the ECB, updated every weekday.

CurrencyList.shared.refreshRates { (success) in

if success {
// The standard customization will now have the latest currency rates applied
// The standard customization will now have the latest currency rates applied
let calculator = Calculator(customization: .standard)
let result = calculator.calculate("10 USD in EUR")
let result = calculator.calculate("10 USD in EUR")
}

}
Expand All @@ -176,4 +181,4 @@ SoulverCore has all the math features of [Soulver](https://soulver.app). Check o

## License

Please [email us](mailto:contact@soulver.app) if you wish to use SoulverCore in a public or commerical project.
You may use SoulverCore in personal/private projects. Please [email us](mailto:contact@soulver.app) if you wish to use SoulverCore in a publically available or commerical project.
12 changes: 6 additions & 6 deletions SoulverCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<string>macos-x86_64</string>
<key>LibraryPath</key>
<string>SoulverCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>macos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
Expand All @@ -32,15 +30,17 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>macos-x86_64</string>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>SoulverCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Loading

0 comments on commit 1d145e3

Please sign in to comment.