显示在iOS的用户的iTunes配置文件应用程序
问题描述:
我想在iPhone的屏幕上显示this iTunes链接。 我应该使用UIWebView
还是别的?显示在iOS的用户的iTunes配置文件应用程序
import UIKit
class MusicViewController: UIViewController {
@IBOutlet var itunesWebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL (string: "https://geo.itunes.apple.com/us/artist/seka-aleksic/id309535625?mt=1&app=music")
let requestObj = NSURLRequest(URL: url!)
itunesWebView.loadRequest(requestObj)
/* INITIAL SETUP FOR COLOURS & FONTS */
// Change the Navigation Bar Font to Lato
navigationController?.navigationBar.titleTextAttributes =
[NSForegroundColorAttributeName: UIColor.whiteColor(),
NSFontAttributeName: UIFont(name: "Lato-Semibold", size: 20)!]
// Set the Navigation Bar Text Color to White
navigationController!.navigationBar.tintColor = UIColor.whiteColor()
// Set the Background of the Table View
let imageView = UIImageView(frame: self.view.frame)
let image = UIImage(named: "main_menu_background")!
imageView.image = image
self.view.addSubview(imageView)
self.view.sendSubviewToBack(imageView)
/* INITIAL SETUP FOR COLOURS & FONTS */
}
}
任何帮助将高度赞赏
答
当然可以! 使用此:https://linkmaker.itunes.apple.com/en-us/?urlDesc=&country=us 它创建一个iTunes链接准备分享。 希望它可以帮助你
如果你有这一个问题,请让我
编辑:
UIWebView中加载URL
与链接(你的情况):
let url = NSURL (string: "https://geo.itunes.apple.com/us/app/clash-of-clans/id529479190?mt=8");
let requestObj = NSURLRequest(URL: url!);
yourWebView.loadRequest(requestObj);
With一个HTML代码:
var htmlString:String! = "<br /><h2>Blaaaaa</h2>"
yourWebView.loadHTMLString(htmlString, baseURL: nil)
我的例子:https://www.dropbox.com/s/7z8xuidqedwhy2e/DragosStrugarHelp.zip?dl=0