Skip to content

Trap or emit warning on unreasonably small ActivityRingScene sizes? #6

@calda

Description

@calda

When I was experimenting this morning, I typed up this sample class:

class InterfaceController: WKInterfaceController {

    @IBOutlet weak var activityRingInterfaceScene: WKInterfaceSKScene!
    
    var activityRingScene = ActivityRingScene()
    
    override func willActivate() {
        activityRingScene.ringWidth = 15
        activityRingInterfaceScene.presentScene(activityRingScene)
    }
    
    override func didAppear() {
        activityRingScene.progress = 0.75
    }

}

Which looks like this:

screen shot 2018-10-17 at 2 26 17 pm

Took me a while to figure out what the issue was, but it turns out the ActivityRingScene was defaulting to CGSize(width: 1, height: 1). The key to fixing that issue is something like ActivityRingScene(size: contentFrame.size).

I'm wondering if it would be worth trapping or emitting some warning when the ActivityRingScene size is unreasonably small (like 1x1 in that example).

I can't think of a good way to make it automatically have the correct behavior, since we don't have an opportunity to subclass WKInterfaceSKScene.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions