Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullability #1091

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Examples/Objective-C/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PODS:
- XLData/RemoteDataStore (2.0.0):
- XLData/CoreRemote
- XLData/DataStore
- XLForm (4.2.0)
- XLForm (4.3.0)

DEPENDENCIES:
- AFNetworking (~> 2.0)
Expand Down Expand Up @@ -78,8 +78,8 @@ SPEC CHECKSUMS:
JVFloatLabeledTextField: 58a3a32cfb800e5b224f676987e7c13abf50a14d
SHSPhoneComponent: 4cec0653a150ad63cbc52b0c8b29ce2d3c9c26f0
XLData: df725c6179e2e0c80bf56a1ecad9afd169707a6d
XLForm: eb04ea4104f26250b70a72a7fa2eed3748dca5cd
XLForm: a439f9512078ed538e8335c8b06d3f3286bbfd37

PODFILE CHECKSUM: 64fbcd03a2c13762b2c18e3938cc8008807937c9

COCOAPODS: 1.9.3
COCOAPODS: 1.11.3
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class InlineSegmentedControl : XLFormBaseCell, XLFormInlineRowDescriptorCell {

var inlineRowDescriptor : XLFormRowDescriptor?
lazy var segmentedControl : UISegmentedControl = {
return UISegmentedControl.autolayout()!
return UISegmentedControl.autolayout()
}()

override func configure() {
Expand Down
2 changes: 1 addition & 1 deletion XLForm/XL/NSArray+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@

@interface NSArray (XLFormAdditions)

-(NSInteger)formIndexForItem:(id)item;
-(NSInteger)formIndexForItem:(nonnull id)item;

@end
2 changes: 1 addition & 1 deletion XLForm/XL/NSArray+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@implementation NSArray (XLFormAdditions)

-(NSInteger)formIndexForItem:(id)item
-(NSInteger)formIndexForItem:(nonnull id)item
{
for (id selectedValueItem in self) {
if ([[selectedValueItem valueData] isEqual:[item valueData]]){
Expand Down
2 changes: 1 addition & 1 deletion XLForm/XL/NSExpression+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@

@interface NSExpression (XLFormAdditions)

-(NSMutableArray*) getExpressionVars;
-(nullable NSMutableArray*) getExpressionVars;

@end
4 changes: 1 addition & 3 deletions XLForm/XL/NSExpression+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@implementation NSExpression (XLFormAdditions)


-(NSMutableArray*) getExpressionVars{
-(nullable NSMutableArray*) getExpressionVars{
switch (self.expressionType) {
case NSFunctionExpressionType:{
NSString* str = [NSString stringWithFormat:@"%@", self];
Expand All @@ -38,11 +38,9 @@ -(NSMutableArray*) getExpressionVars{
else
str = [str substringFromIndex:1];
return [[NSMutableArray alloc] initWithObjects: str, nil];
break;
}
default:
return nil;
break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions XLForm/XL/NSObject+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@interface NSObject (XLFormAdditions)

-(NSString *)displayText;
-(id)valueData;
-(nullable NSString *)displayText;
-(nullable id)valueData;

@end
4 changes: 2 additions & 2 deletions XLForm/XL/NSObject+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

@implementation NSObject (XLFormAdditions)

-(NSString *)displayText
-(nullable NSString *)displayText
{
if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){
return [(id<XLFormOptionObject>)self formDisplayText];
Expand All @@ -40,7 +40,7 @@ -(NSString *)displayText
return nil;
}

-(id)valueData
-(nullable id)valueData
{
if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]] || [self isKindOfClass:[NSDate class]]){
return self;
Expand Down
2 changes: 1 addition & 1 deletion XLForm/XL/NSPredicate+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@

@interface NSPredicate (XLFormAdditions)

-(NSMutableArray*) getPredicateVars;
-(nonnull NSMutableArray*) getPredicateVars;
@end
2 changes: 1 addition & 1 deletion XLForm/XL/NSPredicate+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@implementation NSPredicate (XLFormAdditions)


-(NSMutableArray*) getPredicateVars{
-(nonnull NSMutableArray*) getPredicateVars{
NSMutableArray* ret = [[NSMutableArray alloc] init];
if ([self isKindOfClass:([NSCompoundPredicate class])]) {
for (id object in ((NSCompoundPredicate*) self).subpredicates ) {
Expand Down
4 changes: 2 additions & 2 deletions XLForm/XL/NSString+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

@interface NSString (XLFormAdditions)

-(NSPredicate *)formPredicate;
-(nonnull NSPredicate *)formPredicate;

-(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType;
-(nonnull NSString *)formKeyForPredicateType:(XLPredicateType)predicateType;

@end
4 changes: 2 additions & 2 deletions XLForm/XL/NSString+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@implementation NSString (XLFormAdditions)

-(NSPredicate *)formPredicate
-(nonnull NSPredicate *)formPredicate
{
// returns an array of strings where the first one is the new string with the correct replacements
// and the rest are all the tags that appear in the string
Expand Down Expand Up @@ -57,7 +57,7 @@ -(NSPredicate *)formPredicate
}


-(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType
-(nonnull NSString *)formKeyForPredicateType:(XLPredicateType)predicateType
{
return [NSString stringWithFormat:@"%@-%@", self, (predicateType == XLPredicateTypeHidden ? @"hidden" : @"disabled") ];
}
Expand Down
8 changes: 4 additions & 4 deletions XLForm/XL/UIView+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

@interface UIView (XLFormAdditions)

+(instancetype)autolayoutView;
-(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view;
-(UIView *)findFirstResponder;
-(UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;
+(nonnull instancetype)autolayoutView;
-(nonnull NSLayoutConstraint *)layoutConstraintSameHeightOf:(nonnull UIView *)view;
-(nullable UIView *)findFirstResponder;
-(nullable UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;

@end
8 changes: 4 additions & 4 deletions XLForm/XL/UIView+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

@implementation UIView (XLFormAdditions)

+ (instancetype)autolayoutView
+ (nonnull instancetype)autolayoutView
{
__kindof UIView *view = [self new];
view.translatesAutoresizingMaskIntoConstraints = NO;

return view;
}

- (NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view
- (nonnull NSLayoutConstraint *)layoutConstraintSameHeightOf:(nonnull UIView *)view
{
return [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeHeight
Expand All @@ -46,7 +46,7 @@ - (NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view
constant:0.0];
}

- (UIView *)findFirstResponder
- (nullable UIView *)findFirstResponder
{
UIView *firstResponder = nil;
if (self.isFirstResponder) {
Expand All @@ -66,7 +66,7 @@ - (UIView *)findFirstResponder
return firstResponder;
}

- (UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell
- (nullable UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell
{
UITableViewCell<XLFormDescriptorCell> * tableViewCell = nil;

Expand Down