diff --git a/Pods/Onboard/Source/OnboardingContentViewController.h b/Pods/Onboard/Source/OnboardingContentViewController.h index f0d7aeb65bbeb36fccb4cb6ef62ea1f8d3beedee..a44855f3696fa6afa34878a783fd9ccd11b199d8 100644 --- a/Pods/Onboard/Source/OnboardingContentViewController.h +++ b/Pods/Onboard/Source/OnboardingContentViewController.h @@ -173,6 +173,8 @@ NS_ASSUME_NONNULL_END */ + (nonnull instancetype)contentWithTitle:(nullable NSString *)title body:(nullable NSString *)body videoURL:(nullable NSURL *)videoURL inputView:(UIView *)inputView buttonText:(nullable NSString *)buttonText actionBlock:(nullable dispatch_block_t)actionBlock; ++ (nonnull instancetype)contentWithTitle:(nullable NSString *)title body:(nullable NSString *)body videoURL:(nullable NSURL *)videoURL inputView:(UIView *)inputView buttonText:(nullable NSString *)buttonText actionBlock:(nullable dispatch_block_t)actionBlock withPadding:(nonnull BOOL*)withPadding; + /** * @brief Initializer for creating an onboarding content view controller with a video. @@ -203,6 +205,9 @@ NS_ASSUME_NONNULL_END - (nonnull instancetype)initWithTitle:(nullable NSString *)title body:(nullable NSString *)body image:(nullable UIImage *)image videoURL:(nullable NSURL *)videoURL inputView:(nullable UIView *)inputView buttonText:(nullable NSString *)buttonText actionBlock:(nullable dispatch_block_t)actionBlock; + +- (nonnull instancetype)initWithTitle:(nullable NSString *)title body:(nullable NSString *)body image:(nullable UIImage *)image videoURL:(nullable NSURL *)videoURL inputView:(nullable UIView *)inputView buttonText:(nullable NSString *)buttonText actionBlock:(nullable dispatch_block_t)actionBlock withPadding:(BOOL*)withPadding; + /** * @brief Method used to update the alpha value for all floating subviews (image, title, body, etc.) */ diff --git a/Pods/Onboard/Source/OnboardingContentViewController.m b/Pods/Onboard/Source/OnboardingContentViewController.m index 5dbda44c21caf9e931e5dbbb2f09ae861c7d9e50..5e44123fb114769cc2b5df3807dbade9f2fc8ca0 100644 --- a/Pods/Onboard/Source/OnboardingContentViewController.m +++ b/Pods/Onboard/Source/OnboardingContentViewController.m @@ -40,6 +40,8 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc @property (nonatomic) BOOL wasPreviouslyVisible; +@property (nonatomic, nullable) BOOL* withPadding; + @end @implementation OnboardingContentViewController @@ -73,7 +75,10 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc + (instancetype)contentWithTitle:(NSString *)title body:(NSString *)body videoURL:(NSURL *)videoURL inputView:(UIView *)inputView buttonText:(NSString *)buttonText actionBlock:(action_callback)actionBlock { return [[self alloc] initWithTitle:title body:body image:nil videoURL:videoURL inputView:inputView buttonText:buttonText actionBlock:actionBlock]; +} ++ (instancetype)contentWithTitle:(NSString *)title body:(NSString *)body videoURL:(NSURL *)videoURL inputView:(UIView *)inputView buttonText:(NSString *)buttonText actionBlock:(action_callback)actionBlock withPadding:(BOOL*)withPadding { + return [[self alloc] initWithTitle:title body:body image:nil videoURL:videoURL inputView:inputView buttonText:buttonText actionBlock:actionBlock withPadding:withPadding]; } - (instancetype)initWithTitle:(NSString *)title body:(NSString *)body videoURL:(NSURL *)videoURL buttonText:(NSString *)buttonText action:(dispatch_block_t)action { @@ -154,6 +159,75 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc return self; } +- (instancetype)initWithTitle:(NSString *)title body:(NSString *)body image:(UIImage *)image videoURL:(NSURL *)videoURL inputView:(UIView *)inputView buttonText:(NSString *)buttonText actionBlock:(action_callback)actionBlock withPadding:(BOOL*)withPadding{ + self = [super init]; + + self.withPadding = withPadding; + + if (self == nil) { + return nil; + } + + // Icon image view + self.iconImageView = [[UIImageView alloc] initWithImage:image]; + self.iconWidth = image ? image.size.width : kDefaultImageViewSize; + self.iconHeight = image ? image.size.height : kDefaultImageViewSize; + + // Title label + self.titleLabel = [UILabel new]; + self.titleLabel.accessibilityIdentifier = kOnboardMainTextAccessibilityIdentifier; + self.titleLabel.text = title; + self.titleLabel.textColor = DEFAULT_TEXT_COLOR; + self.titleLabel.font = [UIFont fontWithName:kDefaultOnboardingFont size:kDefaultTitleFontSize]; + self.titleLabel.numberOfLines = 0; + self.titleLabel.textAlignment = NSTextAlignmentCenter; + + // Body label + self.bodyLabel = [UILabel new]; + self.bodyLabel.accessibilityIdentifier = kOnboardSubTextAccessibilityIdentifier; + self.bodyLabel.text = body; + self.bodyLabel.textColor = DEFAULT_TEXT_COLOR; + self.bodyLabel.font = [UIFont fontWithName:kDefaultOnboardingFont size:kDefaultBodyFontSize]; + self.bodyLabel.numberOfLines = 0; + self.bodyLabel.textAlignment = NSTextAlignmentCenter; + + // Input view + self.inputView = inputView; + if (self.inputView) { + self.inputView.accessibilityIdentifier = kOnboardInputViewAccessibilityIdentifier; + } + + // Action button + self.actionButton = [UIButton new]; + self.actionButton.accessibilityIdentifier = kOnboardActionButtonAccessibilityIdentifier; + self.actionButton.titleLabel.font = [UIFont fontWithName:kDefaultOnboardingFont size:kDefaultButtonFontSize]; + [self.actionButton setTitle:buttonText forState:UIControlStateNormal]; + [self.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [self.actionButton addTarget:self action:@selector(handleButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + + self.buttonActionHandler = actionBlock ?: ^(OnboardingViewController *controller){}; + + // Movie player + self.videoURL = videoURL; + + // Auto-navigation + self.movesToNextViewController = NO; + + // Default padding values + self.topPadding = kDefaultTopPadding; + self.underIconPadding = kDefaultUnderIconPadding; + self.underTitlePadding = kDefaultUnderTitlePadding; + self.bottomPadding = kDefaultBottomPadding; + self.underPageControlPadding = kDefaultUnderPageControlPadding; + + // Default blocks + self.viewWillAppearBlock = ^{}; + self.viewDidAppearBlock = ^{}; + self.viewWillDisappearBlock = ^{}; + self.viewDidDisappearBlock = ^{}; + + return self; +} - (instancetype)initWithTitle:(NSString *)title body:(NSString *)body image:(UIImage *)image videoURL:(NSURL *)videoURL inputView:(UIView *)inputView buttonText:(NSString *)buttonText actionBlock:(action_callback)actionBlock { self = [super init]; @@ -364,8 +438,12 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc self.actionButton.frame = CGRectMake((CGRectGetMaxX(self.view.frame) / 2) - (contentWidth / 2), CGRectGetMaxY(self.view.frame) - self.underPageControlPadding - kMainPageControlHeight - kActionButtonHeight - self.bottomPadding, contentWidth, kActionButtonHeight); - CGFloat inputYOrigin = CGRectGetMaxY(self.bodyLabel.frame) + self.underTitlePadding; + if (self.withPadding != NULL) { + if (*self.withPadding == NO) { + inputYOrigin = CGRectGetMaxY(self.bodyLabel.frame); + } + } if (self.inputView) { self.inputView.frame = CGRectMake(xPadding, inputYOrigin, contentWidth, CGRectGetHeight(self.inputView.frame)); for (UIView *view in self.inputView.subviews){ diff --git a/enzevalos_iphone.xcworkspace/xcuserdata/jakobsbode.xcuserdatad/UserInterfaceState.xcuserstate b/enzevalos_iphone.xcworkspace/xcuserdata/jakobsbode.xcuserdatad/UserInterfaceState.xcuserstate index 16533a411c4f70185b958d303911e7cd363e5735..099646c81671afbfce1e42714ad83550fd9e1721 100644 Binary files a/enzevalos_iphone.xcworkspace/xcuserdata/jakobsbode.xcuserdatad/UserInterfaceState.xcuserstate and b/enzevalos_iphone.xcworkspace/xcuserdata/jakobsbode.xcuserdatad/UserInterfaceState.xcuserstate differ