GithubHelp home page GithubHelp logo

avatar's Introduction

Avatar

An iOS package for automatic creating and editing avatars.

Avatar1 Avatar2 Avatar3 Avatar4 Avatar5 Avatar6 Avatar7 Avatar8 Avatar9

Avatar editing

#import Avatar
...
let vc = EditAvatarViewController.instantiate()
vc.avatar = Avatar.decompress(value: avatarId) // provide existing avatar id or some random int64 value
vc.delegate = self
self.present(vc, animated: true, completion: nil)

Editor

Delegate method that will be called when editing is done:

public protocol EditAvatarViewControllerDelegate: AnyObject {
    func doneAvatar(_ avatar: Avatar)
}

Received avatar object can be compressed or presented with single 64 bit integer. You can use this as avatarId and store it to your server, sending it to other clients and present it locally.

Show avatar

Put AvatarView into your layout (storyboard or xib) and set avatar id to it:

@IBOutlet weak var avatarView: AvatarView!
...
avatarView.avatarId = avatarId

AvatarView

Installation via SPM

Tap on your main project, tab Package dependencies and add following url:

https://github.com/prcela/Avatar

Preview in Yamb app

Checkout this Yamb app to see this avatars in action, see how community builds many variations of these avatars. We also have a similar functionality for Android, written in kotlin, feel free to contact us via Yamb app/More/Contact us.

avatar's People

Contributors

prcela avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.