iOS library

This renderer which targets iOS native controls.

Add a renderer

This is available as a pod.

 pod 'AdaptiveCards'

Add header

#import <AdaptiveCards/ACFramework.h>

Create a card from a JSON string

AdaptiveCard is generated from JSON string

ACOParseResult *cardParseResult = [ACOAdaptiveCards FromJson:jsonStr];

HostConfig

Host can be configured through HostConfig which can be generated by JSON string

ACOParseResult *hostconfigParseResult = [ACOHostConfig FromJson:self.hostconfig];

Render a Card

Rederer takes adaptive card and host config. HostConfig can be nil, and if nil, default value will be used.

ACRRenderResult *renderResult;
renderResult = [ACRRenderer render:cardParseResult.card
                            config:hostconfigParseResult.config
                             frame:CGRectMake(20, 250, 300, 1250)];

Example

ACRRenderResult *renderResult;
ACOHostConfigParseResult *hostconfigParseResult = [ACOHostConfig FromJson:self.hostconfig];
ACOAdaptiveCardsParseResult *cardParseResult       = [ACOAdaptiveCards FromJson:jsonStr];

// checking parse result
if(hostconfigParseResult.IsValid == YES && cardParseResult.IsValid == YES)
{
    renderResult = [ACRRenderer render:cardParseResult.card
                                config:hostconfigParseResult.config
                                 frame:CGRectMake(20, 250, 300, 1250)];
}   

if(renderResult.Suceeded == YES)
{
    // returns a ViewController
    ACRViewController *adcVc = renderResult.viewcontroller;
    [self addChildViewController:adcVc];
    [self.view addSubview:adcVc.view];
    [adcVc didMoveToParentViewController:self];
    ...
}

Changing per element rendering

Coming soon

UI Framework styling

Coming soon