3

I am very new to ResearchKit and I have just created my own custom active step along with a view controller and I need the next button to be disabled for a short period of time. I am not sure how to accomplish this at the moment. I discovered I could change the title, but I cannot disable the button as I could with the cancelButtonItem in the navigation bar. For example, to disable the cancel button like this

cancelButtonItem.enabled = false

Is there something like that for the next button in a active step? If so can someone give me an example of such?

Jonas
  • 121,568
  • 97
  • 310
  • 388
fr0z3n2
  • 31
  • 3
  • If you can take a look one of the example: https://github.com/ResearchKit/ResearchKit/blob/master/ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.m I think continue button is not showing up by default. I suggest you posting a issue on the Github site. – Yuan Aug 01 '16 at 17:28
  • Well if it helps get the point across I want to have the continue button to appear or to be accessible after a certain amount of time has passed. I want it to not be accessible before that duration has been reached. Sorry I am a little new to iOS development and I don't know Objective-C as well as I do Swift. – fr0z3n2 Aug 04 '16 at 14:29

1 Answers1

1

I found only hack way how to hide it:

for subview in self.view.subviews {
    for subview1 in subview.subviews {
        for subview2 in subview1.subviews {
            for subview3 in subview2.subviews {

                if let button = subview3 as? UIButton {
                    button.hidden = true
                }
            }
        }
    }
}
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86