I want to reproduce declarative programming like in WPF on IOS(objective-c).
In WPF I could use a control like so:
<MediaElement Name="myVideo" Source="C:\WINDOWS\system32\oobe\images\ intro.wmv" Width="450" Height="400" >
The exact code would be:
MediaElement me = new MediaElement();
me.Id = "myVideo";
me.Height=450;
...
Can this be accomplished in a similar manner on objective-C(IOS 7)? Please give examples or hints on ways to implement this.
Is there any library that implements Composite pattern that I can use in IOS7?
Edit: This is a real question, and I want to implement this on a real project, if it can be done.
Edit 2: I want to transform a NSString to a xib file and display it as a control in a View?
*Edit 3:
I have a response from server in JSON
format like this :
{
"alignment" : "center",
"text" : "Just a text",
"type" : "label",
"textColor" : "black",
"width" : "300",
"height" : "44",
"backgroundColor" : "white",
"fontName" : "Helvetica",
"fontSize" : "15",
"x" : "75",
"y" : "200"
}
inside the implementation file to be interpreted as :
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(75, 200, 300, 44)];
label.backgroundColor = [UIColor whiteColor];
label.font = [UIFont fontWithName:@"Helvetica" size:15];
label.text = @"Just a text";
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor blackColor];
[self.view addSubview:label];