Skip to content

Commit

Permalink
Merge branch 'feature/swift-integration' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
davbeck committed Nov 17, 2016
2 parents bd616e5 + 6c62d04 commit 58d70d7
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 64 deletions.
27 changes: 24 additions & 3 deletions TURecipientBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = TU;
LastUpgradeCheck = 0460;
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = ThinkUltimate;
};
buildConfigurationList = 110611C01742E2D400730F01 /* Build configuration list for PBXProject "TURecipientBar" */;
Expand Down Expand Up @@ -281,25 +281,35 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
Expand All @@ -312,18 +322,27 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -338,6 +357,7 @@
GCC_PREFIX_HEADER = "TURecipientBarExample/TURecipientBar-Prefix.pch";
INFOPLIST_FILE = "TURecipientBarExample/TURecipientBar-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.ThinkUltimate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -351,6 +371,7 @@
GCC_PREFIX_HEADER = "TURecipientBarExample/TURecipientBar-Prefix.pch";
INFOPLIST_FILE = "TURecipientBarExample/TURecipientBar-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.ThinkUltimate.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
8 changes: 4 additions & 4 deletions TURecipientBar/TURecipient.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
You can create a category that returns a different property for this value.
For instance, an `NSManagedObject` could return it's name property
*/
@property (nonatomic, readonly, copy) NSString *recipientTitle;
@property (nonatomic, readonly, copy, nonnull) NSString *recipientTitle;

@end

Expand All @@ -49,20 +49,20 @@
This is for backwards compatability. Use `recipientTitle` instead.
*/
@property (nonatomic, readonly, copy) NSString *title __attribute__((deprecated));
@property (nonatomic, readonly, copy, nonnull) NSString *title __attribute__((deprecated));

/** A generic reference to a model.
You can use this to keep track of what a recipient points to.
*/
@property (nonatomic, readonly, strong) id address;
@property (nonatomic, readonly, strong, nullable) id address;


/** Create a new recipient.
Because this class is immutable, this is the only way to set the title and address properties.
If you need to make a change, you should create a new one. This is because the recipients bar will not track changes.
*/
+ (id)recipientWithTitle:(NSString *)title address:(id)address;
+ (nonnull id)recipientWithTitle:(nonnull NSString *)title address:(nullable id)address;

@end
66 changes: 33 additions & 33 deletions TURecipientBar/TURecipientsBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
The default value is nil.
*/
@property (nonatomic, copy) NSString *text;
@property (nonatomic, copy, nullable) NSString *text;

/** The text for the label in front of both the search field and tokens.
Expand All @@ -40,13 +40,13 @@
Use `toLabel` instead.
*/
@property (nonatomic, copy) NSString *label __attribute__((deprecated));
@property (nonatomic, copy, nullable) NSString *label __attribute__((deprecated));

/** The string that is displayed when there is no other text in the search field.
The default value is nil.
*/
@property (nonatomic, copy) NSString *placeholder;
@property (nonatomic, copy, nullable) NSString *placeholder;

/** Whether the bar is searching or not.
Expand Down Expand Up @@ -80,19 +80,19 @@
You can use this to customize the text input attributes for searching.
*/
@property (nonatomic, readonly) UITextField *textField;
@property (nonatomic, readonly, nonnull) UITextField *textField;

@property (nonatomic, readonly) UIView *lineView;
@property (nonatomic, readonly, nonnull) UIView *lineView;

@property (nonatomic, readonly) UIButton *addButton;
@property (nonatomic, readonly, nonnull) UIButton *addButton;

@property (nonatomic, readonly) UILabel *summaryLabel;
@property (nonatomic, readonly, nonnull) UILabel *summaryLabel;

/** The label in front of both the search field and tokens.
The default text is "To: ". You can set the text to nil to disable the label entirely.
*/
@property (nonatomic, readonly) UILabel *toLabel;
@property (nonatomic, readonly, nonnull) UILabel *toLabel;

/** Whether the add button should appear.
Expand Down Expand Up @@ -126,7 +126,7 @@
You can also change the priority. It must be lower than whatever constraint you are using to limit the bars height. The default priority is `UILayoutPriorityDefaultHigh` (`750`).
*/
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *heightConstraint;
@property (nonatomic, weak, nullable) IBOutlet NSLayoutConstraint *heightConstraint;


