From e60971c31f2b0a7ebf1b1fde953bc5118d101776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ko=CC=88nig?= Date: Thu, 10 Dec 2015 10:27:23 +0100 Subject: [PATCH] Revert "Updated visibility of initializers" This reverts commit f05a20c3b0e08d860aae729a68da4abff808dc07. --- README.md | 64 ++++++++++--------- Source/Date.swift | 6 +- Source/Error.swift | 2 +- .../RetrieveSecuritiesParameters.swift | 2 +- .../RetrieveTransactionsParameters.swift | 2 +- Source/Types/Account.swift | 2 +- Source/Types/AccountType.swift | 2 +- Source/Types/Address.swift | 2 +- Source/Types/Balance.swift | 2 +- Source/Types/Challenge.swift | 2 +- Source/Types/LoginCredentials.swift | 2 +- Source/Types/LoginSettings.swift | 2 +- Source/Types/Payment.swift | 2 +- Source/Types/PaymentParameters.swift | 2 +- Source/Types/PaymentProposal.swift | 2 +- Source/Types/PaymentType.swift | 2 +- Source/Types/Security.swift | 4 +- Source/Types/StandingOrder.swift | 4 +- Source/Types/SupportedBank.swift | 2 +- Source/Types/SupportedService.swift | 2 +- Source/Types/SyncStatus.swift | 2 +- Source/Types/TANScheme.swift | 2 +- Source/Types/Transaction.swift | 4 +- Source/Types/User.swift | 2 +- 24 files changed, 63 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 6fd873a..311c33f 100644 --- a/README.md +++ b/README.md @@ -26,16 +26,37 @@ Applications that would like to access the figo Connect have to register with us Website: [http://figo.io](http://figo.io) -## Installation +## Credits -### Manually +The Figo Framework uses the following 3rd-party utilities, but is not exporting their symbols: + +- [DaveWoodCom/XCGLogger](https://github.com/DaveWoodCom/XCGLogger) +- [JohnSundell/Unbox](https://github.com/JohnSundell/Unbox) + + +## Usage + +Take a look at the test cases to see more examples of interaction with the API. + +### Retrieve all accounts + Figo.retrieveAccounts() { accounts, _ in + if let accounts = accounts { + for account in accounts { + print(account.account_id) + } + } + } +### Retrieve a single account + Figo.retrieveAccount("A1.1") { account, _ in + if let account = account { + print(account.account_id) + } + } + + +## Installation -* Add Figo as a git submodule by running the following command: - `$ git submodule add https://github.com/figome/ios-sdk.git` -* Open the new folder and drag the Figo.xcodeproj into the Project Navigator of your application's Xcode project. -* Select the Figo.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target. -* Add the Figo.framework to your target(s) in the "Embedded Binaries" sections ### Carthage @@ -67,32 +88,17 @@ Website: [http://figo.io](http://figo.io) `$(SRCROOT)/Carthage/Build/iOS/Figo.framework` +### CocoaPods -## Usage - -Take a look at the test cases to see more examples of interaction with the API. +### Manually -### Retrieve all accounts - Figo.retrieveAccounts() { accounts, _ in - if let accounts = accounts { - for account in accounts { - print(account.account_id) - } - } - } -### Retrieve a single account - Figo.retrieveAccount("A1.1") { account, _ in - if let account = account { - print(account.account_id) - } - } - +* Add Figo as a git submodule by running the following command: -## Credits + `$ git submodule add https://github.com/figome/ios-sdk.git` +* Open the new folder and drag the Figo.xcodeproj into the Project Navigator of your application's Xcode project. +* Select the Figo.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target. +* Add the Figo.framework to your target(s) in the "Embedded Binaries" sections -The Figo Framework uses the following 3rd-party utilities: -- [DaveWoodCom/XCGLogger](https://github.com/DaveWoodCom/XCGLogger) -- [JohnSundell/Unbox](https://github.com/JohnSundell/Unbox) diff --git a/Source/Date.swift b/Source/Date.swift index 44c43ae..271654a 100644 --- a/Source/Date.swift +++ b/Source/Date.swift @@ -12,7 +12,7 @@ import Foundation /// Provides a NSDate representation for the server's timestamps public struct Date: UnboxableByTransform, CustomStringConvertible { - public typealias UnboxRawValueType = String + internal typealias UnboxRawValueType = String public let date: NSDate public let timestamp: String @@ -35,11 +35,11 @@ public struct Date: UnboxableByTransform, CustomStringConvertible { } } - public static func transformUnboxedValue(unboxedValue: String) -> Date? { + static func transformUnboxedValue(unboxedValue: String) -> Date? { return Date(timestamp: unboxedValue) } - public static func unboxFallbackValue() -> Date { + static func unboxFallbackValue() -> Date { return Date() } diff --git a/Source/Error.swift b/Source/Error.swift index 9e01d15..aa5b2db 100644 --- a/Source/Error.swift +++ b/Source/Error.swift @@ -11,7 +11,7 @@ import Foundation public enum Error: ErrorType, CustomStringConvertible, Unboxable { - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { let error: String = unboxer.unbox("error") let error_description: String = unboxer.unbox("error_description") self = .ServerErrorWithDescrition(error: error, description: error_description) diff --git a/Source/Request Parameters/RetrieveSecuritiesParameters.swift b/Source/Request Parameters/RetrieveSecuritiesParameters.swift index 4b04dd9..a94ea31 100644 --- a/Source/Request Parameters/RetrieveSecuritiesParameters.swift +++ b/Source/Request Parameters/RetrieveSecuritiesParameters.swift @@ -24,7 +24,7 @@ public enum SecuritySinceType: String, UnboxableEnum { case Modified = "modified" - public static func unboxFallbackValue() -> SecuritySinceType { + static func unboxFallbackValue() -> SecuritySinceType { return .Traded } } diff --git a/Source/Request Parameters/RetrieveTransactionsParameters.swift b/Source/Request Parameters/RetrieveTransactionsParameters.swift index 5c2580a..f8b9caf 100644 --- a/Source/Request Parameters/RetrieveTransactionsParameters.swift +++ b/Source/Request Parameters/RetrieveTransactionsParameters.swift @@ -24,7 +24,7 @@ public enum TransactionSinceType: String, UnboxableEnum { case Modified = "modified" - public static func unboxFallbackValue() -> TransactionSinceType { + static func unboxFallbackValue() -> TransactionSinceType { return .Booked } } diff --git a/Source/Types/Account.swift b/Source/Types/Account.swift index 68c25e5..d3e4b10 100644 --- a/Source/Types/Account.swift +++ b/Source/Types/Account.swift @@ -109,7 +109,7 @@ public struct Account: Unboxable { return formatter } - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { accountID = unboxer.unbox("account_id") accountNumber = unboxer.unbox("account_number") additionalIcons = unboxer.unbox("additional_icons") diff --git a/Source/Types/AccountType.swift b/Source/Types/AccountType.swift index a29cc5b..21de7cf 100644 --- a/Source/Types/AccountType.swift +++ b/Source/Types/AccountType.swift @@ -18,7 +18,7 @@ public enum AccountType: String, UnboxableEnum { case Depot = "Depot" case Unknown = "Unknown" - public static func unboxFallbackValue() -> AccountType { + static func unboxFallbackValue() -> AccountType { return .Unknown } diff --git a/Source/Types/Address.swift b/Source/Types/Address.swift index e41d299..f36dba9 100644 --- a/Source/Types/Address.swift +++ b/Source/Types/Address.swift @@ -18,7 +18,7 @@ public struct Address: Unboxable { public let vat: Float? public let bill: Bool? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { city = unboxer.unbox("city") company = unboxer.unbox("company") postalCode = unboxer.unbox("postal_code") diff --git a/Source/Types/Balance.swift b/Source/Types/Balance.swift index e72b459..db2a760 100644 --- a/Source/Types/Balance.swift +++ b/Source/Types/Balance.swift @@ -25,7 +25,7 @@ public struct Balance: Unboxable { public let status: SyncStatus? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { balance = unboxer.unbox("balance") balanceDate = unboxer.unbox("balance_date") creditLine = unboxer.unbox("credit_line") diff --git a/Source/Types/Challenge.swift b/Source/Types/Challenge.swift index 33ad601..b7f3e61 100644 --- a/Source/Types/Challenge.swift +++ b/Source/Types/Challenge.swift @@ -22,7 +22,7 @@ public struct Challenge: Unboxable { public let data: String? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { title = unboxer.unbox("title") label = unboxer.unbox("label") format = unboxer.unbox("format") diff --git a/Source/Types/LoginCredentials.swift b/Source/Types/LoginCredentials.swift index ee343f1..fee3270 100644 --- a/Source/Types/LoginCredentials.swift +++ b/Source/Types/LoginCredentials.swift @@ -19,7 +19,7 @@ public struct LoginCredentials: Unboxable { public let optional: Bool? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { label = unboxer.unbox("label") masked = unboxer.unbox("masked") optional = unboxer.unbox("optional") diff --git a/Source/Types/LoginSettings.swift b/Source/Types/LoginSettings.swift index 44094b0..9659ba1 100644 --- a/Source/Types/LoginSettings.swift +++ b/Source/Types/LoginSettings.swift @@ -31,7 +31,7 @@ public struct LoginSettings: Unboxable { public let advice: String? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { bankName = unboxer.unbox("bank_name") supported = unboxer.unbox("supported") icon = unboxer.unbox("icon") diff --git a/Source/Types/Payment.swift b/Source/Types/Payment.swift index 8f44253..1db5039 100644 --- a/Source/Types/Payment.swift +++ b/Source/Types/Payment.swift @@ -96,7 +96,7 @@ public struct Payment: Unboxable { public var notificationRecipient: String? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { paymentID = unboxer.unbox("payment_id") accountID = unboxer.unbox("account_id") type = unboxer.unbox("type") diff --git a/Source/Types/PaymentParameters.swift b/Source/Types/PaymentParameters.swift index e5e57fa..8b153f2 100644 --- a/Source/Types/PaymentParameters.swift +++ b/Source/Types/PaymentParameters.swift @@ -16,7 +16,7 @@ public struct PaymentParameters: Unboxable { public let supportedFileFormats: [String] public let supportedTextKeys: [Int] - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { allowedRecipients = unboxer.unbox("allowed_recipients") canBeRecurring = unboxer.unbox("can_be_recurring") canBeScheduled = unboxer.unbox("can_be_scheduled") diff --git a/Source/Types/PaymentProposal.swift b/Source/Types/PaymentProposal.swift index 5492190..ee7b678 100644 --- a/Source/Types/PaymentProposal.swift +++ b/Source/Types/PaymentProposal.swift @@ -15,7 +15,7 @@ public struct PaymentProposal: Unboxable { public let additionalIcons: [String: String]? public let icon: String - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { accountNumber = unboxer.unbox("account_number") bankCode = unboxer.unbox("bank_code") name = unboxer.unbox("name") diff --git a/Source/Types/PaymentType.swift b/Source/Types/PaymentType.swift index b6ce219..7d42ac1 100644 --- a/Source/Types/PaymentType.swift +++ b/Source/Types/PaymentType.swift @@ -29,7 +29,7 @@ public enum PaymentType: String, UnboxableEnum { case SEPAStandingOrder = "SEPA standing order" case ModifySEPAStandingOrder = "Modify SEPA standing order" - public static func unboxFallbackValue() -> PaymentType { + static func unboxFallbackValue() -> PaymentType { return .Unknown } diff --git a/Source/Types/Security.swift b/Source/Types/Security.swift index cb40cc3..29ca376 100644 --- a/Source/Types/Security.swift +++ b/Source/Types/Security.swift @@ -15,7 +15,7 @@ public struct SecurityListEnvelope: Unboxable { public let deleted: [Security] public let status: SyncStatus - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { securities = unboxer.unbox("securities") deleted = unboxer.unbox("deleted") status = unboxer.unbox("status") @@ -109,7 +109,7 @@ public struct Security: Unboxable { } - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { securityID = unboxer.unbox("security_id") accountID = unboxer.unbox("account_id") name = unboxer.unbox("name") diff --git a/Source/Types/StandingOrder.swift b/Source/Types/StandingOrder.swift index bd68471..27f913f 100644 --- a/Source/Types/StandingOrder.swift +++ b/Source/Types/StandingOrder.swift @@ -16,7 +16,7 @@ public enum StandingOrderInterval: String, UnboxableEnum { case HalfYearly = "half yearly" case Yearly = "yearly" - public static func unboxFallbackValue() -> StandingOrderInterval { + static func unboxFallbackValue() -> StandingOrderInterval { return .Monthly } @@ -101,7 +101,7 @@ public struct StandingOrder: Unboxable { let modificationDate: Date? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { standingOrderID = unboxer.unbox("standing_order_id") accountID = unboxer.unbox("account_id") firstExecutionDate = unboxer.unbox("first_execution_date") diff --git a/Source/Types/SupportedBank.swift b/Source/Types/SupportedBank.swift index 09cdf64..81ab333 100644 --- a/Source/Types/SupportedBank.swift +++ b/Source/Types/SupportedBank.swift @@ -32,7 +32,7 @@ public struct SupportedBank: Unboxable { public let advice: String - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { bankName = unboxer.unbox("bank_name") bankCode = unboxer.unbox("bank_code") bic = unboxer.unbox("bic") diff --git a/Source/Types/SupportedService.swift b/Source/Types/SupportedService.swift index 1284c93..ddef935 100644 --- a/Source/Types/SupportedService.swift +++ b/Source/Types/SupportedService.swift @@ -30,7 +30,7 @@ public struct SupportedService: Unboxable { public let icon: String - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { name = unboxer.unbox("name") bankCode = unboxer.unbox("bank_code") additionalIcons = unboxer.unbox("additional_icons") diff --git a/Source/Types/SyncStatus.swift b/Source/Types/SyncStatus.swift index b4792a2..e1289a6 100644 --- a/Source/Types/SyncStatus.swift +++ b/Source/Types/SyncStatus.swift @@ -15,7 +15,7 @@ public struct SyncStatus: Unboxable { public let syncDate: Date - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { code = unboxer.unbox("code") message = unboxer.unbox("message") successDate = unboxer.unbox("success_timestamp") diff --git a/Source/Types/TANScheme.swift b/Source/Types/TANScheme.swift index 3b298e8..95c9b8a 100644 --- a/Source/Types/TANScheme.swift +++ b/Source/Types/TANScheme.swift @@ -14,7 +14,7 @@ public struct TANScheme: Unboxable { public let TANSchemeID: String - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { mediumName = unboxer.unbox("medium_name") name = unboxer.unbox("name") TANSchemeID = unboxer.unbox("tan_scheme_id") diff --git a/Source/Types/Transaction.swift b/Source/Types/Transaction.swift index 17255fb..b56660c 100644 --- a/Source/Types/Transaction.swift +++ b/Source/Types/Transaction.swift @@ -16,7 +16,7 @@ public struct TransactionListEnvelope: Unboxable { public let statistics: [String: AnyObject] public let status: SyncStatus - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { transactions = unboxer.unbox("transactions") deleted = unboxer.unbox("deleted") statistics = unboxer.unbox("statistics") @@ -114,7 +114,7 @@ public struct Transaction: Unboxable { public let additionalInfo: [String: AnyObject]? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { accountID = unboxer.unbox("account_id") accountNumber = unboxer.unbox("account_number") amount = unboxer.unbox("amount") diff --git a/Source/Types/User.swift b/Source/Types/User.swift index 7defbca..e119024 100644 --- a/Source/Types/User.swift +++ b/Source/Types/User.swift @@ -52,7 +52,7 @@ public struct User: Unboxable { public let filters: [AnyObject]? - public init(unboxer: Unboxer) { + init(unboxer: Unboxer) { userID = unboxer.unbox("user_id") name = unboxer.unbox("name") email = unboxer.unbox("email")