Posts
How to Fix the Error Establishing a Database Connection in WordPress
If your WordPress server works normal for a few days and then shows the error message “Error Establishing a Database Connection” it is most likely due to heavy load to your website that your server could not handle. The extra load could be due to a lot of traffic from an incoming link or it could be a malicious actor attempting to brute force their way into your WordPress installation. If you have control of the server such as on AWS or Digital Ocean you can ssh into the server and restart the machine.
Posts
How to create custom keyboard shortcuts for any Mac Application
Have you ever wanted to create a custom keyboard shortcut for a Mac App but the app you’re using doesn’t let you modify their keymap or perhaps their interface is too cumbersome to use?
For example, if you are running the Google Chrome internet browser on your Mac and you want to refresh the page with the F5 key, there is no way to do that from within Google Chrome.
Posts
How to use stickers in iMessage for iOS 10
Apple released iOS 10 in September 2016, along with a new iMessage app store featuring stickers and mini apps. How do you get to this new store you ask?
First, open iMessage, then press the grey and white arrow to the left of your text input box.
Second, press the third icon from the left for the new iMessage App Store.
Lastly, press the icon on the bottom left of the screen represented by four gray ovals.
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
Deep Sleep Fan for iOS simulates a real fan to help you sleep
Many people sleep with a fan on to drown out other noises. However, this is inconvenient when one is traveling or the room is already cold.
Exit: fan, Enter: Deep Sleep Fan.
This new app simulates a fan with the option to play at two different speeds. It has a unique oscillation mode which pans the sounds between the left and right speakers. In addition, it introduces a fader which is adjustable for up to one hour.
Posts
How to open an iOS app with custom URL
This tutorial shows you how to open another iOS app from within your iOS app or from the safari browser using a custom URL scheme.
Beginning with iOS 9, you must whitelist the apps you want to open. If you do not, you will get the error -canOpenURL: failed for URL: “customURLScheme://” – error: “This app is not allowed to query for scheme”. If you get this error skip to the beginning of step 3.
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
Bedtime Reminder and Wake Alarm built into iOS 10 Clock App
Apple’s Clock application gets an update in iOS 10. It uses a new dark theme for the whole app and includes a new Bedtime tab. Starting the Bedtime section for the first time causes the app to ask you a few questions such as “What time would you like to wake up?”, “Which days of the week should the alarm go off?”, “How many hours of sleep do you need each night?
Posts
Turn an old iPhone, iPad or iPod into a Sound Machine for White Noise
Do you have an old iPhone, iPad or iPod you aren’t using lying around. You can turn it into a sound machine for a nursery and keep your newer device in your own room. Simply download a white noise app such as White Noise and Deep Sleep Sounds for free on the App Store.
Depending on the placement of the device and the distance to the bed or crib you might want to attach an external speaker.
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
White Noise and Deep Sleep Sounds, Now Available for iOS and Apple TV
Helps You and Your Baby Fall Asleep Faster and for a Longer Duration Kitefaster, an independent development studio, today released a free version of the “White Noise and Deep Sleep Sounds” app for Apple TV. The app was a finalist in the ports category of the Apple TV App Challenge presented by AppLovin. The developer originally wrote the App to help his newborn baby fall asleep. However, the sounds are useful for relaxing and studying as well.
Posts
How to enable Universal Links in iOS 9+
Apple’s documentation states that “Adding support for universal links is easy. There are three steps you need to take”. However, there is much more to it than that. Here is what you really need to do.
apple-app-site-association file Create the apple-app-site-association file and place it at the root of your webserver or the .well-known subdirectory.
{ "applinks": { "apps": [], "details": [ { "appID": "9JA89QQLNQ.com.apple.wwdc", "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"] }, { "appID": "ABCD1234.
Posts
Equipping your workbench for beginner electronics (Arduino)
Are you learning Arduino or how to solder electronics? I have compiled a list of items that I have personally found useful when I received an Arduino Uno kit for Christmas and started learning how to make things with it.
Lighting
You’ll want a couple of bright lights to help you see all the small components. If you don’t already have a desk light handy I found these two lights to be useful and inexpensive.
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.