Skip to content

Instantly share code, notes, and snippets.

View KC-218's full-sized avatar

KC KC-218

  • Taiwan
  • 13:13 (UTC +08:00)
View GitHub Profile
2020-07-14 06:34:10 +0000 [MT] Beginning distribution assistant for archive: TestFirebaseCrashlytics, task: 2
2020-07-14 06:34:13 +0000 [MT] Proceeding to distribution step IDEDistributionAnalyzeArchiveStepViewController, context: <IDEDistributionContext: 0x7fd58861b040; archive(resolved)='<IDEArchive: 0x7fd59165ad60>', distributionTask(resolved)='2', distributionDestination(resolved)='1', distributionMethod(resolved)='<IDEDistributionMethodiOSEnterprise: 0x7fd568f0a440>', team(resolved)='(null)'>
Chain (5, self inclusive):
<IDEDistributionContext: 0x7fd58861b040; archive = '<IDEArchive: 0x7fd59165ad60>', distributionMethod='<IDEDistributionMethodiOSEnterprise: 0x7fd568f0a440>', team='(null)'>
<IDEDistributionContext: 0x7fd587f27570; archive = '<IDEArchive: 0x7fd59165ad60>', distributionMethod='<IDEDistributionMethodiOSEnterprise: 0x7fd568f0a440>', team='(null)'>
<IDEDistributionContext: 0x7fd59f8cad50; archive = '<IDEArchive: 0x7fd59165ad60>', distributionMethod='<IDEDistributionMethodiOSEnterprise: 0x7f
//清除cookies
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies]){
[storage deleteCookie:cookie];
}
//清除UIWebView的缓存
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLCache * cache = [NSURLCache sharedURLCache];
[cache removeAllCachedResponses];
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
var songsArray: [String] = ["就是我","會讀書","翅膀","星球","凍結","壓力","女兒家","星空下的吻","讓我心動的人","會有那麼一天","不懂","一開始(In the Beginning)","第二天堂","子彈列車","起床了(Morning Call)","豆漿油條","江南","害怕","天使心","森林浴(In the Woods)","精靈","相信無限","美人魚","距離"]
var searchSongs: [String] = []
override func viewDidLoad() {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: CustomCell = CustomCell()
cell.button.addTarget(self, action: #selector(buttonClicked(sender:)), for: .touchUpInside)
}
func buttonClicked(sender: UIButton) {
let tapLocation = sender.convert(CGPoint.zero, to: tableView) //取得按鈕位置
let tapIndexPath = self.tableView.indexPathForRow(at: tapLocation) //這個位置位於哪個indexPath
print(tapIndexPath.row)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: CustomCell = CustomCell()
cell.button.tag = indexPath.row
cell.button.addTarget(self, action: #selector(buttonClicked(sender:)), for: .touchUpInside)
}
func buttonClicked(sender: UIButton) {
print(sender.tag)
}