Setup Theos Environment For Custom HSWidgets

HSWidgets provides a Theos template that can be used for generating HSWidgets projects and a framework for compiling/linking. The files are available on GitHub repo:

Downloads

  HSWidgets.framework Description: Framework for headers and linking   iphone_hswidget.nic.tar Description: Theos NIC template

The framework (HSWidgets.framework) needs to be placed inside $THEOS/lib directory and Theos template (iphone_hswidget.nic.tar) needs to be placed in $THEOS/templates/ios/dgh0st directory. Note you will need to create the dgh0st directory, or you can place template file in one of the existing directory. The final file structure should look something like this:


<Theos Directory>
| lib
| | HSWidgets.framework
| | | Headers
| | | HSWidgets.tbd
| templates
| | ios
| | | dgh0st
| | | | iphone_hswidget.nic.tar
...

Once we have setup the Theos template, running $THEOS/bin/nic.pl should display iphone/hswidget as one of the options.


NIC 2.0 - New Instance Creator
------------------------------
  [1.] iphone/activator_event
  [2.] iphone/application_modern
  [3.] iphone/application_swift
  [4.] iphone/flipswitch_switch
  [5.] iphone/framework
  [6.] iphone/hswidget
  [7.] iphone/library
  [8.] iphone/preference_bundle_modern
  [9.] iphone/tool
  [10.] iphone/tool_swift
  [11.] iphone/tweak
  [12.] iphone/xpc_service
Choose a Template (required):

Make sure the HSWidgets class name prefix is unique when creating a new project, otherwise your widget class name will conflict with another widget leading to your widget not being loaded. If you do get a conflict, you can rename the custom widget view controller class and update the principal class in Resources/Info.plist.