Source type 1 not available

This is because you are opening a camera on the simulator(or on a device not having camera)… since the code is something like [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] and obviously, the simulator doesn’t have a camera… Proceed giving an alert like this, if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@”Error” message:@”Device has no camera.” delegate:nil cancelButtonTitle:@”OK” … Read more

Detect if app is running in Slide Over or Split View mode in iOS 9

Just check if your window occupies the whole screen: BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds); If this is false, then you’re running in a split view or a slide over. Here is the code snipped which will automatically maintain this flag irrespective of rotation -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { // simply create a property of ‘BOOL’ … Read more

react native doesn’t fill up window on ipad

Solution: In the xcode project, go to the general tab and then to the Deployment Info. There you can change to the device type you want (universal works for both). If you are using Expo (create-react-native-app), modify to your app.json to set ios.supportsTablet to true: “ios”: { “bundleIdentifier”: “your bundle identifier”, “supportsTablet”: true },

How do you determine spacing between cells in UICollectionView flowLayout

Update: Swift version of this answer: https://github.com/fanpyi/UICollectionViewLeftAlignedLayout-Swift Taking @matt’s lead I modified his code to insure that items are ALWAYS left aligned. I found that if an item ended up on a line by itself, it would be centered by the flow layout. I made the following changes to address this issue. This situation would … Read more

How to pin the Public key of a certificate on iOS

In case you are in need of knowing how to extract this information from the certificate in your iOS code, here you have one way to do it. First of all add the security framework. #import <Security/Security.h> The add the openssl libraries. You can download them from https://github.com/st3fan/ios-openssl #import <openssl/x509.h> The NSURLConnectionDelegate Protocol allows you … Read more

What is the iOS 6 user agent string?

iPhone: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 iPad: Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 For a complete list and more details about the iOS user agent check out these 2 resources: Safari User Agent … Read more

From within a view controller in a container view, how do you access the view controller containing the container?

You can use the prepareForSeguemethod in Vc1 as an embed segue occurs when the ContainerViewController is made a child. you can pass self as an obj or store a reference to the child for later use. – (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSString * segueName = segue.identifier; if ([segueName isEqualToString: @”embedseg”]) { UINavigationController * navViewController … Read more

UISplitViewController programmatically without nib/xib

Declare your splitviewcontroller in your delegate header, use something like this in your didfinishlaunching ensure you add the UISplitViewControllerDelegate to the detailedViewController header file and that you have the delegate methods aswell. remember to import relevant header files – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { splitViewController = [[UISplitViewController alloc] init]; rootViewController *root = [[rootViewController alloc] init]; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)