Permalink
Browse files

Clean up.

  • Loading branch information...
1 parent 23546a9 commit 252415a79098f78047371caafea738d9effd18dc @samvermette samvermette committed Oct 26, 2011
@@ -7,11 +7,8 @@
//
#import <UIKit/UIKit.h>
-#import "SVModalWebViewController.h"
-@interface ViewController : UIViewController <SVModalWebViewControllerDelegate> {
-
-}
+@interface ViewController : UIViewController
- (IBAction)pushWebViewController;
- (IBAction)presentWebViewController;
@@ -22,7 +22,6 @@ - (void)pushWebViewController {
- (void)presentWebViewController {
NSURL *URL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Friday_(Rebecca_Black_song)"];
SVModalWebViewController *webViewController = [[[SVModalWebViewController alloc] initWithURL:URL] autorelease];
- webViewController.webDelegate = self;
webViewController.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:webViewController animated:YES];
}
@@ -31,11 +30,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return YES;
}
-#pragma mark - SVModalWebViewControllerDelegate
-
-- (void)modalWebViewControllerIsDone:(SVModalWebViewController *)viewController {
- [self dismissModalViewControllerAnimated:YES];
-}
@end
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -15,11 +15,11 @@
221458A013133B3600ED7D83 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2214589F13133B3600ED7D83 /* MessageUI.framework */; };
221C80AF13BBDA2F005F0AB8 /* SVWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */; };
22473B9C133800DD00F497E6 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22473B9B133800DD00F497E6 /* MainWindow-iPad.xib */; };
- 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; };
+ 22F087701458794B003ECD31 /* SVModalWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */; };
+ 22F0877214587BBF003ECD31 /* README.textile in Resources */ = {isa = PBXBuildFile; fileRef = 22F0877114587BBF003ECD31 /* README.textile */; };
28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; };
28C286E10D94DF7D0034E888 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* ViewController.m */; };
28F335F11007B36200424DE2 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* ViewController.xib */; };
- A786CF7F13F6DCC600E22E13 /* SVModalWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A786CF7E13F6DCC600E22E13 /* SVModalWebViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -33,16 +33,16 @@
221C80AD13BBDA2F005F0AB8 /* SVWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWebViewController.h; sourceTree = "<group>"; };
221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVWebViewController.m; sourceTree = "<group>"; };
22473B9B133800DD00F497E6 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = "<group>"; };
- 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 22F0876E1458794B003ECD31 /* SVModalWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVModalWebViewController.h; sourceTree = "<group>"; };
+ 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVModalWebViewController.m; sourceTree = "<group>"; };
+ 22F0877114587BBF003ECD31 /* README.textile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.textile; path = ../README.textile; sourceTree = "<group>"; };
28A0AAE50D9B0CCF005BE974 /* SVWeb_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWeb_Prefix.pch; sourceTree = "<group>"; };
28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
28C286DF0D94DF7D0034E888 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
28C286E00D94DF7D0034E888 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
28F335F01007B36200424DE2 /* ViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ViewController.xib; path = ../ViewController.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* SVWeb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SVWeb-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
- A786CF7D13F6DCC600E22E13 /* SVModalWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVModalWebViewController.h; sourceTree = "<group>"; };
- A786CF7E13F6DCC600E22E13 /* SVModalWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVModalWebViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -52,7 +52,6 @@
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
- 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */,
221458A013133B3600ED7D83 /* MessageUI.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -83,8 +82,8 @@
2214586C13132D3200ED7D83 /* SVWebViewController */ = {
isa = PBXGroup;
children = (
- A786CF7D13F6DCC600E22E13 /* SVModalWebViewController.h */,
- A786CF7E13F6DCC600E22E13 /* SVModalWebViewController.m */,
+ 22F0876E1458794B003ECD31 /* SVModalWebViewController.h */,
+ 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */,
221C80AD13BBDA2F005F0AB8 /* SVWebViewController.h */,
221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */,
220F0B9E138E0EF400F59FC3 /* SVWebViewController.bundle */,
@@ -104,6 +103,7 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
+ 22F0877114587BBF003ECD31 /* README.textile */,
080E96DDFE201D6D7F000001 /* Classes */,
2214586C13132D3200ED7D83 /* SVWebViewController */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -139,7 +139,6 @@
2214589F13133B3600ED7D83 /* MessageUI.framework */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
- 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -169,8 +168,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SVWeb" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -199,6 +201,7 @@
28F335F11007B36200424DE2 /* ViewController.xib in Resources */,
22473B9C133800DD00F497E6 /* MainWindow-iPad.xib in Resources */,
220F0B9F138E0EF400F59FC3 /* SVWebViewController.bundle in Resources */,
+ 22F0877214587BBF003ECD31 /* README.textile in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -213,7 +216,7 @@
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
28C286E10D94DF7D0034E888 /* ViewController.m in Sources */,
221C80AF13BBDA2F005F0AB8 /* SVWebViewController.m in Sources */,
- A786CF7F13F6DCC600E22E13 /* SVModalWebViewController.m in Sources */,
+ 22F087701458794B003ECD31 /* SVModalWebViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -266,7 +269,6 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -281,7 +283,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
View
@@ -7,7 +7,6 @@ SVWebViewController features:
* iPhone and iPad distinct UIs
* full landscape orientation support
* back, forward, stop/refresh and action buttons (with actions "Open in Safari" and "Mail Link")
-* navbar auto-creation depending on how controller is presented (modaly or pushed in nav controller)
* navbar title set to the currently visible web page
* talks with @setNetworkActivityIndicatorVisible@
@@ -31,10 +30,18 @@ SVWebViewController *webViewController = [[SVWebViewController alloc] initWithAd
[webViewController release];
</pre>
-or be presented modally on top of the currently visible view controller:
+It can also be presented modally using @SVModalWebViewController@:
<pre>
-SVWebViewController *webViewController = [[SVWebViewController alloc] initWithAddress:@"http://google.com"];
+SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"];
[self presentModalViewController:webViewController animated:YES];
[webViewController release];
-</pre>
+</pre>
+
+h2. Automatic Referencing counting (ARC) support
+
+SVWebViewController doesn't support ARC. You can disable ARC on a per-file basis by adding the @-fno-objc-arc@ compiler flag for those files (see "this StackOverflow thread":http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project for reference). Anyone who loves ARC enough to add it to SVWebViewController is welcome to open a pull request and I'll be happy to create a new ARC branch.
+
+h2. Credits
+
+SVWebViewController is brought to you by "Sam Vermette":http://samvermette.com and "contributors to the project":https://github.com/samvermette/SVWebViewController/contributors. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by "creating new issues":https://github.com/samvermette/SVWebViewController/issues/new. If you're using SVWebViewController in your project, attribution would be nice.
@@ -1,28 +1,18 @@
//
// SVModalWebViewController.h
-// iGithub
//
// Created by Oliver Letterer on 13.08.11.
// Copyright 2011 Home. All rights reserved.
//
+// https://github.com/samvermette/SVWebViewController
#import <UIKit/UIKit.h>
-@class SVModalWebViewController;
+@class SVWebViewController;
-@protocol SVModalWebViewControllerDelegate <NSObject>
-- (void)modalWebViewControllerIsDone:(SVModalWebViewController *)viewController;
-@end
-
-
-
-@interface SVModalWebViewController : UINavigationController {
-@private
- id<SVModalWebViewControllerDelegate> _webDelegate;
-}
-
-@property (nonatomic, assign) id<SVModalWebViewControllerDelegate> webDelegate;
+@interface SVModalWebViewController : UINavigationController
+- (id)initWithAddress:(NSString*)urlString;
- (id)initWithURL:(NSURL *)URL;
@end
@@ -1,29 +1,26 @@
//
// SVModalWebViewController.m
-// iGithub
//
// Created by Oliver Letterer on 13.08.11.
// Copyright 2011 Home. All rights reserved.
//
+// https://github.com/samvermette/SVWebViewController
#import "SVModalWebViewController.h"
#import "SVWebViewController.h"
@implementation SVModalWebViewController
-@synthesize webDelegate=_webDelegate;
-#pragma mark - target actions
+#pragma mark - Initialization
-- (void)doneButtonClicked:(UIBarButtonItem *)sender {
- [self.webDelegate modalWebViewControllerIsDone:self];
+- (id)initWithAddress:(NSString*)urlString {
+ return [self initWithURL:[NSURL URLWithString:urlString]];
}
-#pragma mark - Initialization
-
- (id)initWithURL:(NSURL *)URL {
SVWebViewController *webViewController = [[[SVWebViewController alloc] initWithURL:URL] autorelease];
if (self = [super initWithRootViewController:webViewController]) {
- webViewController.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneButtonClicked:)] autorelease];
+ webViewController.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:webViewController action:@selector(doneButtonClicked:)] autorelease];
}
return self;
}
@@ -4,27 +4,15 @@
// Created by Sam Vermette on 08.11.10.
// Copyright 2010 Sam Vermette. All rights reserved.
//
+// https://github.com/samvermette/SVWebViewController
#import <MessageUI/MessageUI.h>
+#import "SVModalWebViewController.h"
-@interface SVWebViewController : UIViewController <UIWebViewDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate> {
- UIWebView *_webView;
- NSURL *_URL;
-
- UIActionSheet *_actionSheet;
- UIBarButtonItem *_backBarButtonItem, *_forwardBarButtonItem, *_refreshBarButtonItem, *_stopBarButtonItem, *_actionBarButtonItem;
-}
+@interface SVWebViewController : UIViewController <UIWebViewDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate>
-@property (nonatomic, retain, readonly) UIBarButtonItem *backBarButtonItem;
-@property (nonatomic, retain, readonly) UIBarButtonItem *forwardBarButtonItem;
-@property (nonatomic, retain, readonly) UIBarButtonItem *refreshBarButtonItem;
-@property (nonatomic, retain, readonly) UIBarButtonItem *stopBarButtonItem;
-@property (nonatomic, retain, readonly) UIBarButtonItem *actionBarButtonItem;
-
-@property (nonatomic, retain, readonly) UIWebView *webView;
-@property (nonatomic, retain) NSURL *URL;
-
-- (id)initWithURL:(NSURL *)URL;
+- (id)initWithAddress:(NSString*)urlString;
+- (id)initWithURL:(NSURL*)URL;
@end
Oops, something went wrong.

0 comments on commit 252415a

Please sign in to comment.