Author Topic: How to share custom iOS framework code with a tvOS app  (Read 6180 times)

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
How to share custom iOS framework code with a tvOS app
« on: November 07, 2015, 06:54:55 PM »
To share custom iOS framework code with a tvOS app, you need to create a tvOS version of the custom framework, by following these basic steps (assuming you already have a custom iOS framework project):

1. Open your custom iOS framework project in Xcode, and select File > New > Target from the Xcode menu.

2. In the panel on the left in the New Target dialog, select tvOS > Framework & Library

3. On the right side of the dialog, select TV Framework and click Next.

4. In the next step of the dialog, specify the options for your new target. NOTE: Set Embed in Application to your tvOS app, and your tvOS framework will automatically be linked to your tvOS project.

5. Click Finish

Now you're ready to add code files to your custom tvOS framework. Just remember you can add a reference to a source code file in your tvOS framework without duplicating the code file

Note that not all iOS frameworks are available to tvOS apps. Check out this link for a complete list:

https://developer.apple.com/library/prerelease/tvos/documentation/General/Conceptual/AppleTV_PG/index.html#//apple_ref/doc/uid/TP40015241-CH12-SW1

All the best!
Kevin McNeish
Author of Learn to Code in Swift: https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
Check out our Robot Tic-Tac-Toe app: https://itunes.apple.com/us/app/robot-tic-tac-toe/id990638517?mt=8