【发布时间】:2017-05-22 12:56:55
【问题描述】:
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”,以便用户可以点击“收藏夹”按钮,报价为
直接添加到“收藏夹”文件夹中,并附上书面信息
屏幕“添加到收藏夹”。我还想添加一个“主页按钮”,所以
当用户被带到显示两个文件夹的主屏幕时,
也就是说,“引号”通过点击可以让你找到所有的引号
我已放入应用程序和 2 号“收藏夹”文件夹中,以便引用
用户喜欢的内容存储在那里,可以通过点击访问。
非常感谢您。
【问题讨论】:
标签: ios xcode social-networking socialshare action-button