Skip to content
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
3 changes: 3 additions & 0 deletions ORK1Kit/ORK1Kit/Onboarding/ORK1LoginStepViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ NS_ASSUME_NONNULL_BEGIN
ORK1_CLASS_AVAILABLE
@interface ORK1LoginStepViewController : ORK1FormStepViewController

/// The title for the login button. Default value is supplied by ResearchKit; update this value to customize the button.
@property (nonatomic, copy) NSString *loginButtonTitle;

/**
Action method for the forgot password button.

Expand Down
18 changes: 16 additions & 2 deletions ORK1Kit/ORK1Kit/Onboarding/ORK1LoginStepViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,25 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#import "ORK1Helpers_Internal.h"


@implementation ORK1LoginStepViewController
@implementation ORK1LoginStepViewController {
NSString *_loginButtonTitle;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to refamiliarize myself with the nuances of having an @Property declaration in the header, but doing the work manually in the .m file with a custom setter/getter :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same 😆. Luckily ResearchKit already has several instances of this pattern to confirm I was doing the right thing.

}

- (void)setContinueButtonItem:(UIBarButtonItem *)continueButtonItem {
[super setContinueButtonItem:continueButtonItem];
continueButtonItem.title = ORK1LocalizedString(@"LOGIN_CONTINUE_BUTTON_TITLE", nil);
continueButtonItem.title = self.loginButtonTitle;
}

- (NSString *)loginButtonTitle {
if (!_loginButtonTitle) {
_loginButtonTitle = ORK1LocalizedString(@"LOGIN_CONTINUE_BUTTON_TITLE", nil);
}
return _loginButtonTitle;
}

- (void)setLoginButtonTitle:(NSString *)loginButtonTitle {
_loginButtonTitle = loginButtonTitle;
self.continueButtonItem.title = loginButtonTitle;
}

- (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem {
Expand Down