Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

iOS console : removed login button

William Balcaen894ab266b639
diff --git a/console/iOS/console/Base.lproj/Main.storyboard b/console/iOS/console/Base.lproj/Main.storyboard
index 414b38524..e7f91fec6 100644
--- a/console/iOS/console/Base.lproj/Main.storyboard
+++ b/console/iOS/console/Base.lproj/Main.storyboard
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="6Y8-7o-wPy">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@@ -12,6 +12,7 @@
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="console" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
@@ -20,27 +21,10 @@
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="umH-SD-HTu">
- <rect key="frame" x="164" y="99" width="46" height="30"/>
- <constraints>
- <constraint firstAttribute="width" constant="46" id="1xH-3I-upo"/>
- </constraints>
- <state key="normal" title="Login"/>
- <connections>
- <action selector="showLoginPage:" destination="BYZ-38-t0r" eventType="touchUpInside" id="tok-cl-Lid"/>
- </connections>
- </button>
- </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
- <constraints>
- <constraint firstItem="umH-SD-HTu" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="35" id="3F6-5u-bL5"/>
- <constraint firstItem="umH-SD-HTu" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="se7-gs-Skk"/>
- </constraints>
</view>
<navigationItem key="navigationItem" id="Mok-S7-Wng"/>
</viewController>
- <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1076" y="138.98050974512745"/>
</scene>
@@ -62,23 +46,5 @@
</objects>
<point key="canvasLocation" x="1757.5999999999999" y="112.89355322338831"/>
</scene>
- <!--Navigation Controller-->
- <scene sceneID="Ql9-8p-n0P">
- <objects>
- <navigationController automaticallyAdjustsScrollViewInsets="NO" id="6Y8-7o-wPy" sceneMemberID="viewController">
- <toolbarItems/>
- <navigationBar key="navigationBar" contentMode="scaleToFill" id="2ae-YH-aHz">
- <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
- <autoresizingMask key="autoresizingMask"/>
- </navigationBar>
- <nil name="viewControllers"/>
- <connections>
- <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="66U-lC-Mbh"/>
- </connections>
- </navigationController>
- <placeholder placeholderIdentifier="IBFirstResponder" id="CW0-vk-lhn" userLabel="First Responder" sceneMemberID="firstResponder"/>
- </objects>
- <point key="canvasLocation" x="136.80000000000001" y="-543.77811094452773"/>
- </scene>
</scenes>
</document>
diff --git a/console/iOS/console/ViewController.swift b/console/iOS/console/ViewController.swift
index 499e200f4..9ea97d4a8 100644
--- a/console/iOS/console/ViewController.swift
+++ b/console/iOS/console/ViewController.swift
@@ -18,21 +18,26 @@ class ViewController: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(isAuthenticated), name: notificationName, object: nil)
}
+ override func viewDidAppear(_ animated: Bool) {
+ super.viewDidAppear(animated)
+ showLoginPage()
+ }
+
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
- @IBAction func showLoginPage(_ sender: Any) {
+ func showLoginPage() {
if (TokenManager.sharedInstance.hasToken) {
let orVC = ORViewcontroller()
- self.navigationController?.pushViewController(orVC, animated: true)
+ self.present(orVC, animated: true, completion: nil)
} else {
TokenManager.sharedInstance.authenticate()
}
}
func isAuthenticated() {
- showLoginPage(self)
+ showLoginPage()
}
}