/**---------------------------------------------------------------------------------------
Expand All @@ -138,7 +138,7 @@
The delegate should conform to the TURecipientsBarDelegate protocol. Set this property to further modify the behavior. The default value is nil.
*/
@property (nonatomic, weak) id<TURecipientsBarDelegate> recipientsBarDelegate;
@property (nonatomic, weak, nullable) id<TURecipientsBarDelegate> recipientsBarDelegate;


/**---------------------------------------------------------------------------------------
Expand All @@ -152,29 +152,29 @@
Items are of type TURecipient.
*/
@property (nonatomic, readonly) NSArray *recipients;
@property (nonatomic, readonly, nonnull) NSArray<id<TURecipient>> *recipients;

/** Add a recipient.
This will both add the recipient to the array of recipients and will also update the view, whether it is in searching mode or not.
@param recipient A recipient to add.
*/
- (void)addRecipient:(id<TURecipient>)recipient;
- (void)addRecipient:(nonnull id<TURecipient>)recipient;

/** Remove a recipient.
This will both remove the recipient from the array of recipients and will also update the view, whether it is in searching mode or not.
@param recipient A recipient to remove.
*/
- (void)removeRecipient:(id<TURecipient>)recipient;
- (void)removeRecipient:(nonnull id<TURecipient>)recipient;

/** The currently selected recipient.
If the bar is in search mode, you can use this to select the token that represents it. If the bar is not searching, this has no effect.
*/
@property (nonatomic, strong) id<TURecipient> selectedRecipient;
@property (nonatomic, strong, nullable) id<TURecipient> selectedRecipient;

/** Select a recipient.
Expand All @@ -184,7 +184,7 @@
@param recipient A recipient to select.
*/
- (void)selectRecipient:(id<TURecipient>)recipient __attribute__((deprecated));
- (void)selectRecipient:(nullable id<TURecipient>)recipient __attribute__((deprecated));


/**---------------------------------------------------------------------------------------
Expand All @@ -199,7 +199,7 @@
@param backgroundImage The background image to use. This should be a resizable image.
@param state The state to use this background in.
*/
- (void)setRecipientBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setRecipientBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state UI_APPEARANCE_SELECTOR;

/** The background image for the token that represents a recipient.
Expand All @@ -208,7 +208,7 @@
@param state The state to use this background in.
@return The background image for the given state.
*/
- (UIImage *)recipientBackgroundImageForState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (nullable UIImage *)recipientBackgroundImageForState:(UIControlState)state UI_APPEARANCE_SELECTOR;

/** The edge insets for the token that represents a recipient.
Expand All @@ -224,7 +224,7 @@
@param state The state to use the attributes in.
*/
- (void)setRecipientTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setRecipientTitleTextAttributes:(nullable NSDictionary<NSString *,id> *)attributes forState:(UIControlState)state UI_APPEARANCE_SELECTOR;

/** The text attributes for the token that represents a recipient.
Expand All @@ -235,27 +235,27 @@
@param state The state to use this background in.
@return The text attributes override for the given state.
*/
- (NSDictionary *)recipientTitleTextAttributesForState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (nullable NSDictionary<NSString *,id> *)recipientTitleTextAttributesForState:(UIControlState)state UI_APPEARANCE_SELECTOR;

/** The text attributes applied to the label.
*/
@property (nonatomic, copy) NSDictionary *labelTextAttributes UI_APPEARANCE_SELECTOR __attribute__((deprecated));
@property (nonatomic, copy, nullable) NSDictionary<NSString *,id> *labelTextAttributes UI_APPEARANCE_SELECTOR __attribute__((deprecated));

/** The text attributes applied to the summary.
*/
@property (nonatomic, copy) NSDictionary *summaryTextAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, copy, nullable) NSDictionary<NSString *,id> *summaryTextAttributes UI_APPEARANCE_SELECTOR;

/** The text attributes applied to the search text field.
Only the font and foreground color are used.
*/
@property (nonatomic, copy) NSDictionary *searchFieldTextAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, copy, nullable) NSDictionary<NSString *,id> *searchFieldTextAttributes UI_APPEARANCE_SELECTOR;

/** The text attributes applied to the placeholder.
Note that at this time, changing summaryTextAttributes or recipientTitleTextAttributesForState: will not change the placeholder attributes.
*/
@property (nonatomic, copy) NSDictionary *placeholderTextAttributes UI_APPEARANCE_SELECTOR;
@property (nonatomic, copy, nullable) NSDictionary<NSString *,id> *placeholderTextAttributes UI_APPEARANCE_SELECTOR;

