Skip to content
Browse files

converted to ARC

  • Loading branch information...
1 parent 25c3889 commit 5cb7f6503768fd3957d9655efca9e53aedabe145 @alist committed Jun 6, 2012
View
32 .gitignore
@@ -1,15 +1,25 @@
-# Xcode
+# xcode noise
build/*
*.pbxuser
-!default.pbxuser
*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-*.xcworkspace
-!default.xcworkspace
-xcuserdata
+
+# old skool
+.svn
+
+# osx noise
+.DS_Store
profile
-*.moved-aside
+
+src/swypPhotos.xcodeproj/project.xcworkspace/xcuserdata/*
+*.xcodeproj/xcuserdata/*
+*.xcodeproj/project.xcworkspace/xcuserdata/*
+*.xcuserdatad/*
+*xcodeproj/project.xcworkspace/*
+
+*.perspective
+*.perspectivev3
+*.swp
+*~.nib
+aho.perspectivev3
+aho.xcuserdatad
+alist.xcuserdatad
View
16 Source/BHTabStyle.h
@@ -29,17 +29,17 @@
@property (nonatomic, assign) CGFloat shadowRadius;
-@property (nonatomic, retain) UIColor *selectedTabColor;
-@property (nonatomic, retain) UIColor *selectedTitleTextColor;
-@property (nonatomic, retain) UIFont *selectedTitleFont;
+@property (nonatomic, strong) UIColor *selectedTabColor;
+@property (nonatomic, strong) UIColor *selectedTitleTextColor;
+@property (nonatomic, strong) UIFont *selectedTitleFont;
@property (nonatomic, assign) CGSize selectedTitleShadowOffset;
-@property (nonatomic, retain) UIColor *selectedTitleShadowColor;
+@property (nonatomic, strong) UIColor *selectedTitleShadowColor;
-@property (nonatomic, retain) UIColor *unselectedTabColor;
-@property (nonatomic, retain) UIColor *unselectedTitleTextColor;
-@property (nonatomic, retain) UIFont *unselectedTitleFont;
+@property (nonatomic, strong) UIColor *unselectedTabColor;
+@property (nonatomic, strong) UIColor *unselectedTitleTextColor;
+@property (nonatomic, strong) UIFont *unselectedTitleFont;
@property (nonatomic, assign) CGSize unselectedTitleShadowOffset;
-@property (nonatomic, retain) UIColor *unselectedTitleShadowColor;
+@property (nonatomic, strong) UIColor *unselectedTitleShadowColor;
+ (BHTabStyle *)defaultStyle;
View
2 Source/BHTabStyle.m
@@ -48,7 +48,7 @@ - (void)setTabHeight:(NSUInteger)newTabHeight {
}
+ (BHTabStyle *)defaultStyle {
- return [[[BHTabStyle alloc] init] autorelease];
+ return [[BHTabStyle alloc] init];
}
@end
View
6 Source/BHTabView.h
@@ -9,10 +9,10 @@
@interface BHTabView : UIView
-@property (nonatomic, retain, readonly) UILabel *titleLabel;
-@property (nonatomic, assign) id <BHTabViewDelegate> delegate;
+@property (nonatomic, strong, readonly) UILabel *titleLabel;
+@property (nonatomic, unsafe_unretained) id <BHTabViewDelegate> delegate;
@property (nonatomic, assign) BOOL selected;
-@property (nonatomic, retain) BHTabStyle *style;
+@property (nonatomic, strong) BHTabStyle *style;
- (id)initWithFrame:(CGRect)frame title:(NSString *)title;
View
18 Source/BHTabView.m
@@ -21,7 +21,7 @@ static inline CGFloat radians(CGFloat degrees) {
@interface BHTabView ()
-@property (nonatomic, retain, readwrite) UILabel *titleLabel;
+@property (nonatomic, strong, readwrite) UILabel *titleLabel;
- (CGFloat)_sectionWidth;
- (CGSize)_gridSize;
@@ -43,7 +43,7 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title {
self.style = [BHTabStyle defaultStyle];
CGRect labelFrame = [self _tabRect];
- self.titleLabel = [[[UILabel alloc] initWithFrame:labelFrame] autorelease];
+ self.titleLabel = [[UILabel alloc] initWithFrame:labelFrame];
self.titleLabel.text = title;
self.titleLabel.textAlignment = UITextAlignmentCenter;
self.titleLabel.lineBreakMode = UILineBreakModeTailTruncation;
@@ -54,9 +54,9 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title {
self.titleLabel.shadowOffset = self.style.unselectedTitleShadowOffset;
[self addSubview:self.titleLabel];
- [self addGestureRecognizer:[[[UITapGestureRecognizer alloc]
+ [self addGestureRecognizer:[[UITapGestureRecognizer alloc]
initWithTarget:self
- action:@selector(_onTap:)] autorelease]];
+ action:@selector(_onTap:)]];
}
return self;
@@ -149,9 +149,9 @@ - (void)drawRect:(CGRect)rect {
CGColorRef startColor = [UIColor whiteColor].CGColor;
CGColorRef endColor = tabColor;
- NSArray *colors = [NSArray arrayWithObjects:(id)startColor, (id)endColor, nil];
+ NSArray *colors = [NSArray arrayWithObjects:(__bridge id)startColor, (__bridge id)endColor, nil];
- CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)colors, locations);
+ CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)colors, locations);
CGRect tabRect = [self _tabRect];
CGPoint startPoint = CGPointMake(CGRectGetMidX(tabRect), tabRect.origin.y);
@@ -186,11 +186,5 @@ - (void)setSelected:(BOOL)isSelected {
[self setNeedsDisplay];
}
-- (void)dealloc {
- self.titleLabel = nil;
- self.style = nil;
-
- [super dealloc];
-}
@end
View
2 Source/BHTabsFooterView.h
@@ -6,6 +6,6 @@
@interface BHTabsFooterView : UIView
-@property (nonatomic, retain) BHTabStyle *style;
+@property (nonatomic, strong) BHTabStyle *style;
@end
View
4 Source/BHTabsFooterView.m
@@ -31,9 +31,5 @@ - (void)drawRect:(CGRect)rect {
CGContextRestoreGState(context);
}
-- (void)dealloc {
- [style release];
- [super dealloc];
-}
@end
View
4 Source/BHTabsView.h
@@ -7,8 +7,8 @@
BHTabStyle *style;
}
-@property (nonatomic, retain) NSArray *tabViews;
-@property (nonatomic, retain) BHTabStyle *style;
+@property (nonatomic, strong) NSArray *tabViews;
+@property (nonatomic, strong) BHTabStyle *style;
@end
View
6 Source/BHTabsView.m
@@ -29,11 +29,5 @@ - (void)layoutSubviews {
}
}
-- (void)dealloc {
- self.tabViews = nil;
- self.style = nil;
-
- [super dealloc];
-}
@end
View
10 Source/BHTabsViewController.h
@@ -18,17 +18,17 @@
@interface BHTabsViewController : UIViewController <BHTabViewDelegate> {
NSArray *tabNames;
- UIView *contentView;
+ UIView *__weak contentView;
BHTabsView *tabsContainerView;
BHTabsFooterView *footerView;
BHTabStyle *tabStyle;
NSUInteger currentTabIndex;
- id <BHTabsViewControllerDelegate> delegate;
+ id <BHTabsViewControllerDelegate> __unsafe_unretained delegate;
}
-@property (nonatomic, assign) id <BHTabsViewControllerDelegate> delegate;
-@property (nonatomic, assign, readonly) UIView *contentView;
-@property (nonatomic, retain) BHTabStyle *style;
+@property (nonatomic, unsafe_unretained) id <BHTabsViewControllerDelegate> delegate;
+@property (nonatomic, weak, readonly) UIView *contentView;
+@property (nonatomic, strong) BHTabStyle *style;
-(id)initWithTabNames:(NSArray*)tabNames style:(BHTabStyle *)style;
View
19 Source/BHTabsViewController.m
@@ -7,10 +7,10 @@
@interface BHTabsViewController ()
-@property (nonatomic, retain) NSArray *tabNames;
+@property (nonatomic, strong) NSArray *tabNames;
@property (nonatomic, assign, readwrite) UIView *contentView;
-@property (nonatomic, retain) BHTabsView *tabsContainerView;
-@property (nonatomic, retain) BHTabsFooterView *footerView;
+@property (nonatomic, strong) BHTabsView *tabsContainerView;
+@property (nonatomic, strong) BHTabsFooterView *footerView;
@end
@@ -32,14 +32,6 @@ -(id)initWithTabNames:(NSArray*)theTabNames style:(BHTabStyle *)theStyle{
}
-- (void)dealloc {
- self.style = nil;
- self.tabNames = nil;
- self.tabsContainerView = nil;
- self.footerView = nil;
-
- [super dealloc];
-}
- (void)_reconfigureTabs {
NSUInteger thisIndex = 0;
@@ -89,15 +81,14 @@ - (void)loadView {
CGRect frame = [UIScreen mainScreen].applicationFrame;
UIView *view = [[UIView alloc] initWithFrame:frame];
self.view = view;
- [view release];
self.view.backgroundColor = [UIColor clearColor];
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth;
// The view that contains the tab views is located across the top.
CGRect tabsViewFrame = CGRectMake(0, 0, frame.size.width, self.style.tabsViewHeight);
- self.tabsContainerView = [[[BHTabsView alloc] initWithFrame:tabsViewFrame] autorelease];
+ self.tabsContainerView = [[BHTabsView alloc] initWithFrame:tabsViewFrame];
self.tabsContainerView.backgroundColor = [UIColor clearColor];
self.tabsContainerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.tabsContainerView.style = self.style;
@@ -140,7 +131,7 @@ - (void)loadView {
tabsViewFrame.size.width,
self.style.tabBarHeight + self.style.shadowRadius);
- self.footerView = [[[BHTabsFooterView alloc] initWithFrame:footerFrame] autorelease];
+ self.footerView = [[BHTabsFooterView alloc] initWithFrame:footerFrame];
self.footerView.backgroundColor = [UIColor clearColor];
self.footerView.style = self.style;
self.footerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

0 comments on commit 5cb7f65

Please sign in to comment.
Something went wrong with that request. Please try again.