-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from RishabhTayal/add-tester
Add new tester
- Loading branch information
Showing
9 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ fastlane/report.xml | |
ReviewMonitor.app.dSYM.zip | ||
|
||
ReviewMonitor.ipa | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
ReviewMonitor/Testers View Controller/AddTesterViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// AddTesterViewController.swift | ||
// ReviewMonitor | ||
// | ||
// Created by Tayal, Rishabh on 1/9/18. | ||
// Copyright © 2018 Tayal, Rishabh. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import MBProgressHUD | ||
|
||
class AddTesterViewController: UIViewController { | ||
|
||
var app: App! | ||
|
||
@IBOutlet var firstNameTF: UITextField! | ||
@IBOutlet var lastNameTF: UITextField! | ||
@IBOutlet var emailTF: UITextField! | ||
|
||
init() { | ||
super.init(nibName: "AddTesterViewController", bundle: nil) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
title = "Add new tester" | ||
|
||
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelTapped(_:))) | ||
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save", style: .done, target: self, action: #selector(saveTapped(_:))) | ||
} | ||
|
||
@objc func cancelTapped(_ sender: Any) { | ||
dismiss(animated: true, completion: nil) | ||
} | ||
|
||
@objc func saveTapped(_ sender: Any) { | ||
MBProgressHUD.showAdded(to: view, animated: true) | ||
navigationItem.rightBarButtonItem?.isEnabled = false | ||
navigationItem.leftBarButtonItem?.isEnabled = false | ||
ServiceCaller.addNewTester(bundleId: app.bundleId, firstName: firstNameTF.text!, lastName: lastNameTF.text!, email: emailTF.text!) { result, error in | ||
DispatchQueue.main.async { | ||
self.navigationItem.rightBarButtonItem?.isEnabled = true | ||
self.navigationItem.leftBarButtonItem?.isEnabled = true | ||
MBProgressHUD.hide(for: self.view, animated: true) | ||
self.dismiss(animated: true, completion: nil) | ||
} | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
ReviewMonitor/Testers View Controller/AddTesterViewController.xib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AddTesterViewController" customModule="ReviewMonitor" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="emailTF" destination="5A7-pC-Doj" id="aya-0V-Q6I"/> | ||
<outlet property="firstNameTF" destination="TU7-Y6-Bqu" id="FVL-pt-hV7"/> | ||
<outlet property="lastNameTF" destination="MkI-1I-XBh" id="fMB-ks-yeo"/> | ||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> | ||
</connections> | ||
</placeholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="kvQ-El-cRP"> | ||
<rect key="frame" x="10" y="70" width="355" height="120"/> | ||
<subviews> | ||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="First Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TU7-Y6-Bqu"> | ||
<rect key="frame" x="0.0" y="0.0" width="355" height="30"/> | ||
<nil key="textColor"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no"/> | ||
</textField> | ||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Last Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="MkI-1I-XBh"> | ||
<rect key="frame" x="0.0" y="45" width="355" height="30"/> | ||
<nil key="textColor"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no"/> | ||
</textField> | ||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Email*" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5A7-pC-Doj"> | ||
<rect key="frame" x="0.0" y="90" width="355" height="30"/> | ||
<nil key="textColor"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="emailAddress" textContentType="email"/> | ||
</textField> | ||
</subviews> | ||
</stackView> | ||
</subviews> | ||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<constraints> | ||
<constraint firstItem="kvQ-El-cRP" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="8Cq-PP-qoq"/> | ||
<constraint firstItem="kvQ-El-cRP" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="10" id="YQ6-QR-1RT"/> | ||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="kvQ-El-cRP" secondAttribute="trailing" constant="10" id="xQI-Rw-Hcq"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> | ||
</view> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters