Skip to content

Commit

Permalink
Release 2.0.0 (drops completion blocks in favor of async/await)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebocchini committed Aug 28, 2022
1 parent 916b8b4 commit 61c690f
Show file tree
Hide file tree
Showing 372 changed files with 11,814 additions and 6,695 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,12 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# Mac
.DS_Store

# SwiftPM
.swiftpm

# User-specific stuff
.idea
4 changes: 3 additions & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
author: Andre Bocchini
github_url: https://github.com/andrebocchini/swiftynab
source_directory: SwiftYNAB
module_version: 2.0.0
module: SwiftYNAB
module_version: 1.1.1
hide_documentation_coverage: true
theme: apple
readme: README.md
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.5
40 changes: 40 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# file options

# --exclude Tests/XCTestManifests.swift,Tests/BadConfig,Snapshots,Build

# format options

--allman false
--binarygrouping 4,8
--commas always
--comments indent
--decimalgrouping 3,6
--elseposition same-line
--empty void
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
--header ignore
--hexgrouping 4,8
--hexliteralcase uppercase
--ifdef indent
--indent 4
--indentcase false
--importgrouping testable-bottom
--linebreaks lf
--maxwidth 100
--octalgrouping 4,8
--operatorfunc spaced
--patternlet hoist
--ranges spaced
--self remove
--semicolons inline
--stripunusedargs always
--swiftversion 4.2
--trimwhitespace always
--wraparguments before-first
--wrapcollections before-first

# rules

--enable isEmpty
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: swift
xcode_workspace: SwiftYNAB.xcworkspace
xcode_scheme: SwiftYNAB
xcode_destination: platform=iOS Simulator,OS=11.0.1,name=iPhone X
osx_image: xcode10.2
xcode_destination: platform=iOS Simulator,OS=15.0,name=iPhone 13
osx_image: xcode13.4
after_success:
- bash <(curl -s https://codecov.io/bash)
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ruby '2.7.6'
source 'https://rubygems.org'

gem 'jazzy', '~> 0.14.2'
121 changes: 121 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jazzy (0.14.2)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4 (~> 1.3)
redcarpet (~> 3.4)
rexml (~> 3.2)
rouge (>= 2.0.6, < 4.0)
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.6.2)
liferaft (0.0.6)
minitest (5.16.2)
molinillo (0.8.0)
mustache (1.1.1)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
public_suffix (4.0.7)
redcarpet (3.5.1)
rexml (3.2.5)
rouge (3.29.0)
ruby-macho (2.5.1)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.4)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.0)

PLATFORMS
arm64-darwin-21
x86_64-darwin-21

DEPENDENCIES
jazzy (~> 0.14.2)

RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.3.17
1 change: 1 addition & 0 deletions Mintfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nicklockwood/[email protected]
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version:5.0
// swift-tools-version:5.5

import PackageDescription

let package = Package(
name: "SwiftYNAB",
platforms: [
.macOS(.v10_14), .iOS(.v11), .tvOS(.v12), .watchOS(.v5)
.macOS(.v12), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)
],
products: [
.library(name: "SwiftYNAB", targets: ["SwiftYNAB"]),
Expand All @@ -17,6 +17,10 @@ let package = Package(
dependencies: [],
path: "SwiftYNAB/SwiftYNAB"
),
.testTarget(
name: "SwiftYNABTests",
dependencies: ["SwiftYNAB"]),
path: "SwiftYNAB/SwiftYNABTests"
],
swiftLanguageVersions: [.v4, .v4_2, .v5]
swiftLanguageVersions: [.v5]
)
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ You can browse the online documentation [here](https://andrebocchini.github.io/s
```
use_frameworks!
target :'Test' do
target :'YourTargetName' do
pod 'SwiftYNAB', :git => 'https://github.com/andrebocchini/swiftynab.git'
end
```
3. Run `pod install`

### Swift Package Manager

You can also use the [Swift Package Manager](https://swift.org/package-manager/). It's especially easy with Xcode 11 where adding a package dependency is as simple as choosing *File > Swift Packages > Add Package Dependency*.
You can also use the [Swift Package Manager](https://swift.org/package-manager/).

Instructions on how to add a Swift Package dependency to your project can be found [here](https://developer.apple.com/documentation/xcode/swift-packages).

### Trying it out

Expand All @@ -40,7 +42,7 @@ https://api.youneedabudget.com/#personal-access-tokens

##### Sample code

Once you have your personal access token, you can use it to try out the framework. Start by creating a new project and at the top of the file where you plan to use SwiftYNAB, add:
Once you have your personal access token, you can use it to try out the framework in your app. Start by creating a new project and at the top of the file where you plan to use SwiftYNAB, add:

```swift
import SwiftYNAB
Expand All @@ -50,14 +52,15 @@ Then, you can try it out by writing something like:

```swift
let ynab = YNAB(accessToken: "TOKEN_GOES_HERE")
ynab.budgets.getBudgets() {
(budgets, error) in

if let budgets = budgets {

Task {
do {
let budgets = try await ynab.budgets.getBudgets()

for budget in budgets {
print(budget.name)
}
} else {
} catch {
print("Uh oh, something went wrong")
}
}
Expand Down
16 changes: 9 additions & 7 deletions SwiftYNAB-demo/SwiftYNAB-demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@
30AADF462277CBC100AE95B8 /* SwiftYNAB-demo */ = {
isa = PBXGroup;
children = (
30AADF532277CBC200AE95B8 /* Info.plist */,
30E163332277DFD600A1222B /* AccountsTableViewController.swift */,
30AADF472277CBC100AE95B8 /* AppDelegate.swift */,
30AADF4E2277CBC200AE95B8 /* Assets.xcassets */,
30E163312277DA4C00A1222B /* BudgetsTableViewController.swift */,
30AADF532277CBC200AE95B8 /* Info.plist */,
30AADFA02277CC7700AE95B8 /* LandingViewController.swift */,
30AADF502277CBC200AE95B8 /* LaunchScreen.storyboard */,
30AADF4B2277CBC100AE95B8 /* Main.storyboard */,
30E163372277E76400A1222B /* TransactionsTableViewController.swift */,
30EBB51A22791EAE000FE07D /* TransactionTableViewCell.swift */,
30AADF4E2277CBC200AE95B8 /* Assets.xcassets */,
30AADF502277CBC200AE95B8 /* LaunchScreen.storyboard */,
30AADF4B2277CBC100AE95B8 /* Main.storyboard */,
);
path = "SwiftYNAB-demo";
sourceTree = "<group>";
Expand Down Expand Up @@ -115,7 +115,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1400;
ORGANIZATIONNAME = "Andre Bocchini";
TargetAttributes = {
30AADF432277CBC100AE95B8 = {
Expand Down Expand Up @@ -216,6 +216,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -241,7 +242,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -277,6 +278,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -296,7 +298,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading

0 comments on commit 61c690f

Please sign in to comment.