1
So this is my code: 
@IBOutlet weak var quoteLabel: UILabel!
var quotes = ["I am no 1", "I am no2", "I am no3"]
var currentQuoteIndex = 0 
@IBAction func forwardAction(_ sender: UIButton) {
            currentQuoteIndex += 1

    if currentQuoteIndex >= quotes.count

    {
        currentQuoteIndex = 0

    }

    quoteLabel.text = quotes[currentQuoteIndex]

}

@IBAction func backwardAction(_ sender: UIButton) {

    currentQuoteIndex -= 1
    if currentQuoteIndex < 0 {
        currentQuoteIndex = quotes.count - 1
    }
    quoteLabel.text = quotes[currentQuoteIndex]

}


@IBAction func shareButton(_ sender: Any) {



   let activityVC = UIActivityViewController(activityItems:     
   [self.quoteLabel.text!], applicationActivities: nil)

    activityVC.popoverPresentationController?.sourceView = self.view
    self.present(activityVC, animated: true, completion: nil)

}
}

So my questions are: 
No.1:  I want to add an alert message in share button so that any user who
 doesnt have facebook or any other social app connected to the app, would
get the warning message "You are not connected to Facebook". And every other 
social media apps such as twitter. 
No.2: I also want to add two more folders with the name "favorites" and 

"home" so that user can tap on the "favorites" button and the quote is directly added to that "favorites" folder and with the written message on
the screen "added to favorites".And also i want to add a "home button" so
that when the user is taken to the home screen where two folders are shown, that are, "quotes" on which by tapping would get you to all the quotes that
i have put into the app and no.2 "favorites" folder so that the quotes which the user has liked are stored there and can get access to by tapping. Thank you very much in advance.

Neymat Afg
  • 29
  • 6

1 Answers1

0
  1. That is not possible and also it doesn't make some sense from UX point as user would already get that message if he clicks Facebook etc while he probably doesn't want to share with every single possible source and warning that he is not logged in is annoying.
  2. You use UIActivity for that.
Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57