Reload UICollectionView header or footer?

You can also use (the lazy way) collectionView.collectionViewLayout.invalidateLayout() // swift [[_collectionView collectionViewLayout] invalidateLayout] // objc More complex would be to provide a context collectionView.collectionViewLayout.invalidateLayout(with: context) // swift [[_collectionView collectionViewLayout] invalidateLayoutWithContext:context] // objc You can then make a or configure the context yourself to inform about what should be updated see: UICollectionViewLayoutInvalidationContext It has a function … Read more

UIPageViewController navigates to wrong page with Scroll transition style

My workaround of this bug was to create a block when finished that was setting the same viewcontroller but without animation __weak YourSelfClass *blocksafeSelf = self; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:^(BOOL finished){ if(finished) { dispatch_async(dispatch_get_main_queue(), ^{ [blocksafeSelf.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL];// bug fix for uipageview controller }); } }];

What are good alternatives to UITextAlignmentCenter in iOS 6?

For IOS 6 you should use NSTextAlignmentCenter instead of UITextAlignmentCenter: button.titleLabel.textAlignment = NSTextAlignmentCenter; Source And if you want backward compatibiliy to IOS 5 also you can do this, #ifdef __IPHONE_6_0 # define ALIGN_CENTER NSTextAlignmentCenter #else # define ALIGN_CENTER UITextAlignmentCenter #endif

iOS6 viewDidUnload Deprecated

You should use the – (void)didReceiveMemoryWarning and – (void)dealloc methods. In iOS 6, the viewWillUnload and viewDidUnload methods of UIViewController are now deprecated. If you were using these methods to release data, use the didReceiveMemoryWarning method instead. You can also use this method to release references to the view controller’s view if it is not … Read more

Pull-to-refresh in UICollectionViewController

The answers to both (1) and (2) are yes. Simply add a UIRefreshControl instance as a subview of .collectionView and it just works. UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(startRefresh:) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; That’s it! I wish this had been mentioned in the documentation somewhere, even though sometimes a simple experiment does the … Read more

Could not insert new outlet connection [duplicate]

I got the same problem as you today… I think this is a bug of Xcode, below is the way to fix the issue: Close the project you are working on with. Delete your project’s【DerivedData】folder. (This folder may inside your project’s folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you. … Read more

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