The second silver challenge in 6. Subclassing UIView states:
Make it so a user of HypnosisView can change the text it displays. (Hint: You’ll need to give HypnosisView a text property).
(note: it looks like only some versions of the bnr book have this challenge).
So I added a text property that someone with access to the code can easily use to alter the displayed text. However, I think the challenge intends for us to insert a UITextField on the view such that an app user can tap it, enter text, and see that text displayed in place of “You are getting sleepy”.
How can one add such a text field without a xib being present? I tried adding a UITextView as a subview to both the scrollView and the view in HypnosisAppDelegate.m, as demonstrated here stackoverflow.com/questions/2728 … mmatically . But this did not display any text field on the app.