Commit c01964de authored by jzhang's avatar jzhang

使用navigation controller

parent 17d6404e
...@@ -447,7 +447,7 @@ ...@@ -447,7 +447,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = W3C84P5FPS; DEVELOPMENT_TEAM = W3C84P5FPS;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Flutter"; FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Flutter";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = W3C84P5FPS; DEVELOPMENT_TEAM = W3C84P5FPS;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Flutter"; FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Flutter";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sh4-Ff-iOb">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s7D-fE-2f9"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s7D-fE-2f9">
<rect key="frame" x="358" y="44" width="40" height="40"/> <rect key="frame" x="358" y="88" width="40" height="40"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="JlQ-c6-MTE"/> <constraint firstAttribute="height" constant="40" id="JlQ-c6-MTE"/>
<constraint firstAttribute="width" constant="40" id="QfK-8H-GP3"/> <constraint firstAttribute="width" constant="40" id="QfK-8H-GP3"/>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wyh-ZZ-B5n"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wyh-ZZ-B5n">
<rect key="frame" x="312" y="84" width="100" height="120"/> <rect key="frame" x="312" y="128" width="100" height="120"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="popup" translatesAutoresizingMaskIntoConstraints="NO" id="d65-2N-aD0"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="popup" translatesAutoresizingMaskIntoConstraints="NO" id="d65-2N-aD0">
<rect key="frame" x="60" y="0.0" width="12" height="13"/> <rect key="frame" x="60" y="0.0" width="12" height="13"/>
...@@ -444,6 +444,22 @@ ...@@ -444,6 +444,22 @@
</objects> </objects>
<point key="canvasLocation" x="603.07692307692309" y="-223.22274881516586"/> <point key="canvasLocation" x="603.07692307692309" y="-223.22274881516586"/>
</scene> </scene>
<!--Navigation Controller-->
<scene sceneID="1c3-5Y-gnM">
<objects>
<navigationController id="sh4-Ff-iOb" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Taj-fv-Fxb">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="34V-MH-zAh"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8PS-55-tPj" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1568" y="31"/>
</scene>
</scenes> </scenes>
<resources> <resources>
<image name="icon_global" width="62" height="62"/> <image name="icon_global" width="62" height="62"/>
......
...@@ -22,7 +22,7 @@ class CompleteVC: UIViewController { ...@@ -22,7 +22,7 @@ class CompleteVC: UIViewController {
} }
@IBAction func okAction(_ sender: Any) { @IBAction func okAction(_ sender: Any) {
dismiss(animated: true) navigationController?.popToRootViewController(animated: true)
} }
/* /*
// MARK: - Navigation // MARK: - Navigation
......
...@@ -35,8 +35,9 @@ class ViewController: UIViewController { ...@@ -35,8 +35,9 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
overrideUserInterfaceStyle = .light overrideUserInterfaceStyle = .light
UIApplication.shared.isIdleTimerDisabled = true
navigationController?.setNavigationBarHidden(true, animated: false)
updateUI() updateUI()
popupView.isHidden = true popupView.isHidden = true
if let flutterEngine = (UIApplication.shared.delegate as? AppDelegate)?.flutterEngine { if let flutterEngine = (UIApplication.shared.delegate as? AppDelegate)?.flutterEngine {
...@@ -49,7 +50,6 @@ class ViewController: UIViewController { ...@@ -49,7 +50,6 @@ class ViewController: UIViewController {
case "init": case "init":
result(strongSelf.vm.flutterArguments) result(strongSelf.vm.flutterArguments)
case "teachingEnd": case "teachingEnd":
strongSelf.presentedViewController?.dismiss(animated: true)
strongSelf.methodChannel?.invokeMethod("dispose", arguments: nil) strongSelf.methodChannel?.invokeMethod("dispose", arguments: nil)
// ["totalDuration": 3, "reasonText": Concern about my personal privacy, "status": incomplete, "incompleteReasonCode": 2] // ["totalDuration": 3, "reasonText": Concern about my personal privacy, "status": incomplete, "incompleteReasonCode": 2]
let argument: [String: Any] = try! JSONSerialization.jsonObject(with: (call.arguments as! String).data(using: .utf8)!) as! [String: Any] let argument: [String: Any] = try! JSONSerialization.jsonObject(with: (call.arguments as! String).data(using: .utf8)!) as! [String: Any]
...@@ -61,7 +61,9 @@ class ViewController: UIViewController { ...@@ -61,7 +61,9 @@ class ViewController: UIViewController {
// strongSelf.showError(reasonText) // strongSelf.showError(reasonText)
} else if status == "complete" { } else if status == "complete" {
strongSelf.toCompleteVC() strongSelf.toCompleteVC()
return
} }
strongSelf.navigationController?.popViewController(animated: true)
default: default:
// Unrecognized method name // Unrecognized method name
print("Unrecognized method name: \(call.method)") print("Unrecognized method name: \(call.method)")
...@@ -74,15 +76,14 @@ class ViewController: UIViewController { ...@@ -74,15 +76,14 @@ class ViewController: UIViewController {
func showError(_ text: String?) { func showError(_ text: String?) {
let alertVC = UIAlertController(title: text, message: nil, preferredStyle: .alert) let alertVC = UIAlertController(title: text, message: nil, preferredStyle: .alert)
alertVC.addAction(UIAlertAction(title: "OK", style: .cancel)) alertVC.addAction(UIAlertAction(title: "OK", style: .cancel))
present(alertVC, animated: true) navigationController?.pushViewController(alertVC, animated: true)
} }
func toCompleteVC() { func toCompleteVC() {
let sb = UIStoryboard(name: "Main", bundle: nil) let sb = UIStoryboard(name: "Main", bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: "CompleteVC") as! CompleteVC let vc = sb.instantiateViewController(withIdentifier: "CompleteVC") as! CompleteVC
vc.vm = vm vc.vm = vm
vc.modalPresentationStyle = .fullScreen navigationController?.pushViewController(vc, animated: true)
present(vc, animated: true)
} }
@IBAction func tapStart(_ sender: Any) { @IBAction func tapStart(_ sender: Any) {
...@@ -93,7 +94,7 @@ class ViewController: UIViewController { ...@@ -93,7 +94,7 @@ class ViewController: UIViewController {
if let flutterEngine = (UIApplication.shared.delegate as? AppDelegate)?.flutterEngine { if let flutterEngine = (UIApplication.shared.delegate as? AppDelegate)?.flutterEngine {
let scanVC = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil) let scanVC = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)
scanVC.modalPresentationStyle = .overFullScreen scanVC.modalPresentationStyle = .overFullScreen
present(scanVC, animated: true) navigationController?.pushViewController(scanVC, animated: true)
} }
} }
......
...@@ -18,9 +18,9 @@ platform :ios do ...@@ -18,9 +18,9 @@ platform :ios do
lane :ad do |options| lane :ad do |options|
desc = options[:desc] desc = options[:desc]
scheme = "BreastFeedingDemo" scheme = "BreastFeedingDemo"
currentTime = Time.new.strftime("%Y-%m-%d %H-%M-%S") currentTime = Time.new.strftime("%Y-%m-%d %H-%M")
output_path = "../BF_AiDemo #{currentTime}" output_path = "/Users/jay/Desktop/BF_AiDemo"
ipa_name = "BF_AiDemo" ipa_name = "BF_AiDemo_#{currentTime}"
increment_build_number increment_build_number
......
...@@ -5,22 +5,22 @@ ...@@ -5,22 +5,22 @@
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.001084"> <testcase classname="fastlane.lanes" name="0: default_platform" time="0.000444">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="1: increment_build_number" time="3.26359"> <testcase classname="fastlane.lanes" name="1: increment_build_number" time="2.444433">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="2: gym" time="311.298287"> <testcase classname="fastlane.lanes" name="2: gym" time="362.745079">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="3: pgyer" time="8.27252"> <testcase classname="fastlane.lanes" name="3: pgyer" time="7.050382">
</testcase> </testcase>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment