             }
             
         case 1:
+            switch indexPath.row {
+            case 0:
+                postToTwitter()
+            case 1:
+                postToFacebook()
+            case 2:
+                postToLINE()
+            default:
+                postToTwitter()
+            }
             break
         default:
             break

//

import UIKit

struct settingReuseId {
    static let cell = "SettingCollectionViewCell"

        
        openAppStore(reviewURL)
    }
    
    func postToFacebook(){
        let vc = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
        let shareText = "iOSアプリ「ねこ部」かわいい " + appStoreURL
        vc.setInitialText(shareText)
        presentViewController(vc,animated:true,completion:nil)
    }
    
    func postToTwitter(){
        let vc = SLComposeViewController(forServiceType: SLServiceTypeTwitter)
        let shareText = "iOSアプリ「ねこ部」かわいい " + appStoreURL
        //テキストを設定
        vc.setInitialText(shareText)
        presentViewController(vc,animated:true,completion:nil)
    }
    
    func postToLINE(){
        let shareText = "iOSアプリ「ねこ部」かわいい " + appStoreURL
        let encodedText = shareText.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!
        
        var shareURL = NSURL(string: "line://msg/text/" + encodedText)
        
        if (UIApplication.sharedApplication().canOpenURL(shareURL!)) {
            UIApplication.sharedApplication().openURL(shareURL!)
        }
    }
}
