An iOS package for automatic creating and editing avatars.
#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)
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.
Put AvatarView into your layout (storyboard or xib) and set avatar id to it:
@IBOutlet weak var avatarView: AvatarView!
...
avatarView.avatarId = avatarId
Tap on your main project, tab Package dependencies and add following url:
https://github.com/prcela/Avatar
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.