Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.58 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.58 KB

WidGame

WidGame is an easy way to use SpriteKit for devoloping your own iOS Widgets games.

Features

  • Easily use SpriteKit on your widget

  • Easily change your widget view expandability status("Show More" and "Show Less") and height

  • Easily detect widget events from your scene

Usage

Inherit your Scene from WGScene

public class YourScene: WGScene { }

Inherit your Widget View Controller to WGViewController

public class YourWidgetViewController: WGViewController { }

Presenting your initial scene

public func presentInitialScene() {
    //Override this method to show your first scene
}

Adapt your scene to expandability of your widget view

func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
    //Add code for when your view change it expandability status
    
    //Don't forget to call super.widgetActiveDisplayModeDidChange(activeDisplayMode, withMaximumSize: maxSize) on your code!
}
func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { 
     //Add code for when your view will change it expandability status
        
    //Don't forget to call super.viewWillTransition(to: size, with: coordinator) on your code!
}

Download this project to see an example of the framework working

See the Documentation for more info on how to use the classes and methods.