Skip to content

Commit

Permalink
Improve UI messageees
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanhuang13 committed Aug 5, 2018
1 parent a2a20c2 commit 839e896
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Blahker/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class AboutViewController: UITableViewController {
let vc = MFMailComposeViewController()
vc.setToRecipients(["[email protected]"])
vc.setSubject("[Blahker 使用者回報]我有問題")
vc.setMessageBody("Hello 開發者,\n\n建議加入擋蓋版廣告之網站:\n建議附上螢幕截圖,以利判斷,謝謝)\n\n", isHTML: false)
vc.setMessageBody("Hello 開發者,\n\n建議加入擋蓋版廣告之網站:\n請附上螢幕截圖,以利判斷,謝謝)\n\n", isHTML: false)
vc.mailComposeDelegate = self
self.present(vc, animated: true, completion: { })
}
Expand Down
11 changes: 9 additions & 2 deletions Blahker/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,27 @@ App 將會自動取得最新擋廣告網站清單,你也可以透過左上角
</tableViewCellContentView>
<color key="backgroundColor" white="0.10000000000000001" alpha="1" colorSpace="calibratedWhite"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="report" textLabel="UhO-fw-2RY" style="IBUITableViewCellStyleDefault" id="Wgb-JO-apx">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="report" textLabel="UhO-fw-2RY" detailTextLabel="M6v-CJ-4Vg" style="IBUITableViewCellStyleSubtitle" id="Wgb-JO-apx">
<rect key="frame" x="0.0" y="85" width="414" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Wgb-JO-apx" id="yCa-RD-2Kl">
<rect key="frame" x="0.0" y="0.0" width="376" height="49.666666666666664"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="回報廣告網站或問題" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UhO-fw-2RY">
<rect key="frame" x="20" y="0.0" width="356" height="49.666666666666664"/>
<rect key="frame" x="20" y="7.9999999999999982" width="156" height="20.333333333333332"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="請附上螢幕截圖,以利判斷" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="M6v-CJ-4Vg">
<rect key="frame" x="20" y="28.333333333333332" width="147.33333333333334" height="14.333333333333334"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" white="0.10000000000000001" alpha="1" colorSpace="calibratedWhite"/>
Expand Down
13 changes: 10 additions & 3 deletions Blahker/BlockerListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ class BlockerListViewController: UITableViewController {

let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(reloadData), for: .valueChanged)
self.refreshControl = refreshControl
refreshControl.attributedTitle = NSAttributedString(string: "更新擋廣告網站清單", attributes: [NSAttributedStringKey.foregroundColor: UIColor.white])

if #available(iOS 10.0, *) {
tableView.refreshControl = refreshControl
} else {
tableView.addSubview(refreshControl)
}

tableView.backgroundView?.addSubview(refreshControl)
tableView.indicatorStyle = .white
}

Expand All @@ -35,7 +40,9 @@ class BlockerListViewController: UITableViewController {
let request = URLRequest(url: url)
let task = session.dataTask(with: request) { (data, response, connectionError) in
DispatchQueue.main.async {
self.refreshControl?.endRefreshing()
if #available(iOS 10.0, *) {
self.tableView.refreshControl?.endRefreshing()
}
UIApplication.shared.isNetworkActivityIndicatorVisible = false
}

Expand Down

0 comments on commit 839e896

Please sign in to comment.