Skip to content

Commit 8f7d7b5

Browse files
committed
Example Swift update
1 parent 8ee1e64 commit 8f7d7b5

File tree

4 files changed

+59
-16
lines changed

4 files changed

+59
-16
lines changed

Example/APFeedBackSwift/AppDelegate.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1616

1717

1818
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
19-
// Override point for customization after application launch.
19+
2020
DeviceInfo.deviceManager().logfilecreate()
21-
// Override point for customization after application launch.
22-
23-
24-
25-
print("Hello Swift")
26-
2721
return true
2822
}
2923

Example/APFeedBackSwift/Base.lproj/Main.storyboard

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="vpu-r4-DRW">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="vpu-r4-DRW">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -15,22 +15,42 @@
1515
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
1616
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
18+
<subviews>
19+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YtO-ti-TQd">
20+
<rect key="frame" x="56" y="158" width="262" height="35"/>
21+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
22+
<state key="normal" title="Button"/>
23+
<buttonConfiguration key="configuration" style="tinted" title="APFeedBack PushView"/>
24+
<connections>
25+
<action selector="openPushViewController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="RDU-Mx-K4w"/>
26+
</connections>
27+
</button>
28+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3dE-N0-oDZ">
29+
<rect key="frame" x="56" y="234" width="262" height="35"/>
30+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
31+
<state key="normal" title="Button"/>
32+
<buttonConfiguration key="configuration" style="tinted" title="APFeedBack ModalView"/>
33+
<connections>
34+
<action selector="openModalViewController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="sVZ-oE-eGq"/>
35+
</connections>
36+
</button>
37+
</subviews>
1938
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
39+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2040
</view>
2141
<navigationItem key="navigationItem" id="gLh-ox-gAL"/>
2242
</viewController>
2343
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2444
</objects>
25-
<point key="canvasLocation" x="486" y="36"/>
45+
<point key="canvasLocation" x="485.60000000000002" y="35.532233883058474"/>
2646
</scene>
2747
<!--Navigation Controller-->
2848
<scene sceneID="hca-Gz-app">
2949
<objects>
3050
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="vpu-r4-DRW" sceneMemberID="viewController">
3151
<toolbarItems/>
3252
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="pYR-4x-hV1">
33-
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
53+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
3454
<autoresizingMask key="autoresizingMask"/>
3555
</navigationBar>
3656
<nil name="viewControllers"/>

Example/APFeedBackSwift/ViewController.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ class ViewController: UIViewController {
1616
print("Hello Swift viewDidLoad")
1717
NSLog("txt log viewDidLoad")
1818

19+
}
20+
@IBAction func openPushViewController(_ sender: UIButton) {
21+
let fd = APFeedTableViewController()
22+
fd.developer_LogFile = true
23+
fd.mailHTML = true
24+
navigationController?.pushViewController(fd, animated: true)
25+
}
26+
@IBAction func openModalViewController(_ sender: UIButton) {
1927
let fd = APFeedTableViewController()
2028
fd.developer_LogFile = true
2129
fd.mailHTML = true
22-
navigationController?.pushViewController(fd as? UIViewController ?? UITableViewController(), animated: true)
30+
fd.modalPresentationStyle = .formSheet
31+
present(fd, animated: true, completion: nil)
2332
}
2433

34+
2535
override func didReceiveMemoryWarning() {
2636
super.didReceiveMemoryWarning()
2737
// Dispose of any resources that can be recreated.

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,32 @@ navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
5353
[self presentViewController:navController animated:YES completion:nil];
5454

5555
}
56-
````
57-
5856

59-
````objective-c
57+
//AppDelegate
6058
[[DeviceInfo deviceManager]logfilecreate];
59+
6160
````
61+
---
62+
63+
````Swift
6264

65+
@IBAction func openPushViewController(_ sender: UIButton) {
66+
let fd = APFeedTableViewController()
67+
fd.developer_LogFile = true
68+
fd.mailHTML = true
69+
navigationController?.pushViewController(fd, animated: true)
70+
}
71+
@IBAction func openModalViewController(_ sender: UIButton) {
72+
let fd = APFeedTableViewController()
73+
fd.developer_LogFile = true
74+
fd.mailHTML = true
75+
fd.modalPresentationStyle = .formSheet
76+
present(fd, animated: true, completion: nil)
77+
}
78+
79+
//AppDelegate
80+
DeviceInfo.deviceManager().logfilecreate()
81+
````
6382

6483

6584
[img0]:APFeedBack1.png

0 commit comments

Comments
 (0)