Below you will find pages that utilize the taxonomy term “Tvos Development”
Posts
Dynamic Type in iOS using UIFontTextStyle
iOS 7 introduced Dynamic Type which allows the user to specify the font size in Settings. The easiest way to support dynamic type is to use one of Apple’s pre defined Font Text Style’s below.
Swift 3 and Swift 4
UIFontTextStyle.title1 UIFontTextStyle.title2 UIFontTextStyle.title3 UIFontTextStyle.headline UIFontTextStyle.subheadline UIFontTextStyle.body UIFontTextStyle.callout UIFontTextStyle.footnote UIFontTextStyle.caption1 UIFontTextStyle.caption2 Swift 2.2
UIFontTextStyleTitle1 UIFontTextStyleTitle2 UIFontTextStyleTitle3 UIFontTextStyleHeadline UIFontTextStyleSubheadline UIFontTextStyleBody UIFontTextStyleCallout UIFontTextStyleFootnote UIFontTextStyleCaption1 UIFontTextStyleCaption2
Here is a code example in Swift 3 or Swift 4 of using the Headline font style.
Posts
How to localize an app’s name with InfoPlist.strings
These instructions are for localizing the information contained in the Info.plist. This includes the app’s name which is displayed on the user’s home screen under your app icon.
In Xcode go to File, New, File.. Select iOS (or the platform you are working with), Resource, Strings File, Next. Name the file InfoPlist.strings (case sensitive). If you only plan on having one App name for your project then I recommend placing the file in the same directory as your Localizable.
Posts
How to Localize an iOS or tvOS app in Swift or Objective-C
Localization is the translation of the app’s user interface into locale specific languages. In order to support localization we will use a strings file.
Creating a Localizable.strings file I like to place the strings file in its own folder called “Resources”.
In Xcode, Select “File”, “New”, “File…”
In the template picker select the “Resource” for the appropriate OS. Select “Strings File”.
Name the file “Localizable.strings”. This is the iOS default naming convention, don’t name it something else unless you want to refer to it by name every time you need to reference it.
Posts
How to create promo codes for your iOS or tvOS paid app or in-app purchase
Promo codes allow you to give away your paid app for free. They are mainly used for sending your app to journalists or bloggers so that they can review your app at no cost to them. You can also send them to your friends or reward those who made some contribution to the apps development. Developers can generate up to 100 promo codes per version. Each code expires 28 days after generation or when you release a new version of the app, whichever comes first.
Posts
CLLocationManager and tvOS
How to access the user’s location with CLLocationManager on tvOS.
Add the key NSLocationWhenInUseUsageDescription to your Info.plist. Also add a default value that will be displayed in the prompt to the user. Add the key CFBundleDisplayName to your Info.plist. Also add a default value that will be displayed as the App name in the home screen and in the prompt. Localize your prompt and display name by adding a InfoPlist.
Posts
Remove storyboard from iOS or tvOS and design programmatically
If you prefer to work with code programmatically instead of via Storyboards then this tutorial will help you start a brand new iOS or tvOS project by removing the default main storyboard.
From Xcode, select File…New…Project. (iOS/tvOS)…Application…Single View Application…Next.
Give your project a title. Select the appropriate checkmarks for Core Data and testing. Press Next.
Delete Main.storyboard and select Move to Trash.
Select the project from the Project Navigator. Select the Target.
Posts
25 Useful Tools for iOS Software Developers
As a software developer or marketer of iOS apps we rely on our tools to help build our products and save us time. Below are 25 useful tools for building iOS apps.
Name Description ack A tool like grep, optimized for programmers Affinity Designer Professional Graphic Design Software for the Mac.
Affinity Designer is the fastest, smoothest, most precise vector graphic design software available.
Posts
Use plutil to find that missing double quote or semicolon in your Localizable.strings file
Is Xcode giving you the error in Localizable.strings “Read failed: The data couldn’t be read because it isn’t in the correct format.” but it isn’t telling you what line the error is on?
Use the command line tool plutil to find that missing semicolon or double quote.
cd to the directory of the offending Localizable.strings file and run
plutil -lint Localizable.strings It should respond with something like:
CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 86.
Posts
Useful tvOS developer links
Mastering the tvOS Focus Engine by airbnb
Detecting Gestures and Button Presses by Apple
iOS to tvOS Tips by 3 Sided Cube
Posts
How to specify tvOS target conditional in Swift and Objective-C
In Swift use:
#if os(tvOS) //tvOS code here #elseif os(iOS) //iOS code here #endif In Objective-C use:
#if TARGET_OS_TV //tvOS code here #else TARGET_OS_IOS //iOS code here #endif
Did you find this post helpful? Support independent development and improve your sleep by downloading White Noise and Deep Sleep Sounds free from the App Store.
Posts
How to use core data from existing iOS app with tvOS
In Apple’s new tvOS, data saved in core data is not persisted but is only cached. The tvOS may delete the data stored in core data when space is low.
From https://developer.apple.com/library/tvos/documentation/General/Conceptual/AppleTV_PG/
Local Storage for Your App Is Limited The maximum size of an Apple TV app is limited to 200 MB. Moreover, your app can only access 500 KB of persistent storage that is local to the device (using the NSUserDefaults class).