Posts
Localize iOS project with Strings file
File..New File
From the appropriate platform, choose Resource, Strings File
Name it “Localizable.strings”.
Add your key value pairs as such:
"HELLO_WORLD" = "Hello World!"; In code add your localized string with:
Swift
NSLocalizedString("HELLO_WORLD", comment: "") Objective-C
NSLocalizedString(@"HELLO_WORLD", nil); To add additional languages go to your project..Info..Localizations.
Press the + button to add new languages.
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
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
iTunes Connect API (fastlane) and corresponding Xcode language codes
If you are using the iTunes Connect API via fastlane or spaceship and would like to access your app meta data by language, below is a chart of the language codes that spaceship converts the iTunes Connect languages into. In addition, if you are localizing your app in Xcode for multiple locales of the same language. You should probably use the base language and omit the locale for at least one locale so that any other locales you omit have a fall back language to use.
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
Control LED light color via an Arduino and an iPhone over BLE
This tutorial will show you how to control an RGB LED via an Arduino and an iOS device. It will utilize the LightShow app which lets you set a single color or create a light show with a sequence of colors.
If you want to control a Light Strip check out this tutorial instead.
Materials: Common Cathode RGB LED
3 x 220-ohm resistors
nRF8001 BLE board
Arduino Uno
Posts
How to make your kiteboard more visible in the water so you don’t lose it
Have you ever lost your kiteboard? Have you ever spent way too long body dragging around the water because your board flipped fins up and you couldn’t spot it?
Well, today I have a tip that will help make your board easier to find when bobbing in the water. Simply, spray paint your fins fluorescent orange for maximum visibility.
Tools and Materials
1 can of fluorescent orange spray paint
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).
Posts
Create your own LED light show with an Arduino and an iPhone
This tutorial will show you how to control an analog RGB LED light strip via an Arduino and an iOS device. It will use the LightShow app which lets you set a single color or create a light show with a sequence of colors.
Materials:
Analog SMD RGB LED Strip 3 x N-channel power MOSFET 12V power supply DC Barrel Jack Adapter nRF8001 BLE board Arduino Uno iOS device LightShow App Step 1: Attach the light strip Use a power transistor such as a N-Channel MOSFET between the Arduino and the light strip.
Posts
How to hack a Sony STRDN1060 receiver and remote to show custom input names
I have a Sony STRDN1060 Receiver and although I have a universal remote (Logitech Harmony 650) which I like very much, I find myself still using the Sony remote to switch inputs. However, the default inputs labels of SAT/CATV, GAME, SA-CD/CD didn’t really match up to the actual devices I had hooked up to those HDMI ports. I have a TiVo, chromecast, and an Apple TV.
In order to simplify my life so I don’t have to remember which input matched up to which device, I used a label maker (Brother Printer PTD600 PC) to change the labels on the remote.
Posts
How to specify DEBUG and RELEASE flags in Xcode with Swift or Objective-C
This tutorial shows you how to selectively run your debug or production code using flags. Sometimes you may find it necessary to only run some code in Debug mode and other code in Release mode.
Swift Open your Project Build Settings and search for “Swift Compiler – Custom Flags” … “Other Swift Flags”. Add -DDEBUG to the Debug section Add -DRELEASE to the Release section In Swift you can use the following code:
Posts
How to add CocoaPods acknowledgements plist to iOS settings
This tutorial will explain how to add the automatically generated CocoaPods acknowledgements plist file to your app’s iOS settings page.
CocoaPods automatically creates an acknowledgements markdown and plist file with the license information of all the pods in you project. You can use the plist file to create an acknowledgements section in the iOS settings for your app.
Note: There is a bug in Xcode 7.2 UI for creating a Child Pane.