SwiftyConnect - API Unit Tests + Error Handling + New Logo (Steemconnect iOS)

in #utopian-io7 years ago (edited)

swifty.png

SwiftyConnect

What is the project about?

SwiftyConnect is a Secure access to the Steem ecosystem via the OAuth Flow for iOS. To open the Steem blockchain for the AppStore, I have decided to make a Swift Library which uses SteemConnect for Broadcasting Actions & Steem API to fetch data.

SwiftyConnect is still in development, and not all API methods are Unit tested. Still does the new Version bring some great changes with it.

What feature(s) did you add?

Three things got changed:

  • API Unit Tests (~50-60% tested):

If have added Unit Tests for the basic API calls a end user probably will use (I have used in past projects).
During testing I realised that the function call for getFollowers & getFollowing was false, since the start parameter defines an Username and not an Index

  • API default config:

A default config was added to prevent App Crashing if no API is defined by init.

  • Better Error Handling:

Before the update, when receiving an error during an API fetch the error was displayed in the result object. I check now before returning the result if it has errors, if so only the errors are returned in the error object.

How did you implement it/them?

Default config:

    let config_default : NSDictionary = [
        "api": "https://api.steemit.com"
    ]
    
    init(config: NSDictionary) {
        var configUsed = config
        let apiUri = configUsed["api"] as? String
        
        if apiUri == nil {
            configUsed = self.config_default
        }
        
        self.client = HttpClient(api: configUsed["api"] as! String)
    }

Better error handling:

let result = utf8Representation.toJSON()! as! NSDictionary
                
if let error = result["error"] {
  completion?(error, nil);
  return;
}
                
completion?(nil, result);

New Logo

SwiftyConnect now has a new logo thanks to @radudangratian

Roadmap

  • V0.2:
    • Full API Unit Tests
    • Full API Documentation
  • V1.0:
    • Full Documentation
    • Sign Actions

How to contribute?

Create Pull Requests

GitHub Link

Proof for GitHub

Screen Shot 2018-02-23 at 10.47.12.png

benediktveith is my main GitHub account.
Check here for another proof



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Follow me follow you 🔝🔝🔝

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @moonrise I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.18
JST 0.031
BTC 86664.25
ETH 3140.88
USDT 1.00
SBD 2.86