InfoPlist.strings file and localize it.
After that remember you need to key value to translate a text in infoplist file. "NSLocationWhenInUseUsageDescription" = "BlahBlahBlah"
If you manually create a parent and child relationship between two view controllers, the child view controller might not have a navigation bar in this case. So you might be wondered why the navigation item of the child view controller doesn’t effect on the navigation bar. But you need to understand that the navigation bar on the child view controller is not the child view controller’s navigation bar. Because the child view controller is embedded into the parent view controller. So you need to create a LeftBarButtonItem on the parent’s navigation bar and customize the button with a target and an action pattern in the parent view controller.
2:27 PM
dispatch, dispatch_group, GCD, loop, Swift, thread
No comments
A completion Handler in iOS takes a thread to asynchronously get it done. So it means that we can’t know an exact point which the tasks finish. For example, if we use a for loop to execute several tasks in the background, how could we know all the task are done?
In this case you can use dispatch_group.
dispatch_group_create().dispatch_group_enter(groupname).dispatch_group_leave(groupname).dispatch_group_notify.If you want to see a concrete example for it, please refer this.
1:46 PM
CoreData, Migration, PersistentStoreCoordinator
No comments
If you change a scheme of your CoreData such as adding a new attribute, you can easily migrate it with options below.
do {
try persistentStoreCoordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: storeURL, options: [NSMigratePersistentStoresAutomaticallyOption: true , NSInferMappingModelAutomaticallyOption: true])
} catch {
fatalError("Error migrating store: \(error)")
}
4:58 PM
Apple Watch 2, AppleWatch, Fitbit charge 2, New Fitbit Flex 2
No comments
Fitbit launched Fitbit Flex 2 which put a new function to track a swimming activity. It is similar to Misfit Shine.
It tracks…
If it is compared to Misfit Shine’s Swimmer’s edition, Misfit Shine tracks everything which Fitbit Flex2 supports.
I think that Misfit Shine is more customized to track a swimming activity. Misfit Shine supports a unique feature calling ‘Swim Time Countdown’.
Both of them support 50 meters water resistance.
Several features which you should notice.
Now I wonder that the upcoming Apple Watch 2 supports more tracking features which Fitbit leads with their new products.
Apple released a new coding font which calls San Francisco mono. I have used Source Code Pro which Adobe created. But I would like to test and use Apple’s one in Xcode7.
Basically San Francisco mono font is pre-installed in Xcode8 beta. So here is the way to use it in Xcode7.
Install Xcode8 and find the location of the font.
Copy them into your font directory in macOS. I used ~/Library/Fonts
Launch Xcode7 and configure it as a coding font. (Xcode7 has a bug that you can’t select font collections in your macOS system. If you meet the problem, run the command below in Terminal and try it again.)
defaults write -app Xcode NSFontPanelAttributes -string "1, 0"