", STTRectToCSS(self.rect)];
109 |
110 | for (NSString *segment in self.segments) {
111 | [html appendFormat:@"
%@", [self.segments indexOfObject:segment] == self.selectedSegmentIndex ? @"active" : @"", segment];
112 | }
113 | [html appendString:@"
"];
114 |
115 | return html;
116 | }
117 | @end
118 |
119 | @interface STTSwitchView : STTView
120 | @end
121 |
122 | @implementation STTSwitchView
123 | - (NSString *)htmlRepresentation {
124 | return [NSString stringWithFormat:@"", STTRectToCSS(self.rect)];
178 |
179 | for (STTView *view in self.subviews) {
180 | [html appendString:[view htmlRepresentation]];
181 | }
182 |
183 | [html appendString:@"
"];
184 |
185 | return html;
186 | }
187 | @end
188 |
--------------------------------------------------------------------------------
/Storytime/STTViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // STTViewController.h
3 | // Storytime
4 | //
5 | // Created by Jorge Cohen on 3/25/18.
6 | // Copyright © 2018 Jorge Cohen. All rights reserved.
7 | //
8 |
9 | #import "STTElement.h"
10 | #import