cocoa-touch

UIAccessibility default language throughout the app

不想你离开。 提交于 2020-01-13 11:21:09
问题 We're working on an app that's localized only in the German language and want to add accessibility feature to it. Since the accessibilityLabel s are in German, it would be great to always read it in German, regardless of what the user's default system language is. I noticed one can set that with the accessibilityLanguage property. But it needs to be set on each control repeatedly. Is there any way to set the accessibility language once globally for every control in the app? 回答1: Just found

The use of UIApplicationDidFinishLaunchingNotification

风格不统一 提交于 2020-01-13 10:24:10
问题 Posted immediately after the application finishes launching. That's what the Apple docs state. But I don't see how an object could receive this notification. It would have to add itself as an observer, but the earliest it could do this is in the application:didFinishLaunchingWithOptions: method. At that moment, the notification has already been posted. I don't see any use for this notification, or am I overlooking something? 回答1: Assume you have some object of class "MyController" in the root

Will [NSURLConnection sendAsynchronousRequest: …] always send completion block?

隐身守侯 提交于 2020-01-13 10:22:16
问题 Most likely a rather trivial question but will the completion block always be called using [NSURLConnection sendAsynchronousRequest: ...] ? OR do I have to implement a timeout timer? Consider the following where I add a MBProgressView before the call and remove it ONLY in the completion block: [self showHUDWithTitle:@"Configuring"]; [NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)

SKCropNode fails when I add extra SKNode children in hierarchy

大憨熊 提交于 2020-01-13 10:06:08
问题 Update: It looks like iOS 10 has fixed this issue. I upgraded to Swift 3 and Xcode 8 and everything is working as expected. I've run into this issue a couple times now and I can't tell if it's a bug in SKCropNode or if I'm just misusing it. Perhaps there's some bit of documentation I'm missing to explain why this is happening? I have a crop node with a 100x100 rectangle shape as the mask. If I place a blue circle inside it, it gets cropped properly. // Create a crope node with a small square.

SKCropNode fails when I add extra SKNode children in hierarchy

你离开我真会死。 提交于 2020-01-13 10:05:22
问题 Update: It looks like iOS 10 has fixed this issue. I upgraded to Swift 3 and Xcode 8 and everything is working as expected. I've run into this issue a couple times now and I can't tell if it's a bug in SKCropNode or if I'm just misusing it. Perhaps there's some bit of documentation I'm missing to explain why this is happening? I have a crop node with a 100x100 rectangle shape as the mask. If I place a blue circle inside it, it gets cropped properly. // Create a crope node with a small square.

CLLocationManager not getting City name

半腔热情 提交于 2020-01-13 09:26:28
问题 I am trying to get the current city and country using CLLocationManager with below code - #pragma mark - Core Location Delegate Methods - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLGeocoder *reverseGeocoder = [[CLGeocoder alloc] init]; [reverseGeocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) { NSLog(@"reverseGeocodeLocation:completionHandler:

How to get touch coordinates upon SELECTING a custom UITableViewCell?

我与影子孤独终老i 提交于 2020-01-13 09:23:08
问题 When I touch (Touch Up) a UITableViewCell my ViewController's UITableViewDelegate method - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath is called. I need to get the x-coordinate of the Touch-Point at this time as well so that I can know what portion of the Cell was touched (non-accessory items). I have tried using the usual touch methods such as TouchesDidEnd but the coordinates always return x=0.000 y=0.000 no matter where I touched (A location in

Keyframe animation key time

99封情书 提交于 2020-01-13 09:04:10
问题 I've just created a keyframe animation like this: [UIView animateKeyframesWithDuration:10 delay:0 options:0 animations:^{ [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:.1 animations:^{ view.alpha = 0; }]; } completion:nil]; And this is a CAKeyframeAnimation that gets created: (lldb) po [self.layer animationForKey:@"opacity"] <CAKeyframeAnimation:0x10a6364b0; keyTimes = ( 0, "0.1", 1 ); values = ( 1, 0, 0 ); calculationMode = linear; delegate = <UIViewKeyframeAnimationState:

UIgestureRecognizer in a view inside a UIScrollView

巧了我就是萌 提交于 2020-01-13 09:04:09
问题 Has anyone managed to get a UIGestureRecognizer to work on a UIView that is a subview of a UIScrollView? My callbacks never seems to get called. As a simple example, I want to have a paging scrollview and on the third page listen for a tap with a UITapGestureRecognizer. However I can not get it to work. Here's how I would do it: self.scrollView = [[[UIScrollView alloc] initWithFrame:self.view.frame] autorelease]; self.scrollView.pagingEnabled = YES; self.scrollView.contentSize = CGSizeMake

iPod Touch canOpenURL of type tel://

匆匆过客 提交于 2020-01-13 09:02:30
问题 On an iPod Touch running iOS 8.0 (12A365), canOpenURL: returns YES for tel:// URL schemes. Also, openURL: returns nil, after a 5 - 10 second delay . UIApplication *application = [UIApplication sharedApplication]; NSURL *url = [NSURL URLWithString:@"tel://"]; if ([application canOpenURL:url]) { [application openURL:url]; } Anyone know why canOpenURL: doesn't return NO for iPod? The facetime URL scheme is different ('facetime://') so in theory it should return NO . Unfortunately I don't have an