Posts

Post marked as solved
1 Replies
411 Views
On tvOS you can choose Settings > Accessibility > Display > Focus Style > High Contrast to have teasers highlighted by a white border when focused: However, I cannot find out how to use this feature on my own custom views. It seems that only TVPosterView makes use of this High Contrast accessibility setting. I'd like to be able to show such a frame on my custom views if this setting is enabled but I cannot find how to check if it's enabled. None of the bools listed on https://developer.apple.com/documentation/uikit/uiaccessibility under Capabilities (like isVoiceOverRunning, isGuidedAccessEnabled, isReduceTransparencyEnabled, etc.) seems to refer to this Focus Style setting. Can anybody point me in the right direction? How do I check in code whether Focus Style is set to High Contrast? How do I get the High Contrast frame on non-TVPosterView views?
Posted
by Eurydice.
Last updated
.
Post not yet marked as solved
1 Replies
274 Views
Total beginner here working on Assignment I of Stanford's Developing iOS 11 Apps with Swift course.I managed to do all the required tasks 1 - 6 but am struggling with:8. Tracking the flip count almost certainly does not belong in your Controller in a proper MVC architecture. Fix that.We have the controller ViewControl.swift and we have the model Concentration.swift files.In the lecture, flipCount was implemented inside ViewControl.swift as such:var flipCount = 0 { didSet { flipsLabel.text = "Flips: \(flipCount)" } }Now if I simply moved that over to the model file Concentration.swift, I get an error that flipsLabel is unresolved there - which makes sense, because as I understand it, the controller should be UI-independent, and flipsLabel is clearly a UI element.But does that mean that if I track flipCount in the model, I can't use didSet at all, and instead have to doflipsLabel.text = "Flips: \(game.flipCount)"where game is my Concentration class object in the controller ViewController.swift whenever I do something that changes flipsCount?I'm confused how to separate these things out in the correct and most elegant way.
Posted
by Eurydice.
Last updated
.