模拟器怎么安装sina微博等应用?
class KoreanViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func shareTapped(sender: UIButton) {
doShare(sender.restorationIdentifier!)
println(sender.restorationIdentifier!)
}
@IBOutlet weak var img: UIImageView!
private func doShare(falg: String){
var controller: SLComposeViewController? = nil
switch falg{
case "sinaweibo":
controller = SLComposeViewController(forServiceType: SLServiceTypeSinaWeibo)
case "twitter":
controller = SLComposeViewController(forServiceType: SLServiceTypeTwitter)
case "facebook":
controller = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
default: break
}
controller!.setInitialText("一起来玩Beauty Gallery App吧!")
controller!.addImage(img.image)
self.presentViewController(controller!, animated: true) { () -> Void in
println("分享成功")
}
}
}