Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed SSViewController in favor of using UIViewController's new con…

…tainer features
  • Loading branch information...
commit 6043022f5e75bb67bccc716ec7145f60bbbc0673 1 parent a888864
@soffes authored
View
28 SSToolkit.xcodeproj/project.pbxproj
@@ -8,8 +8,6 @@
/* Begin PBXBuildFile section */
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
- B20AC0691267988600687143 /* SSTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B20AC0671267988600687143 /* SSTableViewController.h */; };
- B20AC06A1267988600687143 /* SSTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B20AC0681267988600687143 /* SSTableViewController.m */; };
B215045F10583A7300409ED4 /* SSToolkit_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = B215045E10583A7300409ED4 /* SSToolkit_Prefix.pch */; };
B215051210583BBB00409ED4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B215051110583BBB00409ED4 /* UIKit.framework */; };
B21D2E00121F2FE500161E66 /* SSDrawingUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = B21D2DFF121F2FE500161E66 /* SSDrawingUtilities.m */; };
@@ -54,7 +52,6 @@
B24E9E5C121DC29A0085F81E /* SSLineView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E1E121DC29A0085F81E /* SSLineView.m */; };
B24E9E5D121DC29A0085F81E /* SSLoadingView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E1F121DC29A0085F81E /* SSLoadingView.h */; };
B24E9E5E121DC29A0085F81E /* SSLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E20121DC29A0085F81E /* SSLoadingView.m */; };
- B24E9E65121DC29A0085F81E /* SSModalViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E27121DC29A0085F81E /* SSModalViewController.h */; };
B24E9E66121DC29A0085F81E /* SSPickerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E28121DC29A0085F81E /* SSPickerViewController.h */; };
B24E9E67121DC29A0085F81E /* SSPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E29121DC29A0085F81E /* SSPickerViewController.m */; };
B24E9E68121DC29A0085F81E /* SSPieProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E2A121DC29A0085F81E /* SSPieProgressView.h */; };
@@ -64,8 +61,6 @@
B24E9E6C121DC29A0085F81E /* SSTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E2E121DC29A0085F81E /* SSTextView.h */; };
B24E9E6D121DC29A0085F81E /* SSTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E2F121DC29A0085F81E /* SSTextView.m */; };
B24E9E6E121DC29A0085F81E /* SSToolkit.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E30121DC29A0085F81E /* SSToolkit.h */; };
- B24E9E6F121DC29A0085F81E /* SSViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E31121DC29A0085F81E /* SSViewController.h */; };
- B24E9E70121DC29A0085F81E /* SSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E32121DC29A0085F81E /* SSViewController.m */; };
B24E9E71121DC29A0085F81E /* SSWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E33121DC29A0085F81E /* SSWebView.h */; };
B24E9E72121DC29A0085F81E /* SSWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E34121DC29A0085F81E /* SSWebView.m */; };
B24E9E73121DC29A0085F81E /* UIColor+SSToolkitAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E35121DC29A0085F81E /* UIColor+SSToolkitAdditions.h */; };
@@ -101,8 +96,6 @@
B28219DE12FA8EB500BAF3C6 /* SSRatingPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = B28219DC12FA8EB500BAF3C6 /* SSRatingPicker.m */; };
B28C6D0712FBE5C400667755 /* SSRatingPickerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B28C6D0512FBE5C400667755 /* SSRatingPickerViewController.h */; };
B28C6D0812FBE5C400667755 /* SSRatingPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B28C6D0612FBE5C400667755 /* SSRatingPickerViewController.m */; };
- B2AAE65C1281B73E0068EE7F /* SSNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AAE65A1281B73E0068EE7F /* SSNavigationController.h */; };
- B2AAE65D1281B73E0068EE7F /* SSNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2AAE65B1281B73E0068EE7F /* SSNavigationController.m */; };
B2ABC6921329D14300521D20 /* SSCollectionViewItemTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B2ABC6901329D14300521D20 /* SSCollectionViewItemTableViewCell.h */; };
B2ABC6931329D14300521D20 /* SSCollectionViewItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ABC6911329D14300521D20 /* SSCollectionViewItemTableViewCell.m */; };
B2AE1134126F963300534CF2 /* UIApplication+SSToolkitAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AE1132126F963300534CF2 /* UIApplication+SSToolkitAdditions.h */; };
@@ -136,8 +129,6 @@
/* Begin PBXFileReference section */
AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- B20AC0671267988600687143 /* SSTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSTableViewController.h; sourceTree = "<group>"; };
- B20AC0681267988600687143 /* SSTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSTableViewController.m; sourceTree = "<group>"; };
B215045E10583A7300409ED4 /* SSToolkit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSToolkit_Prefix.pch; sourceTree = "<group>"; };
B215051110583BBB00409ED4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
B21D2DFF121F2FE500161E66 /* SSDrawingUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSDrawingUtilities.m; sourceTree = "<group>"; };
@@ -184,7 +175,6 @@
B24E9E1E121DC29A0085F81E /* SSLineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLineView.m; sourceTree = "<group>"; };
B24E9E1F121DC29A0085F81E /* SSLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLoadingView.h; sourceTree = "<group>"; };
B24E9E20121DC29A0085F81E /* SSLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLoadingView.m; sourceTree = "<group>"; };
- B24E9E27121DC29A0085F81E /* SSModalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSModalViewController.h; sourceTree = "<group>"; };
B24E9E28121DC29A0085F81E /* SSPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSPickerViewController.h; sourceTree = "<group>"; };
B24E9E29121DC29A0085F81E /* SSPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSPickerViewController.m; sourceTree = "<group>"; };
B24E9E2A121DC29A0085F81E /* SSPieProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSPieProgressView.h; sourceTree = "<group>"; };
@@ -194,8 +184,6 @@
B24E9E2E121DC29A0085F81E /* SSTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSTextView.h; sourceTree = "<group>"; };
B24E9E2F121DC29A0085F81E /* SSTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSTextView.m; sourceTree = "<group>"; };
B24E9E30121DC29A0085F81E /* SSToolkit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSToolkit.h; sourceTree = "<group>"; };
- B24E9E31121DC29A0085F81E /* SSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSViewController.h; sourceTree = "<group>"; };
- B24E9E32121DC29A0085F81E /* SSViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSViewController.m; sourceTree = "<group>"; };
B24E9E33121DC29A0085F81E /* SSWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSWebView.h; sourceTree = "<group>"; };
B24E9E34121DC29A0085F81E /* SSWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSWebView.m; sourceTree = "<group>"; };
B24E9E35121DC29A0085F81E /* UIColor+SSToolkitAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+SSToolkitAdditions.h"; sourceTree = "<group>"; };
@@ -231,8 +219,6 @@
B28C6D0612FBE5C400667755 /* SSRatingPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSRatingPickerViewController.m; sourceTree = "<group>"; };
B2A5D4D5135873B300AC4BA7 /* ColorCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorCategoryTest.m; sourceTree = "<group>"; };
B2A5D4DD1358748700AC4BA7 /* ControlCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ControlCategoryTest.m; sourceTree = "<group>"; };
- B2AAE65A1281B73E0068EE7F /* SSNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSNavigationController.h; sourceTree = "<group>"; };
- B2AAE65B1281B73E0068EE7F /* SSNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSNavigationController.m; sourceTree = "<group>"; };
B2ABC6901329D14300521D20 /* SSCollectionViewItemTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSCollectionViewItemTableViewCell.h; sourceTree = "<group>"; };
B2ABC6911329D14300521D20 /* SSCollectionViewItemTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSCollectionViewItemTableViewCell.m; sourceTree = "<group>"; };
B2AE1132126F963300534CF2 /* UIApplication+SSToolkitAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIApplication+SSToolkitAdditions.h"; sourceTree = "<group>"; };
@@ -466,17 +452,10 @@
children = (
B267D3431226CE0400B66519 /* SSCollectionViewController.h */,
B267D3441226CE0400B66519 /* SSCollectionViewController.m */,
- B2AAE65A1281B73E0068EE7F /* SSNavigationController.h */,
- B2AAE65B1281B73E0068EE7F /* SSNavigationController.m */,
- B24E9E27121DC29A0085F81E /* SSModalViewController.h */,
B24E9E28121DC29A0085F81E /* SSPickerViewController.h */,
B24E9E29121DC29A0085F81E /* SSPickerViewController.m */,
B28C6D0512FBE5C400667755 /* SSRatingPickerViewController.h */,
B28C6D0612FBE5C400667755 /* SSRatingPickerViewController.m */,
- B20AC0671267988600687143 /* SSTableViewController.h */,
- B20AC0681267988600687143 /* SSTableViewController.m */,
- B24E9E31121DC29A0085F81E /* SSViewController.h */,
- B24E9E32121DC29A0085F81E /* SSViewController.m */,
);
name = "View Controllers";
sourceTree = "<group>";
@@ -561,13 +540,11 @@
B24E9E59121DC29A0085F81E /* SSLabel.h in Headers */,
B24E9E5B121DC29A0085F81E /* SSLineView.h in Headers */,
B24E9E5D121DC29A0085F81E /* SSLoadingView.h in Headers */,
- B24E9E65121DC29A0085F81E /* SSModalViewController.h in Headers */,
B24E9E66121DC29A0085F81E /* SSPickerViewController.h in Headers */,
B24E9E68121DC29A0085F81E /* SSPieProgressView.h in Headers */,
B24E9E6A121DC29A0085F81E /* SSTextField.h in Headers */,
B24E9E6C121DC29A0085F81E /* SSTextView.h in Headers */,
B24E9E6E121DC29A0085F81E /* SSToolkit.h in Headers */,
- B24E9E6F121DC29A0085F81E /* SSViewController.h in Headers */,
B24E9E71121DC29A0085F81E /* SSWebView.h in Headers */,
B24E9E73121DC29A0085F81E /* UIColor+SSToolkitAdditions.h in Headers */,
B24E9E75121DC29A0085F81E /* UIControl+SSToolkitAdditions.h in Headers */,
@@ -580,9 +557,7 @@
B27B1A2212241D6F00111EA2 /* SSCollectionViewItem.h in Headers */,
B267D3451226CE0400B66519 /* SSCollectionViewController.h in Headers */,
B227D2EA124931590078A059 /* NSDictionary+SSToolkitAdditions.h in Headers */,
- B20AC0691267988600687143 /* SSTableViewController.h in Headers */,
B2AE1134126F963300534CF2 /* UIApplication+SSToolkitAdditions.h in Headers */,
- B2AAE65C1281B73E0068EE7F /* SSNavigationController.h in Headers */,
B2EA9F5E12F4A5C900C929D6 /* SSBadgeTableViewCell.h in Headers */,
B2EA9F6212F4A5E100C929D6 /* SSBadgeView.h in Headers */,
B28218BE12FA6AE100BAF3C6 /* SSToolkitDefines.h in Headers */,
@@ -715,7 +690,6 @@
B24E9E69121DC29A0085F81E /* SSPieProgressView.m in Sources */,
B24E9E6B121DC29A0085F81E /* SSTextField.m in Sources */,
B24E9E6D121DC29A0085F81E /* SSTextView.m in Sources */,
- B24E9E70121DC29A0085F81E /* SSViewController.m in Sources */,
B24E9E72121DC29A0085F81E /* SSWebView.m in Sources */,
B24E9E74121DC29A0085F81E /* UIColor+SSToolkitAdditions.m in Sources */,
B24E9E76121DC29A0085F81E /* UIControl+SSToolkitAdditions.m in Sources */,
@@ -729,9 +703,7 @@
B27B1A2312241D6F00111EA2 /* SSCollectionViewItem.m in Sources */,
B267D3461226CE0400B66519 /* SSCollectionViewController.m in Sources */,
B227D2EB124931590078A059 /* NSDictionary+SSToolkitAdditions.m in Sources */,
- B20AC06A1267988600687143 /* SSTableViewController.m in Sources */,
B2AE1135126F963300534CF2 /* UIApplication+SSToolkitAdditions.m in Sources */,
- B2AAE65D1281B73E0068EE7F /* SSNavigationController.m in Sources */,
B2EA9F5F12F4A5C900C929D6 /* SSBadgeTableViewCell.m in Sources */,
B2EA9F6312F4A5E100C929D6 /* SSBadgeView.m in Sources */,
B28218BF12FA6AE100BAF3C6 /* SSToolkitDefines.m in Sources */,
View
3  SSToolkit/SSCollectionViewController.h
@@ -6,13 +6,12 @@
// Copyright 2010-2011 Sam Soffes. All rights reserved.
//
-#import "SSViewController.h"
#import "SSCollectionView.h"
/**
@brief Creates a controller object that manages a collection view.
*/
-@interface SSCollectionViewController : SSViewController <SSCollectionViewDataSource, SSCollectionViewDelegate> {
+@interface SSCollectionViewController : UIViewController <SSCollectionViewDataSource, SSCollectionViewDelegate> {
@private
View
23 SSToolkit/SSModalViewController.h
@@ -1,23 +0,0 @@
-//
-// SSModalViewController.h
-// SSToolkit
-//
-// Created by Sam Soffes on 7/14/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-@class SSViewController;
-
-@protocol SSModalViewController <NSObject>
-
-@required
-
-@property (nonatomic, assign) SSViewController *modalParentViewController;
-
-@optional
-
-- (BOOL)dismissCustomModalOnVignetteTap;
-- (CGSize)contentSizeForViewInCustomModal;
-- (CGPoint)originOffsetForViewInCustomModal;
-
-@end
View
37 SSToolkit/SSNavigationController.h
@@ -1,37 +0,0 @@
-//
-// SSNavigationController.h
-// SSToolkit
-//
-// Created by Sam Soffes on 10/15/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSModalViewController.h"
-
-@class SSViewController;
-
-/**
- @brief UINavigationController subclass that comforms to the SSModalViewController protocol.
-
- This class contains a dirty hack to position it's navigation bar correctly when in a
- custom modal that is created with the SSViewController class.
-
- @see SSViewController
- @see SSModalViewController
- */
-@interface SSNavigationController : UINavigationController <SSModalViewController> {
-
-@private
-
- SSViewController *_modalParentViewController;
- BOOL _dismissCustomModalOnVignetteTap;
- CGSize _contentSizeForViewInCustomModal;
- CGPoint _originOffsetForViewInCustomModal;
-}
-
-@property (nonatomic, assign) SSViewController *modalParentViewController;
-@property (nonatomic, assign) BOOL dismissCustomModalOnVignetteTap;
-@property (nonatomic, assign) CGSize contentSizeForViewInCustomModal;
-@property (nonatomic, assign) CGPoint originOffsetForViewInCustomModal;
-
-@end
View
36 SSToolkit/SSNavigationController.m
@@ -1,36 +0,0 @@
-//
-// SSNavigationController.m
-// SSToolkit
-//
-// Created by Sam Soffes on 10/15/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSNavigationController.h"
-#import "SSViewController.h"
-
-@implementation SSNavigationController
-
-#pragma mark -
-#pragma mark Accessors
-
-@synthesize modalParentViewController = _modalParentViewController;
-@synthesize dismissCustomModalOnVignetteTap = _dismissCustomModalOnVignetteTap;
-@synthesize contentSizeForViewInCustomModal = _contentSizeForViewInCustomModal;
-@synthesize originOffsetForViewInCustomModal = _originOffsetForViewInCustomModal;
-
-
-#pragma mark -
-#pragma mark UIViewController
-
-- (void) viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
-
- // Move nav bar up. This makes me cry.
- if (self.modalParentViewController) {
- UIView *navBar = [[self.view subviews] objectAtIndex:1];
- navBar.frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 44.0f);
- }
-}
-
-@end
View
4 SSToolkit/SSRatingPickerViewController.h
@@ -6,14 +6,12 @@
// Copyright 2011 Sam Soffes. All rights reserved.
//
-#import "SSViewController.h"
-
@class SSRatingPickerScrollView;
@class SSRatingPicker;
@class SSTextField;
@class SSTextView;
-@interface SSRatingPickerViewController : SSViewController {
+@interface SSRatingPickerViewController : UIViewController {
@private
View
51 SSToolkit/SSTableViewController.h
@@ -1,51 +0,0 @@
-//
-// SSTableViewController.h
-// SSToolkit
-//
-// Created by Sam Soffes on 10/14/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSViewController.h"
-
-/**
- @brief The SSTableViewController class creates a controller object that manages a table view.
-
- This class is a SSViewController subclass that is a drop-in replacement for UITableViewController.
- */
-@interface SSTableViewController : SSViewController <UITableViewDataSource, UITableViewDelegate> {
-
-@private
-
- UITableView *_tableView;
- BOOL _clearsSelectionOnViewWillAppear;
-}
-
-/**
- @brief Returns the table view managed by the controller object.
- */
-@property (nonatomic, retain) UITableView *tableView;
-
-/**
- @brief A Boolean value indicating if the controller clears the selection when the table appears.
-
- The default value of this property is YES. When YES, the table view controller clears the table's
- current selection when it receives a viewWillAppear: message. Setting this property to <code>NO</code>
- preserves the selection.
- */
-@property (nonatomic) BOOL clearsSelectionOnViewWillAppear;
-
-/**
- @brief Initializes a table-view controller to manage a table view of a given style.
-
- @param style A constant that specifies the style of table view that the controller object
- is to manage (UITableViewStylePlain or UITableViewStyleGrouped).
-
- @return An initialized UITableViewController object or nil if the object couldn’t be created.
-
- If you use the standard init method to initialize a UITableViewController object, a table view
- in the plain style is created.
- */
-- (id)initWithStyle:(UITableViewStyle)style;
-
-@end
View
107 SSToolkit/SSTableViewController.m
@@ -1,107 +0,0 @@
-//
-// SSTableViewController.m
-// SSToolkit
-//
-// Created by Sam Soffes on 10/14/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSTableViewController.h"
-#import "SSDrawingUtilities.h"
-
-@implementation SSTableViewController
-
-#pragma mark -
-#pragma mark Accessors
-
-@synthesize tableView = _tableView;
-@synthesize clearsSelectionOnViewWillAppear = _clearsSelectionOnViewWillAppear;
-
-
-#pragma mark -
-#pragma mark NSObject
-
-- (id)init {
- self = [self initWithStyle:UITableViewStylePlain];
- return self;
-}
-
-
-- (void)dealloc {
- _tableView.dataSource = nil;
- _tableView.delegate = nil;
- [_tableView release];
- [super dealloc];
-}
-
-
-#pragma mark -
-#pragma mark UIViewController
-
-- (void)loadView {
- _tableView.frame = [[UIScreen mainScreen] applicationFrame];
- self.view = _tableView;
-}
-
-
-- (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
-
- // TODO: Only reload if data is empty
- [self.tableView reloadData];
-
- if (_clearsSelectionOnViewWillAppear) {
- [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
- }
-}
-
-
-- (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
- [self.tableView flashScrollIndicators];
-}
-
-
-- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
- [super setEditing:editing animated:animated];
- [self.tableView setEditing:editing animated:animated];
-}
-
-
-#pragma mark -
-#pragma mark SSViewController
-
-- (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
- [super layoutViewsWithOrientation:orientation];
- self.tableView.frame = CGRectSetZeroOrigin(self.view.frame);
-}
-
-
-#pragma mark -
-#pragma mark Initializer
-
-- (id)initWithStyle:(UITableViewStyle)style {
- if ((self = [super init])) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:style];
- _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- _tableView.dataSource = self;
- _tableView.delegate = self;
- _clearsSelectionOnViewWillAppear = YES;
- }
- return self;
-}
-
-
-#pragma mark -
-#pragma mark UITableViewDataSource
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- return nil;
-}
-
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return 0;
-}
-
-@end
View
8 SSToolkit/SSToolkit.h
@@ -35,12 +35,8 @@
// View Controllers
#import "SSCollectionViewController.h"
-#import "SSModalViewController.h"
-#import "SSNavigationController.h"
#import "SSPickerViewController.h"
#import "SSRatingPickerViewController.h"
-#import "SSTableViewController.h"
-#import "SSViewController.h"
// Misc
#import "SSDrawingUtilities.h"
@@ -72,12 +68,8 @@
// View Controllers
#import <SSToolkit/SSCollectionViewController.h>
-#import <SSToolkit/SSModalViewController.h>
-#import <SSToolkit/SSNavigationController.h>
#import <SSToolkit/SSPickerViewController.h>
#import <SSToolkit/SSRatingPickerViewController.h>
-#import <SSToolkit/SSTableViewController.h>
-#import <SSToolkit/SSViewController.h>
// Misc
#import <SSToolkit/SSDrawingUtilities.h>
View
51 SSToolkit/SSViewController.h
@@ -1,51 +0,0 @@
-//
-// SSViewController.h
-// SSToolkit
-//
-// Created by Sam Soffes on 7/14/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSModalViewController.h"
-
-/**
- @brief UIViewController subclass that displaying custom modals and
- other nice enhancements.
-
- Note: Currently only iPad is supported.
- */
-@interface SSViewController : UIViewController <SSModalViewController> {
-
-@private
-
- SSViewController *_modalParentViewController;
- UIViewController<SSModalViewController> *_customModalViewController;
- BOOL _dismissCustomModalOnVignetteTap;
- CGSize _contentSizeForViewInCustomModal;
- CGPoint _originOffsetForViewInCustomModal;
-
- UIView *_modalContainerView;
- UIImageView *_modalContainerBackgroundView;
- UIButton *_vignetteButton;
-}
-
-@property (nonatomic, assign) SSViewController *modalParentViewController;
-@property (nonatomic, retain, readonly) UIViewController *customModalViewController;
-@property (nonatomic, assign) BOOL dismissCustomModalOnVignetteTap;
-@property (nonatomic, assign) CGSize contentSizeForViewInCustomModal;
-@property (nonatomic, assign) CGPoint originOffsetForViewInCustomModal;
-
-- (void)layoutViews;
-- (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation;
-
-- (void)presentCustomModalViewController:(UIViewController<SSModalViewController> *)viewController;
-- (void)presentCustomModalViewController:(UIViewController<SSModalViewController> *)viewController animated:(BOOL)animated;
-- (void)dismissCustomModalViewController;
-- (void)dismissCustomModalViewController:(BOOL)animated;
-
-- (void)customModalWillAppear:(BOOL)animated;
-- (void)customModalDidAppear:(BOOL)animated;
-- (void)customModalWillDisappear:(BOOL)animated;
-- (void)customModalDidDisappear:(BOOL)animated;
-
-@end
View
331 SSToolkit/SSViewController.m
@@ -1,331 +0,0 @@
-//
-// SSViewController.m
-// SSToolkit
-//
-// Created by Sam Soffes on 7/14/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSViewController.h"
-#import "UIImage+SSToolkitAdditions.h"
-#import "UIView+SSToolkitAdditions.h"
-#import <QuartzCore/QuartzCore.h>
-
-static CGFloat const kSSViewControllerModalPadding = 22.0f;
-static CGSize const kSSViewControllerDefaultContentSizeForViewInCustomModal = {540.0f, 620.0f};
-
-@interface SSViewController (PrivateMethods)
-- (void)_cleanUpModal;
-- (void)_presentModalAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;
-- (void)_dismissModalAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;
-- (void)_dismissVignetteAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;
-@end
-
-
-@implementation SSViewController
-
-#pragma mark -
-#pragma mark Accessors
-
-@synthesize modalParentViewController = _modalParentViewController;
-@synthesize customModalViewController = _customModalViewController;
-@synthesize dismissCustomModalOnVignetteTap = _dismissCustomModalOnVignetteTap;
-@synthesize contentSizeForViewInCustomModal = _contentSizeForViewInCustomModal;
-@synthesize originOffsetForViewInCustomModal = _originOffsetForViewInCustomModal;
-
-
-#pragma mark -
-#pragma mark NSObject
-
-- (id)init {
- if ((self = [super init])) {
- _dismissCustomModalOnVignetteTap = NO;
- _contentSizeForViewInCustomModal = kSSViewControllerDefaultContentSizeForViewInCustomModal;
- _originOffsetForViewInCustomModal = CGPointZero;
- }
- return self;
-}
-
-
-- (void)dealloc {
- [self _cleanUpModal];
- [super dealloc];
-}
-
-
-#pragma mark -
-#pragma mark UIViewController
-
-- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
- [UIView beginAnimations:@"rotate" context:self];
- [UIView setAnimationDuration:duration];
- [self layoutViewsWithOrientation:toInterfaceOrientation];
- [UIView commitAnimations];
-}
-
-
-- (void)viewWillAppear:(BOOL)animated {
- [self layoutViews];
-}
-
-
-#pragma mark -
-#pragma mark Layout
-
-- (void)layoutViews {
- [self layoutViewsWithOrientation:self.interfaceOrientation];
-}
-
-
-- (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
- if (!_customModalViewController) {
- return;
- }
-
- CGSize screenSize;
-
- // TODO: Make this not iPad specific
-
- // Landscape
- if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
- screenSize = CGSizeMake(1024.0f, 768.0f);
- _vignetteButton.frame = CGRectMake(0.0f, -128.0f, 1024.0f, 1024.0f);
- }
-
- // Portrait
- else {
- screenSize = CGSizeMake(768.0f, 1024.0f);
- _vignetteButton.frame = CGRectMake(-128.0f, 0.0f, 1024.0f, 1024.0f);
- }
-
- CGSize modalSize = kSSViewControllerDefaultContentSizeForViewInCustomModal;
- if ([_customModalViewController respondsToSelector:@selector(contentSizeForViewInCustomModal)]) {
- modalSize = [_customModalViewController contentSizeForViewInCustomModal];
- }
-
- CGPoint originOffset = CGPointZero;
- if ([_customModalViewController respondsToSelector:@selector(originOffsetForViewInCustomModal)]) {
- originOffset = [_customModalViewController originOffsetForViewInCustomModal];
- }
- _modalContainerBackgroundView.frame = CGRectMake((roundf(screenSize.width - modalSize.width - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f) + originOffset.x, (roundf(screenSize.height - modalSize.height - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f) + originOffset.y, modalSize.width + kSSViewControllerModalPadding + kSSViewControllerModalPadding, modalSize.height + kSSViewControllerModalPadding + kSSViewControllerModalPadding);
-}
-
-
-#pragma mark -
-#pragma mark Modal
-
-- (void)presentCustomModalViewController:(UIViewController<SSModalViewController> *)viewController {
- [self presentCustomModalViewController:viewController animated:YES];
-}
-
-
-- (void)presentCustomModalViewController:(UIViewController<SSModalViewController> *)viewController animated:(BOOL)animated {
- _customModalViewController = [viewController retain];
-
- if (_customModalViewController == nil) {
- return;
- }
-
- _customModalViewController.modalParentViewController = self;
-
- CGSize modalSize = kSSViewControllerDefaultContentSizeForViewInCustomModal;
- if ([_customModalViewController respondsToSelector:@selector(contentSizeForViewInCustomModal)]) {
- modalSize = [_customModalViewController contentSizeForViewInCustomModal];
- }
-
- if (_vignetteButton == nil) {
- _vignetteButton = [[UIButton alloc] initWithFrame:CGRectZero];
- [_vignetteButton setImage:[UIImage imageNamed:@"SSVignetteiPad.png" bundle:kSSToolkitBundleName] forState:UIControlStateNormal];
- _vignetteButton.adjustsImageWhenHighlighted = NO;
- _vignetteButton.alpha = 0.0f;
- }
-
- [self.view addSubview:_vignetteButton];
- [_vignetteButton fadeIn];
-
- if (_modalContainerBackgroundView == nil) {
- UIImage *modalBackgroundImage = [[UIImage imageNamed:@"SSViewControllerFormBackground.png" bundle:kSSToolkitBundleName] stretchableImageWithLeftCapWidth:43 topCapHeight:45];
- _modalContainerBackgroundView = [[UIImageView alloc] initWithImage:modalBackgroundImage];
- _modalContainerBackgroundView.autoresizesSubviews = NO;
- _modalContainerBackgroundView.userInteractionEnabled = YES;
- }
-
- [self.view addSubview:_modalContainerBackgroundView];
-
- if (_modalContainerView == nil) {
- _modalContainerView = [[UIView alloc] initWithFrame:CGRectMake(kSSViewControllerModalPadding, kSSViewControllerModalPadding, modalSize.width, modalSize.height)];
- _modalContainerView.layer.cornerRadius = 5.0f;
- _modalContainerView.clipsToBounds = YES;
- [_modalContainerBackgroundView addSubview:_modalContainerView];
- }
-
- UIView *modalView = _customModalViewController.view;
- [_modalContainerView addSubview:modalView];
- modalView.frame = CGRectMake(0.0f, 0.0f, modalSize.width, modalSize.height);
-
- CGSize screenSize;
- if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
- screenSize = CGSizeMake(1024.0f, 768.0f);
- } else {
- screenSize = CGSizeMake(768.0f, 1024.0f);
- }
-
- CGPoint originOffset = CGPointZero;
- if ([_customModalViewController respondsToSelector:@selector(originOffsetForViewInCustomModal)]) {
- originOffset = [_customModalViewController originOffsetForViewInCustomModal];
- }
-
- _modalContainerBackgroundView.frame = CGRectMake((roundf(screenSize.width - modalSize.width - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f) + originOffset.x, (roundf(screenSize.height - modalSize.height - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f) + originOffset.y + screenSize.height, modalSize.width + kSSViewControllerModalPadding + kSSViewControllerModalPadding, modalSize.height + kSSViewControllerModalPadding + kSSViewControllerModalPadding);
-
-
- if ([_customModalViewController respondsToSelector:@selector(viewWillAppear:)]) {
- [_customModalViewController viewWillAppear:animated];
- }
-
- [self customModalWillAppear:animated];
-
- if (animated) {
- [UIView beginAnimations:@"com.samsoffes.sstoolkit.ssviewcontroller.present-modal" context:self];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
- [UIView setAnimationDuration:0.5];
- [UIView setAnimationDelegate:self];
- [UIView setAnimationDidStopSelector:@selector(_presentModalAnimationDidStop:finished:context:)];
- }
-
- [self layoutViews];
-
- if (animated) {
- [UIView commitAnimations];
- } else {
- [self _presentModalAnimationDidStop:nil finished:nil context:nil];
- }
-}
-
-
-- (void)dismissCustomModalViewController {
- [self dismissCustomModalViewController:YES];
-}
-
-
-- (void)dismissCustomModalViewController:(BOOL)animated {
- CGSize screenSize;
- if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
- screenSize = CGSizeMake(1024.0f, 768.0f);
- } else {
- screenSize = CGSizeMake(768.0f, 1024.0f);
- }
-
- CGSize modalSize = kSSViewControllerDefaultContentSizeForViewInCustomModal;
- if ([_customModalViewController respondsToSelector:@selector(contentSizeForViewInCustomModal)]) {
- modalSize = [_customModalViewController contentSizeForViewInCustomModal];
- }
-
- if ([_customModalViewController respondsToSelector:@selector(viewWillDisappear:)]) {
- [_customModalViewController viewWillDisappear:animated];
- }
-
- [self customModalWillDisappear:animated];
-
- if (animated) {
- [UIView beginAnimations:@"com.samsoffes.sstoolkit.ssviewcontroller.dismiss-modal" context:self];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
- [UIView setAnimationDuration:0.4];
- [UIView setAnimationDelegate:self];
- [UIView setAnimationDidStopSelector:@selector(_dismissModalAnimationDidStop:finished:context:)];
- } else {
- [self _dismissModalAnimationDidStop:nil finished:nil context:nil];
- }
-
- _modalContainerBackgroundView.frame = CGRectMake(roundf(screenSize.width - modalSize.width - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f, (roundf(screenSize.height - modalSize.height - kSSViewControllerModalPadding - kSSViewControllerModalPadding) / 2.0f) + screenSize.height, modalSize.width + kSSViewControllerModalPadding + kSSViewControllerModalPadding, modalSize.height + kSSViewControllerModalPadding + kSSViewControllerModalPadding);
-
- if (animated) {
- [UIView commitAnimations];
-
- [UIView beginAnimations:@"com.samsoffes.sstoolkit.ssviewcontroller.remove-vignette" context:self];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
- [UIView setAnimationDelay:0.2];
- [UIView setAnimationDelegate:self];
- [UIView setAnimationDidStopSelector:@selector(_dismissVignetteAnimationDidStop:finished:context:)];
- }
-
- _vignetteButton.alpha = 0.0f;
-
- if (animated) {
- [UIView commitAnimations];
- } else {
- [self _dismissVignetteAnimationDidStop:nil finished:nil context:nil];
- }
-}
-
-
-- (void)customModalWillAppear:(BOOL)animated {
- // Can be overridden by a subclass
-}
-
-
-- (void)customModalDidAppear:(BOOL)animated {
- // Can be overridden by a subclass
-}
-
-
-- (void)customModalWillDisappear:(BOOL)animated {
- // Can be overridden by a subclass
-}
-
-
-- (void)customModalDidDisappear:(BOOL)animated {
- // Can be overridden by a subclass
-}
-
-
-#pragma mark -
-#pragma mark Private Methods
-
-- (void)_cleanUpModal {
- [_modalContainerBackgroundView removeFromSuperview];
- [_modalContainerBackgroundView release];
- _modalContainerBackgroundView = nil;
-
- [_vignetteButton removeFromSuperview];
- [_vignetteButton release];
- _vignetteButton = nil;
-
- [_customModalViewController release];
- _customModalViewController = nil;
-
- [_modalContainerView release];
- _modalContainerView = nil;
-}
-
-
-- (void)_presentModalAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- BOOL animated = (animationID != nil);
-
- if ([_customModalViewController respondsToSelector:@selector(viewDidAppear:)]) {
- [_customModalViewController viewDidAppear:animated];
- }
-
- [self customModalDidAppear:animated];
-
- if ([_customModalViewController respondsToSelector:@selector(dismissCustomModalOnVignetteTap)] && [_customModalViewController dismissCustomModalOnVignetteTap] == YES) {
- [_vignetteButton addTarget:self action:@selector(dismissCustomModalViewController) forControlEvents:UIControlEventTouchUpInside];
- }
-}
-
-
-- (void)_dismissModalAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- BOOL animated = (animationID != nil);
-
- if ([_customModalViewController respondsToSelector:@selector(viewDidDisappear:)]) {
- [_customModalViewController viewDidDisappear:animated];
- }
-
- [self customModalDidDisappear:animated];
-}
-
-
-- (void)_dismissVignetteAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- [self _cleanUpModal];
-}
-
-@end
Please sign in to comment.
Something went wrong with that request. Please try again.