Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify completion as Result type #37

Merged
merged 1 commit into from
Aug 18, 2019

Conversation

cozzin
Copy link
Contributor

@cozzin cozzin commented Aug 10, 2019

Now we don't have to unwrapping OpenGraph.

OpenGraph.fetch(url: url) { result in
    switch result {
    case .success(let og):
        print(og[.title]) // => og:title of the web site
        print(og[.type])  // => og:type of the web site
        print(og[.image]) // => og:image of the web site
        print(og[.url])   // => og:url of the web site
    case .failure(let error):
        print(error)
    }
}

@satoshi-takano
Copy link
Owner

@cozzin It looks great! I'm grateful to your contribution. 🙏 Thanks.

@satoshi-takano satoshi-takano merged commit 19016dc into satoshi-takano:master Aug 18, 2019
@cozzin cozzin deleted the feature/result branch August 19, 2019 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants