When I run the app on the xcode simulator I keep getting the error thread signal SIGABRT _abort_with_payload












0















My app is required to open images from the photo library so far Whenever I complete the code build and clean it runs with no problems the only time I am facing difficulties is when I use the xcode simulator and I try to upload the images the error appear. Also I thought that this might be because of the privacy setting but I changed it in the info.plist



xcode simulator Error another image of error xcode simulator Error two privacy setting image of info.plist
import UIKit
import Photos



class PhotoSelectorController: UICollectionViewController, UICollectionViewDelegateFlowLayout {

let cellId = "cellId"
let headerId = "headerId"

override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor = .white

setupNavigationButtons()

collectionView?.register(PhotoSelectorCell.self, forCellWithReuseIdentifier: cellId)

collectionView?.register(PhotoSelectorHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: headerId)

fetchPhotos()
}

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
self.selectedImage = images[indexPath.item]
self.collectionView?.reloadData()

let indexPath = IndexPath(item: 0, section: 0)
collectionView.scrollToItem(at: indexPath, at: .bottom, animated: true)
}

var selectedImage: UIImage?
var images = [UIImage]()
var assets = [PHAsset]()

fileprivate func assetsFetchOptions() -> PHFetchOptions {
let fetchOptions = PHFetchOptions()
fetchOptions.fetchLimit = 30
let sortDescriptor = NSSortDescriptor(key: "creationDate", ascending: false)
fetchOptions.sortDescriptors = [sortDescriptor]
return fetchOptions
}

fileprivate func fetchPhotos() {
let allPhotos = PHAsset.fetchAssets(with: .image, options: assetsFetchOptions())

DispatchQueue.global(qos: .background).async {
allPhotos.enumerateObjects({ (asset, count, stop) in
print(count)

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 200, height: 200)
let options = PHImageRequestOptions()
options.isSynchronous = true
imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFit, options: options, resultHandler: { (image, info) in

if let image = image {
self.images.append(image)
self.assets.append(asset)

if self.selectedImage == nil {
self.selectedImage = image
}
}

if count == allPhotos.count - 1 {
DispatchQueue.main.async {
self.collectionView?.reloadData()
}
}

})

})
}
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 1, left: 0, bottom: 0, right: 0)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
let width = view.frame.width
return CGSize(width: width, height: width)
}

var header: PhotoSelectorHeader?

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: headerId, for: indexPath) as! PhotoSelectorHeader

self.header = header

header.photoImageView.image = selectedImage

if let selectedImage = selectedImage {
if let index = self.images.index(of: selectedImage) {
let selectedAsset = self.assets[index]

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 600, height: 600)
imageManager.requestImage(for: selectedAsset, targetSize: targetSize, contentMode: .default, options: nil, resultHandler: { (image, info) in

header.photoImageView.image = image

})

}
}




return header
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let width = (view.frame.width - 3) / 4
return CGSize(width: width, height: width)
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return images.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! PhotoSelectorCell

cell.photoImageView.image = images[indexPath.item]

return cell
}

override var prefersStatusBarHidden: Bool {
return true
}

fileprivate func setupNavigationButtons() {
navigationController?.navigationBar.tintColor = .black
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(handleCancel))

navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(handleNext))
}

@objc func handleNext() {
let sharePhotoController = SharePhotoController()
sharePhotoController.selectedImage = header?.photoImageView.image
navigationController?.pushViewController(sharePhotoController, animated: true)
}

@objc func handleCancel() {
dismiss(animated: true, completion: nil)
}


}










share|improve this question























  • Have you requested permission to access the libraries by prompting the user?

    – MadProgrammer
    Dec 31 '18 at 23:30











  • Yes I have you can check the above image info.plist

    – Waleed
    Dec 31 '18 at 23:39











  • No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

    – MadProgrammer
    Dec 31 '18 at 23:42
















0















My app is required to open images from the photo library so far Whenever I complete the code build and clean it runs with no problems the only time I am facing difficulties is when I use the xcode simulator and I try to upload the images the error appear. Also I thought that this might be because of the privacy setting but I changed it in the info.plist



xcode simulator Error another image of error xcode simulator Error two privacy setting image of info.plist
import UIKit
import Photos



class PhotoSelectorController: UICollectionViewController, UICollectionViewDelegateFlowLayout {

let cellId = "cellId"
let headerId = "headerId"

override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor = .white

setupNavigationButtons()

collectionView?.register(PhotoSelectorCell.self, forCellWithReuseIdentifier: cellId)

collectionView?.register(PhotoSelectorHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: headerId)

fetchPhotos()
}

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
self.selectedImage = images[indexPath.item]
self.collectionView?.reloadData()

let indexPath = IndexPath(item: 0, section: 0)
collectionView.scrollToItem(at: indexPath, at: .bottom, animated: true)
}

var selectedImage: UIImage?
var images = [UIImage]()
var assets = [PHAsset]()

fileprivate func assetsFetchOptions() -> PHFetchOptions {
let fetchOptions = PHFetchOptions()
fetchOptions.fetchLimit = 30
let sortDescriptor = NSSortDescriptor(key: "creationDate", ascending: false)
fetchOptions.sortDescriptors = [sortDescriptor]
return fetchOptions
}

fileprivate func fetchPhotos() {
let allPhotos = PHAsset.fetchAssets(with: .image, options: assetsFetchOptions())

DispatchQueue.global(qos: .background).async {
allPhotos.enumerateObjects({ (asset, count, stop) in
print(count)

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 200, height: 200)
let options = PHImageRequestOptions()
options.isSynchronous = true
imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFit, options: options, resultHandler: { (image, info) in

if let image = image {
self.images.append(image)
self.assets.append(asset)

if self.selectedImage == nil {
self.selectedImage = image
}
}

if count == allPhotos.count - 1 {
DispatchQueue.main.async {
self.collectionView?.reloadData()
}
}

})

})
}
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 1, left: 0, bottom: 0, right: 0)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
let width = view.frame.width
return CGSize(width: width, height: width)
}

var header: PhotoSelectorHeader?

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: headerId, for: indexPath) as! PhotoSelectorHeader

self.header = header

header.photoImageView.image = selectedImage

if let selectedImage = selectedImage {
if let index = self.images.index(of: selectedImage) {
let selectedAsset = self.assets[index]

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 600, height: 600)
imageManager.requestImage(for: selectedAsset, targetSize: targetSize, contentMode: .default, options: nil, resultHandler: { (image, info) in

header.photoImageView.image = image

})

}
}




return header
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let width = (view.frame.width - 3) / 4
return CGSize(width: width, height: width)
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return images.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! PhotoSelectorCell

cell.photoImageView.image = images[indexPath.item]

return cell
}

override var prefersStatusBarHidden: Bool {
return true
}

fileprivate func setupNavigationButtons() {
navigationController?.navigationBar.tintColor = .black
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(handleCancel))

navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(handleNext))
}

@objc func handleNext() {
let sharePhotoController = SharePhotoController()
sharePhotoController.selectedImage = header?.photoImageView.image
navigationController?.pushViewController(sharePhotoController, animated: true)
}

@objc func handleCancel() {
dismiss(animated: true, completion: nil)
}


}










share|improve this question























  • Have you requested permission to access the libraries by prompting the user?

    – MadProgrammer
    Dec 31 '18 at 23:30











  • Yes I have you can check the above image info.plist

    – Waleed
    Dec 31 '18 at 23:39











  • No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

    – MadProgrammer
    Dec 31 '18 at 23:42














0












0








0








My app is required to open images from the photo library so far Whenever I complete the code build and clean it runs with no problems the only time I am facing difficulties is when I use the xcode simulator and I try to upload the images the error appear. Also I thought that this might be because of the privacy setting but I changed it in the info.plist



xcode simulator Error another image of error xcode simulator Error two privacy setting image of info.plist
import UIKit
import Photos



class PhotoSelectorController: UICollectionViewController, UICollectionViewDelegateFlowLayout {

let cellId = "cellId"
let headerId = "headerId"

override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor = .white

setupNavigationButtons()

collectionView?.register(PhotoSelectorCell.self, forCellWithReuseIdentifier: cellId)

collectionView?.register(PhotoSelectorHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: headerId)

fetchPhotos()
}

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
self.selectedImage = images[indexPath.item]
self.collectionView?.reloadData()

let indexPath = IndexPath(item: 0, section: 0)
collectionView.scrollToItem(at: indexPath, at: .bottom, animated: true)
}

var selectedImage: UIImage?
var images = [UIImage]()
var assets = [PHAsset]()

fileprivate func assetsFetchOptions() -> PHFetchOptions {
let fetchOptions = PHFetchOptions()
fetchOptions.fetchLimit = 30
let sortDescriptor = NSSortDescriptor(key: "creationDate", ascending: false)
fetchOptions.sortDescriptors = [sortDescriptor]
return fetchOptions
}

fileprivate func fetchPhotos() {
let allPhotos = PHAsset.fetchAssets(with: .image, options: assetsFetchOptions())

DispatchQueue.global(qos: .background).async {
allPhotos.enumerateObjects({ (asset, count, stop) in
print(count)

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 200, height: 200)
let options = PHImageRequestOptions()
options.isSynchronous = true
imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFit, options: options, resultHandler: { (image, info) in

if let image = image {
self.images.append(image)
self.assets.append(asset)

if self.selectedImage == nil {
self.selectedImage = image
}
}

if count == allPhotos.count - 1 {
DispatchQueue.main.async {
self.collectionView?.reloadData()
}
}

})

})
}
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 1, left: 0, bottom: 0, right: 0)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
let width = view.frame.width
return CGSize(width: width, height: width)
}

var header: PhotoSelectorHeader?

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: headerId, for: indexPath) as! PhotoSelectorHeader

self.header = header

header.photoImageView.image = selectedImage

if let selectedImage = selectedImage {
if let index = self.images.index(of: selectedImage) {
let selectedAsset = self.assets[index]

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 600, height: 600)
imageManager.requestImage(for: selectedAsset, targetSize: targetSize, contentMode: .default, options: nil, resultHandler: { (image, info) in

header.photoImageView.image = image

})

}
}




return header
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let width = (view.frame.width - 3) / 4
return CGSize(width: width, height: width)
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return images.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! PhotoSelectorCell

cell.photoImageView.image = images[indexPath.item]

return cell
}

override var prefersStatusBarHidden: Bool {
return true
}

fileprivate func setupNavigationButtons() {
navigationController?.navigationBar.tintColor = .black
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(handleCancel))

navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(handleNext))
}

@objc func handleNext() {
let sharePhotoController = SharePhotoController()
sharePhotoController.selectedImage = header?.photoImageView.image
navigationController?.pushViewController(sharePhotoController, animated: true)
}

@objc func handleCancel() {
dismiss(animated: true, completion: nil)
}


}










share|improve this question














My app is required to open images from the photo library so far Whenever I complete the code build and clean it runs with no problems the only time I am facing difficulties is when I use the xcode simulator and I try to upload the images the error appear. Also I thought that this might be because of the privacy setting but I changed it in the info.plist



xcode simulator Error another image of error xcode simulator Error two privacy setting image of info.plist
import UIKit
import Photos



class PhotoSelectorController: UICollectionViewController, UICollectionViewDelegateFlowLayout {

let cellId = "cellId"
let headerId = "headerId"

override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor = .white

setupNavigationButtons()

collectionView?.register(PhotoSelectorCell.self, forCellWithReuseIdentifier: cellId)

collectionView?.register(PhotoSelectorHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: headerId)

fetchPhotos()
}

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
self.selectedImage = images[indexPath.item]
self.collectionView?.reloadData()

let indexPath = IndexPath(item: 0, section: 0)
collectionView.scrollToItem(at: indexPath, at: .bottom, animated: true)
}

var selectedImage: UIImage?
var images = [UIImage]()
var assets = [PHAsset]()

