FeedTemplate

public struct FeedTemplate : Codable, Templatable

기본 템플릿으로 제공되는 피드 템플릿 클래스

피드 템플릿은 하나의 컨텐츠와 하나의 기본 버튼을 가집니다. 소셜 정보를 추가할 수 있으며 임의의 버튼을 설정할 수도 있습니다.

아래는 간단한 피드템플릿 생성 예제입니다.

let template = FeedTemplate(content: Content(title: "딸기 치즈 케익",
                                             imageUrl: URL(string: "http://mud-kage.kakao.co.kr/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png")!,
                                             description: "#케익 #딸기 #삼평동 #까페 #분위기 #소개팅",
                                             link: Link(webUrl: URL(string: "https://developers.kakao.com")!,
                                                        mobileWebUrl:  URL(string: "https://developers.kakao.com")!)),
                            social: Social(likeCount: 286,
                                           commentCount: 45,
                                           sharedCount: 845))
  • feed 고정 값

    Declaration

    Swift

    public let objectType: String
  • 메시지의 내용. 텍스트 및 이미지, 링크 정보를 포함합니다.

    Seealso

    Content

    Declaration

    Swift

    public var content: Content
  • 댓글수, 좋아요수 등, 컨텐츠에 대한 소셜 정보입니다.

    Seealso

    Social

    Declaration

    Swift

    public var social: Social?
  • 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됩니다.

    Declaration

    Swift

    public var buttonTitle: String?
  • 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개)

    Seealso

    Button

    Declaration

    Swift

    public var buttons: [Button]?