Utility code from Madefire
contain one category method
+ (UIStoryboard *)mf_deviceStoryboardWithName:(NSString *)name bundle:(NSBundle *)storyboardBundleOrNil
that will take a base name and return one of three files based on device and file existence:
This is designed to mimic the functionality of
method that returns image files based on device and screen resolution that are named appropriately.
Showing a login panel on both iPad and iPhone requires one storyboard for each device.
Files created are
To load the login panel storyboard there is no need for if/else branching code, instead
just make a call with the basename of
UIStoryboard *storyboard = [UIStoryboard mf_deviceStoryboardWithName:@"LoginPanel" bundle:nil];
When running on an iPad you'll get the
LoginPanel~ipad.storyboard and on the iPhone you'll
LoginPanel~iphone.storyboard. If there is only one storyboard named without a device
specific suffix that will be returned instead. If there are no storyboards with that basename
nil is returned.
Hash (NSString & NSData)
There are two categories, one for NSString and one for NSData, that assist in providing both
MD5 and SHA1 hashes for text strings and data blobs respectively. For both categories there exist
mf_sha1 methods that return NSStrings of the NSString or NSData objects they're
Copyright (c) 2012 Madefire, Inc. (http://madefire.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.