2017-05-22 102 views
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 

「家」,使得用戶可以點擊「收藏夾」按鈕和引號 直接添加到「收藏夾」的文件夾,並與書面消息上
的屏幕「添加到收藏夾」。此外,我想添加一個「主頁按鈕」,所以
,當用戶被帶到主屏幕,其中顯示兩個文件夾, 是「引號」,通過竊聽將獲得你把所有的報價,
我已經放入應用程序和第2「收藏夾」文件夾,以便用戶喜歡的報價 存儲在那裏,並可以ge通過點擊來訪問。 非常感謝您提前。共享按鈕和收藏夾在xcode的文件夾8

回答

0
  1. 那是不可能的,也是它不會使來自UX點某種意義上爲用戶將已經獲取消息,如果他點擊Facebook的等,而他可能不希望與每一個可能的來源和警告分享他沒有登錄是令人討厭的。
  2. 您使用UIActivity