Here is my project using an ESRI basemap and the trail feature layer.
It is very basic, the legend button only displays the legend. Touch the map to release it.
The segue is created by right-clicking-and-dragging from the Legend button to the TOC view.
When the button is touched, it fires the segue (after calling prepareForSegue).
The legend uses an array for the layers, and another array for visible index of layers (from collapsing breakdown lines).
Each layer has a pointer to it's view, for setting the alpha on or off.
The legend array is only loaded when the TOC screen is displayed because OnlineOfflineFeatureLayers were not triggering LayerLoaded in offline mode.
Reusable tableview cells were causing problems redrawing with other cells' switches, so I use unique cell names.
**Only the iPad storyboard has been setup**