Permalink
Browse files

Rename again

  • Loading branch information...
1 parent 500f761 commit 0aa7b19e25e4edc615cecdf225f137919d265853 @rs committed Sep 26, 2012
View
13 Example/Example.xcodeproj/project.pbxproj
@@ -18,7 +18,7 @@
53A2E91916135610002BE760 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 53A2E91816135610002BE760 /* Default-568h@2x.png */; };
53A2E91C16135610002BE760 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A2E91B16135610002BE760 /* ViewController.m */; };
53A2E91F16135610002BE760 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 53A2E91D16135610002BE760 /* ViewController.xib */; };
- 53A2E9271613568D002BE760 /* SDWellSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A2E9251613568D002BE760 /* SDWellSegmentedControl.m */; };
+ 53A2E9271613568D002BE760 /* SDSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A2E9251613568D002BE760 /* SDSegmentedControl.m */; };
53A2E929161357E0002BE760 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53A2E928161357E0002BE760 /* QuartzCore.framework */; };
/* End PBXBuildFile section */
@@ -39,8 +39,8 @@
53A2E91A16135610002BE760 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
53A2E91B16135610002BE760 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
53A2E91E16135610002BE760 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; };
- 53A2E9251613568D002BE760 /* SDWellSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDWellSegmentedControl.m; path = ../../SDWellSegmentedControl.m; sourceTree = "<group>"; };
- 53A2E9261613568D002BE760 /* SDWellSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDWellSegmentedControl.h; path = ../../SDWellSegmentedControl.h; sourceTree = "<group>"; };
+ 53A2E9251613568D002BE760 /* SDSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDSegmentedControl.m; path = ../../SDSegmentedControl.m; sourceTree = "<group>"; };
+ 53A2E9261613568D002BE760 /* SDSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDSegmentedControl.h; path = ../../SDSegmentedControl.h; sourceTree = "<group>"; };
53A2E928161357E0002BE760 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -95,8 +95,8 @@
53A2E91A16135610002BE760 /* ViewController.h */,
53A2E91B16135610002BE760 /* ViewController.m */,
53A2E91D16135610002BE760 /* ViewController.xib */,
- 53A2E9261613568D002BE760 /* SDWellSegmentedControl.h */,
- 53A2E9251613568D002BE760 /* SDWellSegmentedControl.m */,
+ 53A2E9261613568D002BE760 /* SDSegmentedControl.h */,
+ 53A2E9251613568D002BE760 /* SDSegmentedControl.m */,
53A2E90916135610002BE760 /* Supporting Files */,
);
path = Example;
@@ -185,7 +185,7 @@
53A2E90F16135610002BE760 /* main.m in Sources */,
53A2E91316135610002BE760 /* AppDelegate.m in Sources */,
53A2E91C16135610002BE760 /* ViewController.m in Sources */,
- 53A2E9271613568D002BE760 /* SDWellSegmentedControl.m in Sources */,
+ 53A2E9271613568D002BE760 /* SDSegmentedControl.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -301,6 +301,7 @@
53A2E92416135610002BE760 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
View
2 Example/Example/en.lproj/ViewController.xib
@@ -621,7 +621,7 @@
<reference ref="975504140"/>
<reference ref="173457570"/>
</array>
- <string key="8.CustomClassName">SDWellSegmentedControl</string>
+ <string key="8.CustomClassName">SDSegmentedControl</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO" key="8.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<integer value="2" key="8.IUISegmentedControlInspectorSelectedSegmentMetadataKey"/>
View
10 README.md
@@ -1,14 +1,14 @@
-# Well Segmented Control
+# Segmented Control
A drop-in remplacement for UISegmentedControl that mimic iOS 6 AppStore tab
controls.
-![The only good piece of UI to extract for this terrible app](https://raw.github.com/rs/SDWellSegmentedControl/master/Screenshots/screenshot-1.png)
+![The only good piece of UI to extract for this terrible app](https://raw.github.com/rs/SDSegmentedControl/master/Screenshots/screenshot-1.png)
## Features:
- Interface Builder support (just throw a UISegmentedControl and change
- its class SDWellSegmentedControl)
+ its class SDSegmentedControl)
- Animated segment selection
- Content aware dynamic segment width
@@ -18,11 +18,11 @@ controls.
# Usage
-Import `SDWellSegmentedControl.h` and `SDWellSegmentedControl.m` into your
+Import `SDSegmentedControl.h` and `SDSegmentedControl.m` into your
project and add `QuartzCore` framework to `Build Phases` -> `Link Binary With
Libraries`.
-You can then use `SDWellSegmentedControl` class as you would use normal
+You can then use `SDSegmentedControl` class as you would use normal
`UISegmentedControl`.
# Known Issues
View
2 SDWellSegmentedControl.h → SDSegmentedControl.h
@@ -5,7 +5,7 @@
#import <UIKit/UIKit.h>
-@interface SDWellSegmentedControl : UISegmentedControl
+@interface SDSegmentedControl : UISegmentedControl
@property (assign, nonatomic) CGFloat arrowSize;
View
34 SDWellSegmentedControl.m → SDSegmentedControl.m
@@ -1,22 +1,22 @@
//
-// SDWellSegmentedControl.m
+// SDSegmentedControl.m
// Created by Olivier Poitrey on 22/09/12.
//
-#import "SDWellSegmentedControl.h"
+#import "SDSegmentedControl.h"
#import <QuartzCore/QuartzCore.h>
-@interface WellView : UIView
+@interface StainView : UIView
@end
-@interface SDWellSegmentedControl ()
+@interface SDSegmentedControl ()
@property (strong, nonatomic) NSMutableArray *_items;
-@property (strong, nonatomic) UIView *_selectedWellView;
+@property (strong, nonatomic) UIView *_selectedStainView;
@end
-@implementation SDWellSegmentedControl
+@implementation SDSegmentedControl
{
NSInteger _selectedSegmentIndex;
}
@@ -71,24 +71,24 @@ - (void)commonInit
self.layer.shadowRadius = 2;
self.layer.shadowOpacity = 0.6;
self.layer.shadowOffset = CGSizeMake(0, 1);
- [self addSubview:self._selectedWellView = WellView.new];
- self._selectedWellView.backgroundColor = [UIColor colorWithRed:0.816 green:0.816 blue:0.816 alpha:1];
+ [self addSubview:self._selectedStainView = StainView.new];
+ self._selectedStainView.backgroundColor = [UIColor colorWithRed:0.816 green:0.816 blue:0.816 alpha:1];
}
- (void)insertSegmentWithImage:(UIImage *)image atIndex:(NSUInteger)segment animated:(BOOL)animated
{
- NSAssert(NO, @"insertSegmentWithImage:atIndex:animated: is not supported on SDWellSegmentedControl");
+ NSAssert(NO, @"insertSegmentWithImage:atIndex:animated: is not supported on SDSegmentedControl");
}
- (UIImage *)imageForSegmentAtIndex:(NSUInteger)segment
{
- NSAssert(NO, @"imageForSegmentAtIndex: is not supported on SDWellSegmentedControl");
+ NSAssert(NO, @"imageForSegmentAtIndex: is not supported on SDSegmentedControl");
return nil;
}
- (void)setImage:(UIImage *)image forSegmentAtIndex:(NSUInteger)segment
{
- NSAssert(NO, @"setImage:forSegmentAtIndex: is not supported on SDWellSegmentedControl");
+ NSAssert(NO, @"setImage:forSegmentAtIndex: is not supported on SDSegmentedControl");
}
- (void)setTitle:(NSString *)title forSegmentAtIndex:(NSUInteger)segment
@@ -268,19 +268,19 @@ - (void)layoutSegments
if (self.selectedSegmentIndex == -1)
{
- self._selectedWellView.hidden = 0;
+ self._selectedStainView.hidden = 0;
[self drawSelectedMaskAtPosition:-1];
}
else
{
UIView *selectedItem = self._items[self.selectedSegmentIndex];
- CGRect wellFrame = CGRectInset(selectedItem.frame, -15, -3);
- self._selectedWellView.layer.cornerRadius = wellFrame.size.height / 2;
- BOOL animated = !self._selectedWellView.hidden && !CGRectEqualToRect(self._selectedWellView.frame, CGRectZero);
+ CGRect stainFrame = CGRectInset(selectedItem.frame, -15, -3);
+ self._selectedStainView.layer.cornerRadius = stainFrame.size.height / 2;
+ BOOL animated = !self._selectedStainView.hidden && !CGRectEqualToRect(self._selectedStainView.frame, CGRectZero);
UIView.animationsEnabled = animated;
[UIView animateWithDuration:animated ? 0.2 : 0 animations:^
{
- self._selectedWellView.frame = wellFrame;
+ self._selectedStainView.frame = stainFrame;
}
completion:^(BOOL finished)
{
@@ -336,7 +336,7 @@ - (void)handleSelect:(UIGestureRecognizer *)gestureRecognizer
@end
-@implementation WellView
+@implementation StainView
- (id)init
{

0 comments on commit 0aa7b19

Please sign in to comment.