File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,8 +114,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
114114 EZRCustomFeedCell *cell = (EZRCustomFeedCell *)[tableView dequeueReusableCellWithIdentifier: @" CustomFeedCell" ];
115115
116116 NSDictionary *customFeed = [self .sortedFeeds objectAtIndex: indexPath.row];
117+ NSString *customUrl = [customFeed objectForKey: @" url" ];
118+ cell.label_url .text = customUrl;
117119
118- cell.label_url .text = [customFeed objectForKey: @" url" ];
120+ if ([self isValidUrl: customUrl]){
121+ // Display create button
122+ }
119123
120124 UIView *selectedBackgroundView = [[UIView alloc ] init ];
121125 [selectedBackgroundView setBackgroundColor: [UIColor EZR_charcoal ]];
@@ -125,4 +129,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
125129 }
126130}
127131
132+ /* *
133+ * Check for a letter followed by a dot
134+ */
135+ - (BOOL )isValidUrl : (NSString *)url
136+ {
137+ NSError *error = NULL ;
138+ NSString *pattern = @" [a-z][.]" ;
139+ NSString *string = url;
140+ NSRange range = NSMakeRange (0 , string.length );
141+ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern: pattern options: NSRegularExpressionCaseInsensitive error: &error];
142+ NSArray *matches = [regex matchesInString: string options: NSMatchingReportCompletion range: range];
143+
144+ if (matches.count > 0 ) {
145+ return TRUE ;
146+ }
147+ return FALSE ;
148+ }
149+
128150@end
You can’t perform that action at this time.
0 commit comments