I am using XCode 8 and testing with iOS 10.2 Beta.
I have added the Photos, PhotosUI and MobileCoreServices frameworks to project.
Very simple code:
You may need to put the NSPhotoLibraryUsageDescription in your plist. Like
NSPhotoLibraryUsageDescription $(PRODUCT_NAME) uses photos
Check all the usage descriptions here.