2016-06-22 2 views
0

JSQMessages 프레임 워크에서 avatarImageWithUserInitials을 구현해야합니다. http://cocoadocs.org/docsets/JSQMessagesViewController/7.3.3/Classes/JSQMessagesAvatarImageFactory.html#//api/name/avatarImageWithUserInitials:backgroundColor:textColor:font:diameter : 그러나 그것은 단지 목표 - CSwift에서 avatarImageWithUserInitials 구현

documentatiojn의 위치는 구현 될 것으로 보인다 현재

, 신속한에서이 기능을 구현하는 방법이있을 나타나지 않습니다.

어떻게 신속한 앱에이 기능을 추가 할 수 있습니까?

답변

0

여기에서 전체 구현을 확인할 수 있습니다. https://github.com/jessesquires/JSQMessagesViewController/pull/1606

곧 Swift Example 프로젝트가 곧 중단 될 것입니다.

하지만 기본 런 다운은 이와 같이 할 수있는 아바타 객체를 만들 필요가 있습니다.

let AvatarLeonard = JSQMessagesAvatarImageFactory.avatarImageWithUserInitials("DL", backgroundColor: UIColor.jsq_messageBubbleGreenColor(), textColor: UIColor.whiteColor(), font: UIFont.systemFontOfSize(12), diameter: UInt(kJSQMessagesCollectionViewAvatarSizeDefault)) 

이 옵션 :

// Create avatar with Placeholder Image 
let AvatarJobs = JSQMessagesAvatarImageFactory.avatarImageWithPlaceholder(UIImage(named: "Jobs"), diameter: UInt(kJSQMessagesCollectionViewAvatarSizeDefault)) 

미안이 너무 오래 촬영하고있다.

+0

예제 프로젝트는 이제 주요 프로젝트와 별개입니다. –