Skip to content

Commit

Permalink
migrated all code to NI_WEAK & NI_STRONG
Browse files Browse the repository at this point in the history
  • Loading branch information
yosit committed Oct 15, 2012
1 parent f0ac768 commit 37e4acb
Show file tree
Hide file tree
Showing 29 changed files with 98 additions and 89 deletions.
8 changes: 4 additions & 4 deletions src/attributedlabel/src/NIAttributedLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ typedef enum {
- (void)addLink:(NSURL *)urlLink range:(NSRange)range;
- (void)removeAllExplicitLinks; // Removes all links that were added by addLink:range:. Does not remove autodetected links.

@property (nonatomic, strong) UIColor* linkColor; // Default: [UIColor blueColor]
@property (nonatomic, strong) UIColor* highlightedLinkBackgroundColor; // Default: [UIColor colorWithWhite:0.5 alpha:0.5
@property (nonatomic, NI_STRONG) UIColor* linkColor; // Default: [UIColor blueColor]
@property (nonatomic, NI_STRONG) UIColor* highlightedLinkBackgroundColor; // Default: [UIColor colorWithWhite:0.5 alpha:0.5
@property (nonatomic, assign) BOOL linksHaveUnderlines; // Default: NO
@property (nonatomic, copy) NSDictionary *attributesForLinks; // Default: nil
@property (nonatomic, copy) NSDictionary *attributesForHighlightedLink; // Default: nil
Expand All @@ -95,7 +95,7 @@ typedef enum {
@property (nonatomic, assign) CTUnderlineStyleModifiers underlineStyleModifier;
@property (nonatomic, assign) CGFloat shadowBlur; // Default: 0
@property (nonatomic, assign) CGFloat strokeWidth;
@property (nonatomic, strong) UIColor* strokeColor;
@property (nonatomic, NI_STRONG) UIColor* strokeColor;
@property (nonatomic, assign) CGFloat textKern;

- (void)setTextColor:(UIColor *)textColor range:(NSRange)range;
Expand All @@ -109,7 +109,7 @@ typedef enum {
- (void)insertImage:(UIImage *)image atIndex:(NSInteger)index margins:(UIEdgeInsets)margins;
- (void)insertImage:(UIImage *)image atIndex:(NSInteger)index margins:(UIEdgeInsets)margins verticalTextAlignment:(NIVerticalTextAlignment)verticalTextAlignment;

@property (nonatomic, assign) IBOutlet id<NIAttributedLabelDelegate> delegate;
@property (nonatomic, NI_WEAK) IBOutlet id<NIAttributedLabelDelegate> delegate;
@end

/**
Expand Down
20 changes: 10 additions & 10 deletions src/attributedlabel/src/NIAttributedLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ CGSize NISizeOfAttributedStringConstrainedToSize(NSAttributedString *attributedS

@interface NIAttributedLabelImage : NSObject
@property (nonatomic, assign) NSInteger index;
@property (nonatomic, strong) UIImage* image;
@property (nonatomic, NI_STRONG) UIImage* image;
@property (nonatomic, assign) UIEdgeInsets margins;
@property (nonatomic, assign) NIVerticalTextAlignment verticalTextAlignment;
@property (nonatomic, weak) NIAttributedLabel* label;
@property (nonatomic, NI_WEAK) NIAttributedLabel* label;
@end

@implementation NIAttributedLabelImage
Expand All @@ -91,19 +91,19 @@ @implementation NIAttributedLabelImage


@interface NIAttributedLabel() <UIActionSheetDelegate>
@property (nonatomic, strong) NSMutableAttributedString* mutableAttributedString;
@property (nonatomic, NI_STRONG) NSMutableAttributedString* mutableAttributedString;
@property (nonatomic, assign) CTFrameRef textFrame;
@property (assign) BOOL detectingLinks; // Atomic.
@property (nonatomic, assign) BOOL linksHaveBeenDetected;
@property (nonatomic, copy) NSArray* detectedlinkLocations;
@property (nonatomic, strong) NSMutableArray* explicitLinkLocations;
@property (nonatomic, strong) NSTextCheckingResult* originalLink;
@property (nonatomic, strong) NSTextCheckingResult* touchedLink;
@property (nonatomic, strong) NSTimer* longPressTimer;
@property (nonatomic, NI_STRONG) NSMutableArray* explicitLinkLocations;
@property (nonatomic, NI_STRONG) NSTextCheckingResult* originalLink;
@property (nonatomic, NI_STRONG) NSTextCheckingResult* touchedLink;
@property (nonatomic, NI_STRONG) NSTimer* longPressTimer;
@property (nonatomic, assign) CGPoint touchPoint;
@property (nonatomic, strong) NSTextCheckingResult* actionSheetLink;
@property (nonatomic, strong) NSArray *accessibleElements;
@property (nonatomic, strong) NSMutableArray *images;
@property (nonatomic, NI_STRONG) NSTextCheckingResult* actionSheetLink;
@property (nonatomic, NI_STRONG) NSArray *accessibleElements;
@property (nonatomic, NI_STRONG) NSMutableArray *images;
@end


Expand Down
10 changes: 6 additions & 4 deletions src/badge/src/NIBadgeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#import <UIKit/UIKit.h>

#import "NIPreprocessorMacros.h" /* for NI_WEAK */

/**
* A view that mimics the iOS notification badge style.
*
Expand All @@ -32,12 +34,12 @@

// Text attributes
@property (nonatomic, readwrite, copy) NSString* text;
@property (nonatomic, readwrite, retain) UIFont* font;
@property (nonatomic, readwrite, retain) UIColor* textColor;
@property (nonatomic, readwrite, NI_STRONG) UIFont* font;
@property (nonatomic, readwrite, NI_STRONG) UIColor* textColor;

// Badge attributes
@property (nonatomic, readwrite, retain) UIColor* tintColor;
@property (nonatomic, readwrite, retain) UIColor* shadowColor;
@property (nonatomic, readwrite, NI_STRONG) UIColor* tintColor;
@property (nonatomic, readwrite, NI_STRONG) UIColor* shadowColor;
@property (nonatomic, readwrite, assign) CGSize shadowOffset;
@property (nonatomic, readwrite, assign) CGFloat shadowBlur;

Expand Down
8 changes: 5 additions & 3 deletions src/core/src/NINavigationAppearance.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#import "NIDebuggingTools.h"
#import "NISDKAvailability.h"

#import "NIPreprocessorMacros.h" /* for NI_WEAK */

#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "Nimbus requires ARC support."
#endif
Expand Down Expand Up @@ -60,17 +62,17 @@ @interface NINavigationAppearanceSnapshot : NSObject {
/**
* Holds value of UINavigationBar's tintColor property.
*/
@property (nonatomic, readonly, strong) UIColor* navBarTintColor;
@property (nonatomic, readonly, NI_STRONG) UIColor* navBarTintColor;

/**
* Holds value of UINavigationBar's UIBarMetricsDefault backgroundImage property.
*/
@property (nonatomic, readonly, strong) UIImage* navBarDefaultImage;
@property (nonatomic, readonly, NI_STRONG) UIImage* navBarDefaultImage;

/**
* Holds value of UINavigationBar's UIBarMetricsLandscapePhone backgroundImage property.
*/
@property (nonatomic, readonly, strong) UIImage* navBarLandscapePhoneImage;
@property (nonatomic, readonly, NI_STRONG) UIImage* navBarLandscapePhoneImage;

/**
* Create a new snapshot.
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/NISnapshotRotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO


@interface NITableViewSnapshotRotation() <NISnapshotRotationDelegate>
@property (nonatomic, readwrite, weak) id<NISnapshotRotationDelegate> forwardingDelegate;
@property (nonatomic, readwrite, NI_WEAK) id<NISnapshotRotationDelegate> forwardingDelegate;
@end


Expand Down
1 change: 1 addition & 0 deletions src/css/src/NIDOM.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class NIStylesheet;

Expand Down
2 changes: 1 addition & 1 deletion src/launcher/src/NILauncherButtonView.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
@interface NILauncherButtonView : NIRecyclableView <NILauncherButtonView, NILauncherViewObjectView>

@property (nonatomic, readwrite, retain) UIButton* button;
@property (nonatomic, readwrite, NI_STRONG) UIButton* button;
@property (nonatomic, readwrite, copy) UILabel* label;

@property (nonatomic, readwrite, assign) UIEdgeInsets contentInset;
Expand Down
4 changes: 2 additions & 2 deletions src/launcher/src/NILauncherPageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
*/
@interface NILauncherPageView : NIPageView

@property (nonatomic, readwrite, retain) NIViewRecycler* viewRecycler;
@property (nonatomic, readwrite, NI_STRONG) NIViewRecycler* viewRecycler;

- (void)addRecyclableView:(UIView<NIRecyclableView> *)view;
@property (nonatomic, readonly, retain) NSArray* recyclableViews;
@property (nonatomic, readonly, NI_STRONG) NSArray* recyclableViews;

@property (nonatomic, readwrite, assign) UIEdgeInsets contentInset;
@property (nonatomic, readwrite, assign) CGSize viewSize;
Expand Down
2 changes: 1 addition & 1 deletion src/launcher/src/NILauncherPageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif

@interface NILauncherPageView()
@property (nonatomic, readwrite, retain) NSMutableArray* mutableRecyclableViews;
@property (nonatomic, readwrite, NI_STRONG) NSMutableArray* mutableRecyclableViews;
@end

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions src/launcher/src/NILauncherView.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ extern const NSInteger NILauncherViewGridBasedOnButtonSize;
@property (nonatomic, readwrite, assign) NSInteger numberOfColumns; // Default: NILauncherViewGridBasedOnButtonSize

- (void)reloadData;
@property (nonatomic, readwrite, assign) id<NILauncherDelegate> delegate;
@property (nonatomic, readwrite, assign) id<NILauncherDataSource> dataSource;
@property (nonatomic, readwrite, NI_WEAK) id<NILauncherDelegate> delegate;
@property (nonatomic, readwrite, NI_WEAK) id<NILauncherDataSource> dataSource;

- (UIView<NILauncherButtonView> *)dequeueReusableViewWithIdentifier:(NSString *)identifier;

Expand Down Expand Up @@ -160,7 +160,7 @@ extern const NSInteger NILauncherViewGridBasedOnButtonSize;
/**
* Requires the view to contain a button subview.
*/
@property (nonatomic, readwrite, retain) UIButton* button;
@property (nonatomic, readwrite, NI_STRONG) UIButton* button;

@end

Expand Down
6 changes: 3 additions & 3 deletions src/launcher/src/NILauncherView.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@

///////////////////////////////////////////////////////////////////////////////////////////////////
@interface NILauncherView() <NIPagingScrollViewDataSource, NIPagingScrollViewDelegate>
@property (nonatomic, readwrite, retain) NIPagingScrollView* pagingScrollView;
@property (nonatomic, readwrite, retain) UIPageControl* pager;
@property (nonatomic, readwrite, NI_STRONG) NIPagingScrollView* pagingScrollView;
@property (nonatomic, readwrite, NI_STRONG) UIPageControl* pager;
@property (nonatomic, readwrite, assign) NSInteger numberOfPages;
@property (nonatomic, readwrite, retain) NIViewRecycler* viewRecycler;
@property (nonatomic, readwrite, NI_STRONG) NIViewRecycler* viewRecycler;
- (void)updateLayoutForPage:(NILauncherPageView *)page;
@end

Expand Down
2 changes: 1 addition & 1 deletion src/launcher/src/NILauncherViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
@interface NILauncherViewController : UIViewController <NILauncherDelegate, NILauncherDataSource>

@property (nonatomic, readwrite, retain) NILauncherView* launcherView;
@property (nonatomic, readwrite, NI_STRONG) NILauncherView* launcherView;

@end

Expand Down
4 changes: 2 additions & 2 deletions src/launcher/src/NILauncherViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

- (id<NILauncherViewObject>)objectAtIndex:(NSInteger)index pageIndex:(NSInteger)pageIndex;

@property (nonatomic, readwrite, assign) id<NILauncherViewModelDelegate> delegate;
@property (nonatomic, readwrite, NI_WEAK) id<NILauncherViewModelDelegate> delegate;

@end

Expand Down Expand Up @@ -89,7 +89,7 @@
/**
* The image that will be displayed on the launcher view button.
*/
@property (nonatomic, readwrite, retain) UIImage* image;
@property (nonatomic, readwrite, NI_STRONG) UIImage* image;

/**
* The class of button view that should be used to display this object.
Expand Down
2 changes: 1 addition & 1 deletion src/launcher/src/NILauncherViewModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif

@interface NILauncherViewModel()
@property (nonatomic, readwrite, retain) NSMutableArray* pages;
@property (nonatomic, readwrite, NI_STRONG) NSMutableArray* pages;
@end

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions src/models/src/NITableViewActions.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ @interface NITableViewAction : NSObject

@interface NITableViewActions()

@property (nonatomic, weak) UIViewController* controller;
@property (nonatomic, strong) NSMutableSet* forwardDelegates;
@property (nonatomic, strong) NSMutableDictionary* objectMap;
@property (nonatomic, strong) NSMutableSet* objectSet;
@property (nonatomic, strong) NSMutableDictionary* classMap;
@property (nonatomic, NI_WEAK) UIViewController* controller;
@property (nonatomic, NI_STRONG) NSMutableSet* forwardDelegates;
@property (nonatomic, NI_STRONG) NSMutableDictionary* objectMap;
@property (nonatomic, NI_STRONG) NSMutableSet* objectSet;
@property (nonatomic, NI_STRONG) NSMutableDictionary* classMap;

@end

Expand Down
10 changes: 5 additions & 5 deletions src/networkimage/src/NINetworkImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef enum {
@property (readwrite, assign) NINetworkImageViewScaleOptions scaleOptions;
@property (readwrite, assign) CGInterpolationQuality interpolationQuality;
@property (readwrite, assign) UIViewContentMode imageContentMode;
@property (readwrite, retain) UIImage* imageCroppedAndSizedForDisplay;
@property (readwrite, NI_STRONG) UIImage* imageCroppedAndSizedForDisplay;
@end

/**
Expand All @@ -75,15 +75,15 @@ typedef enum {

#pragma mark Configurable Presentation Properties

@property (nonatomic, readwrite, retain) UIImage* initialImage; // Default: nil
@property (nonatomic, readwrite, NI_STRONG) UIImage* initialImage; // Default: nil
@property (nonatomic, readwrite, assign) BOOL sizeForDisplay; // Default: YES
@property (nonatomic, readwrite, assign) NINetworkImageViewScaleOptions scaleOptions; // Default: NINetworkImageViewScaleToFitLeavesExcessAndScaleToFillCropsExcess
@property (nonatomic, readwrite, assign) CGInterpolationQuality interpolationQuality; // Default: kCGInterpolationDefault

#pragma mark Configurable Properties

@property (nonatomic, readwrite, retain) NIImageMemoryCache* imageMemoryCache; // Default: [Nimbus imageMemoryCache]
@property (nonatomic, readwrite, retain) NSOperationQueue* networkOperationQueue; // Default: [Nimbus networkOperationQueue]
@property (nonatomic, readwrite, NI_STRONG) NIImageMemoryCache* imageMemoryCache; // Default: [Nimbus imageMemoryCache]
@property (nonatomic, readwrite, NI_STRONG) NSOperationQueue* networkOperationQueue; // Default: [Nimbus networkOperationQueue]

@property (nonatomic, readwrite, assign) NSTimeInterval maxAge; // Default: 0

Expand All @@ -108,7 +108,7 @@ typedef enum {

#pragma mark Delegation

@property (nonatomic, readwrite, assign) id<NINetworkImageViewDelegate> delegate;
@property (nonatomic, readwrite, NI_WEAK) id<NINetworkImageViewDelegate> delegate;

#pragma mark Subclassing

Expand Down
2 changes: 1 addition & 1 deletion src/networkimage/src/NINetworkImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@interface NINetworkImageView()
@property (nonatomic, readwrite, retain) NSOperation* operation;
@property (nonatomic, readwrite, NI_STRONG) NSOperation* operation;
@end


Expand Down
4 changes: 3 additions & 1 deletion src/overview/src/NIOverviewGraphView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#import <UIKit/UIKit.h>

#import "NIPreprocessorMacros.h" /* for NI_WEAK */

@protocol NIOverviewGraphViewDataSource;

/**
Expand All @@ -31,7 +33,7 @@
/**
* The data source for this graph view.
*/
@property (nonatomic, readwrite, weak) id<NIOverviewGraphViewDataSource> dataSource;
@property (nonatomic, readwrite, NI_WEAK) id<NIOverviewGraphViewDataSource> dataSource;

@end

Expand Down
6 changes: 3 additions & 3 deletions src/overview/src/NIOverviewLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ extern NSString* const NIOverviewLoggerDidAddConsoleLog;
*
* Log entries are in increasing chronological order.
*/
@property (nonatomic, readonly, retain) NILinkedList* deviceLogs;
@property (nonatomic, readonly, NI_STRONG) NILinkedList* deviceLogs;

/**
* The linked list of console logs.
*
* Log entries are in increasing chronological order.
*/
@property (nonatomic, readonly, retain) NILinkedList* consoleLogs;
@property (nonatomic, readonly, NI_STRONG) NILinkedList* consoleLogs;

/**
* The linked list of events.
*
* Log entries are in increasing chronological order.
*/
@property (nonatomic, readonly, retain) NILinkedList* eventLogs;
@property (nonatomic, readonly, NI_STRONG) NILinkedList* eventLogs;

@end

Expand Down
6 changes: 3 additions & 3 deletions src/overview/src/NIOverviewMemoryCacheController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif

@interface NIMemoryCache(Private)
@property (nonatomic, readwrite, retain) NILinkedList* lruCacheObjects;
@property (nonatomic, readwrite, NI_STRONG) NILinkedList* lruCacheObjects;
@end

// Anonymous private category for LRU cache objects.
Expand All @@ -34,8 +34,8 @@ - (NSDate *)lastAccessTime;
@end

@interface NIOverviewMemoryCacheController()
@property (nonatomic, readonly, retain) NIMemoryCache* cache;
@property (nonatomic, readwrite, retain) NITableViewModel* model;
@property (nonatomic, readonly, NI_STRONG) NIMemoryCache* cache;
@property (nonatomic, readwrite, NI_STRONG) NITableViewModel* model;
@end

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 37e4acb

Please sign in to comment.