fileprivate func assetsFetchOptions() -> PHFetchOptions {
let fetchOptions = PHFetchOptions()
fetchOptions.fetchLimit = 30
let sortDescriptor = NSSortDescriptor(key: "creationDate", ascending: false)
fetchOptions.sortDescriptors = [sortDescriptor]
return fetchOptions
}

fileprivate func fetchPhotos() {
let allPhotos = PHAsset.fetchAssets(with: .image, options: assetsFetchOptions())

DispatchQueue.global(qos: .background).async {
allPhotos.enumerateObjects({ (asset, count, stop) in
print(count)

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 200, height: 200)
let options = PHImageRequestOptions()
options.isSynchronous = true
imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFit, options: options, resultHandler: { (image, info) in

if let image = image {
self.images.append(image)
self.assets.append(asset)

if self.selectedImage == nil {
self.selectedImage = image
}
}

if count == allPhotos.count - 1 {
DispatchQueue.main.async {
self.collectionView?.reloadData()
}
}

})

})
}
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 1, left: 0, bottom: 0, right: 0)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
let width = view.frame.width
return CGSize(width: width, height: width)
}

var header: PhotoSelectorHeader?

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: headerId, for: indexPath) as! PhotoSelectorHeader

self.header = header

header.photoImageView.image = selectedImage

if let selectedImage = selectedImage {
if let index = self.images.index(of: selectedImage) {
let selectedAsset = self.assets[index]

let imageManager = PHImageManager.default()
let targetSize = CGSize(width: 600, height: 600)
imageManager.requestImage(for: selectedAsset, targetSize: targetSize, contentMode: .default, options: nil, resultHandler: { (image, info) in

header.photoImageView.image = image

})

}
}




return header
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 1
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let width = (view.frame.width - 3) / 4
return CGSize(width: width, height: width)
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return images.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! PhotoSelectorCell

cell.photoImageView.image = images[indexPath.item]

return cell
}

override var prefersStatusBarHidden: Bool {
return true
}

fileprivate func setupNavigationButtons() {
navigationController?.navigationBar.tintColor = .black
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(handleCancel))

navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(handleNext))
}

@objc func handleNext() {
let sharePhotoController = SharePhotoController()
sharePhotoController.selectedImage = header?.photoImageView.image
navigationController?.pushViewController(sharePhotoController, animated: true)
}

@objc func handleCancel() {
dismiss(animated: true, completion: nil)
}


}







ios swift xcode10.1






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 31 '18 at 23:26









WaleedWaleed

12




12













  • Have you requested permission to access the libraries by prompting the user?

    – MadProgrammer
    Dec 31 '18 at 23:30











  • Yes I have you can check the above image info.plist

    – Waleed
    Dec 31 '18 at 23:39











  • No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

    – MadProgrammer
    Dec 31 '18 at 23:42



















  • Have you requested permission to access the libraries by prompting the user?

    – MadProgrammer
    Dec 31 '18 at 23:30











  • Yes I have you can check the above image info.plist

    – Waleed
    Dec 31 '18 at 23:39











  • No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

    – MadProgrammer
    Dec 31 '18 at 23:42

















Have you requested permission to access the libraries by prompting the user?

– MadProgrammer
Dec 31 '18 at 23:30





Have you requested permission to access the libraries by prompting the user?

– MadProgrammer
Dec 31 '18 at 23:30













Yes I have you can check the above image info.plist

– Waleed
Dec 31 '18 at 23:39





Yes I have you can check the above image info.plist

– Waleed
Dec 31 '18 at 23:39













No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

– MadProgrammer
Dec 31 '18 at 23:42





No, that's not "requesting" permission, that's the prompt that will be used WHEN requesting permission, You need to use a combination of PHPhotoLibrary#requestAuthorization(_:) and PHPhotoLibrary#authorizationStatus()

– MadProgrammer
Dec 31 '18 at 23:42












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992112%2fwhen-i-run-the-app-on-the-xcode-simulator-i-keep-getting-the-error-thread-signal%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992112%2fwhen-i-run-the-app-on-the-xcode-simulator-i-keep-getting-the-error-thread-signal%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas