Permalink
Browse files

Added some retina images and tweaked title

  • Loading branch information...
1 parent 2820939 commit bc1cd39897727cf0ed08666eb5bfceba80c392ef @soffes soffes committed Feb 8, 2011
View
BIN Resources/SSToolkit.bundle/SSAddressBarTextFieldBackground.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Resources/SSToolkit.bundle/SSAddressBarTextFieldBackground@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 SSCatalog/Classes/SCAddressBarDemoViewController.m
@@ -43,7 +43,7 @@ - (void)viewDidLoad {
_headerView.hasTopBorder = NO;
_headerView.hasBottomBorder = YES;
- _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 300.0f, 21.0f)];
+ _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 0.0f, 300.0f, 21.0f)];
_titleLabel.backgroundColor = [UIColor clearColor];
_titleLabel.textColor = [UIColor colorWithWhite:0.404f alpha:1.0f];
_titleLabel.textAlignment = UITextAlignmentCenter;
@@ -107,7 +107,13 @@ - (void)webViewDidStartLoadingPage:(SSWebView *)aWebView {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
NSString *urlString = [[[_webView lastRequest] mainDocumentURL] absoluteString];
- NSString *addressBarUrlString = urlString; // [urlString stringByReplacingOccurrencesOfRegex:@"^https?://" withString:@""];
+
+ static NSRegularExpression *regularExpression = nil;
+ if (!regularExpression) {
+ regularExpression = [[NSRegularExpression alloc] initWithPattern:@"^https?://" options:NSRegularExpressionCaseInsensitive error:nil];
+ }
+
+ NSString *addressBarUrlString = [regularExpression stringByReplacingMatchesInString:urlString options:0 range:NSMakeRange(0, [urlString length]) withTemplate:@""];
_addressBar.text = addressBarUrlString;
_titleLabel.text = urlString;
}

0 comments on commit bc1cd39

Please sign in to comment.