/** Whether the recipient bar should use a visual effect for it's background.
Expand All @@ -282,15 +282,15 @@
@param recipientsBar The recipient bar that is being edited.
@return `YES` if an editing session should be initiated, otherwise, `NO`.
*/
- (BOOL)recipientsBarShouldBeginEditing:(TURecipientsBar *)recipientsBar;
- (BOOL)recipientsBarShouldBeginEditing:(nonnull TURecipientsBar *)recipientsBar;

/** Tells the delegate when the user begins editing the search text.
Called when text starts editing.
@param recipientsBar The recipient bar that is being edited.
*/
- (void)recipientsBarTextDidBeginEditing:(TURecipientsBar *)recipientsBar;
- (void)recipientsBarTextDidBeginEditing:(nonnull TURecipientsBar *)recipientsBar;

/** Asks the delegate if editing should stop in the specified search bar.
Expand All @@ -299,15 +299,15 @@
@param recipientsBar The recipient bar that is being edited.
@return `YES` if editing should stop, otherwise, `NO`.
*/
- (BOOL)recipientsBarShouldEndEditing:(TURecipientsBar *)recipientsBar;
- (BOOL)recipientsBarShouldEndEditing:(nonnull TURecipientsBar *)recipientsBar;

/** Tells the delegate that the user finished editing the search text.
Called when text ends editing.
@param recipientsBar The recipient bar that is being edited.
*/
- (void)recipientsBarTextDidEndEditing:(TURecipientsBar *)recipientsBar;
- (void)recipientsBarTextDidEndEditing:(nonnull TURecipientsBar *)recipientsBar;

/** Tells the delegate that the user changed the search text.
Expand All @@ -316,7 +316,7 @@
@param recipientsBar The recipient bar that is being edited.
@param searchText The current text in the search text field.
*/
- (void)recipientsBar:(TURecipientsBar *)recipientsBar textDidChange:(NSString *)searchText;
- (void)recipientsBar:(nonnull TURecipientsBar *)recipientsBar textDidChange:(nullable NSString *)searchText;

/** Asks the delegate if editing should stop in the specified recipient bar.
Expand All @@ -327,7 +327,7 @@
@param text The text to replace existing text in range.
@return `YES` if text in range should be replaced by text, otherwise, `NO`.
*/
- (BOOL)recipientsBar:(TURecipientsBar *)recipientsBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
- (BOOL)recipientsBar:(nonnull TURecipientsBar *)recipientsBar shouldChangeTextInRange:(NSRange)range replacementText:(nullable NSString *)text;

/**---------------------------------------------------------------------------------------
* @name Selection
Expand All @@ -342,7 +342,7 @@
@param recipient The recipient being selected.
@return `YES` if the recipient should be selected, otherwise, `NO`.
*/
- (BOOL)recipientsBar:(TURecipientsBar *)recipientsBar shouldSelectRecipient:(id<TURecipient>)recipient;
- (BOOL)recipientsBar:(nonnull TURecipientsBar *)recipientsBar shouldSelectRecipient:(nonnull id<TURecipient>)recipient;

/** Tells the delegate that recipient selection has changed.
Expand All @@ -351,7 +351,7 @@
@param recipientsBar The recipient bar that is being edited.
@param recipient The recipient that was selected.
*/
- (void)recipientsBar:(TURecipientsBar *)recipientsBar didSelectRecipient:(id<TURecipient>)recipient;
- (void)recipientsBar:(nonnull TURecipientsBar *)recipientsBar didSelectRecipient:(nonnull id<TURecipient>)recipient;

/**---------------------------------------------------------------------------------------
* @name Clicking Buttons
Expand All @@ -364,14 +364,14 @@
@param recipientsBar The recipient bar that is being edited.
*/
- (void)recipientsBarReturnButtonClicked:(TURecipientsBar *)recipientsBar;
- (void)recipientsBarReturnButtonClicked:(nonnull TURecipientsBar *)recipientsBar;

/** Tells the delegate when the add button is pressed.
Called when the add button is pressed. Use this to show recipient selection UI.
@param recipientsBar The recipient bar that is being edited.
*/
- (void)recipientsBarAddButtonClicked:(TURecipientsBar *)recipientsBar;
- (void)recipientsBarAddButtonClicked:(nonnull TURecipientsBar *)recipientsBar;

@end
Loading

0 comments on commit 58d70d7

Please sign in to comment.