iOS 11 Widget does not expand when "Show more" button is tapped

Viewed 497

The problem is the widget does not expand when "Show more" button is tapped. Based on several users, the problem is intermittently happing since iOS11 update. On the same device it would work, then later for some reason it would not work. Also, we can build and run the app on the device at one time it would work and at another time it would not work which makes it difficult to confirm if the problem is fixed.

This is the code skeleton that is used:

#import "TodayViewController.h"
#import <NotificationCenter/NotificationCenter.h>

@interface TodayViewController () <NCWidgetProviding,myCustomDelegate>

@end

@implementation TodayViewController

- (void)viewDidLoad {
[super viewDidLoad];
// if objects are not drawn, draw them (uilable, uiviews ...etc)
  [self.extensionContext setWidgetLargestAvailableDisplayMode:NCWidgetDisplayModeExpanded];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler {

completionHandler(NCUpdateResultNewData);
}
- (void)widgetActiveDisplayModeDidChange:(NCWidgetDisplayMode)activeDisplayMode withMaximumSize:(CGSize)maxSize{

if (activeDisplayMode == NCWidgetDisplayModeCompact) {
    self.preferredContentSize = maxSize;

 }else{   
    CGFloat per = 0.7;
    CGSize s = CGSizeMake(maxSize.width,maxSize.height*per);
    self.preferredContentSize = s;
  }
}
@end

These are the warnings are printed to the console:

2017-09-25 23:00:41.705036-0400 myapp[6758:3887858] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x1c0119860> (Domain: group.com.mycompany. myapp, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
2017-09-25 23:00:41.776214-0400 myapp[6758:3887858] [MC] Loaded MobileCoreServices.framework
2017-09-25 23:00:42.057996-0400 myapp[6758:3887858] [Common] _BSMachError: port 6c03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
2017-09-25 23:01:51.544741-0400 myapp[6758:3887858] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

This widget is working perfectly with iOS 10.

0 Answers
Related