Skip to content

Commit

Permalink
#59 Address flow started
Browse files Browse the repository at this point in the history
  • Loading branch information
İzzet Öztürk committed Aug 3, 2018
1 parent 702b77a commit e3792fb
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 4 deletions.
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ target 'kimlic' do
pod 'Fabric'
pod 'Crashlytics'
pod 'CloudCore', '~> 2.0'
pod 'GooglePlaces', '~> 2.7'
end
10 changes: 9 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ PODS:
- DynamicBlurView (2.0.2)
- Fabric (1.7.7)
- FSPagerView (0.7.1)
- GoogleMaps/Base (2.7.0)
- GooglePlaces (2.7.0):
- GoogleMaps/Base (= 2.7.0)
- IQKeyboardManagerSwift (5.0.8)
- libsodium (1.0.12)
- NVActivityIndicatorView (4.2.1):
Expand Down Expand Up @@ -59,6 +62,7 @@ DEPENDENCIES:
- CryptoSwift
- Fabric
- FSPagerView (~> 0.7)
- GooglePlaces (~> 2.7)
- IQKeyboardManagerSwift (~> 5.0.6)
- NVActivityIndicatorView (~> 4.0)
- ObjectMapper (~> 3.0.0)
Expand All @@ -83,6 +87,8 @@ SPEC REPOS:
- DynamicBlurView
- Fabric
- FSPagerView
- GoogleMaps
- GooglePlaces
- IQKeyboardManagerSwift
- libsodium
- NVActivityIndicatorView
Expand Down Expand Up @@ -123,6 +129,8 @@ SPEC CHECKSUMS:
DynamicBlurView: aa6db4defc6e537eb86fc5e58dd3991666178399
Fabric: bda89e242bce1b7b8ab264248cf3407774ce0095
FSPagerView: 958aba39684e1573755ddcfcc29f7eebb8413cee
GoogleMaps: f79af95cb24d869457b1f961c93d3ce8b2f3b848
GooglePlaces: 3d06e6c99654545b4738ce49648745779c25f2ef
IQKeyboardManagerSwift: 2e7dc7f98c111458c1ea2b373f893e8cf95e2b97
libsodium: 9a8faa5ef2fa0d2d57bd7f7d79bf8fb7c1a9f0ea
NVActivityIndicatorView: 8068ba3ad39cb44cbaab25d89ff2546b3f092681
Expand All @@ -139,6 +147,6 @@ SPEC CHECKSUMS:
TextFieldEffects: 4ee41b5216e674d55fb6ac25107bf1af7629176f
web3swift: ac26245dc6921900992dd773bdf0ffc693855997

PODFILE CHECKSUM: 516f357c66f26ccfa3958814a8cb44cef43d5a60
PODFILE CHECKSUM: 41c47ae2d81b0782e84986ccea3b00da8d64b559

COCOAPODS: 1.5.3
27 changes: 27 additions & 0 deletions kimlic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
7C161A251FBDB526004FD9A0 /* Enums.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C161A241FBDB526004FD9A0 /* Enums.swift */; };
7C161A4B1FBDEA05004FD9A0 /* UITextFieldExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C161A4A1FBDEA05004FD9A0 /* UITextFieldExt.swift */; };
7C22A66C21142ECC00B1412A /* CloudCoreExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C22A66B21142ECC00B1412A /* CloudCoreExt.swift */; };
7C22A66F21149C0C00B1412A /* AddressVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C22A66E21149C0C00B1412A /* AddressVC.swift */; };
7C22A67121149C1600B1412A /* Address.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7C22A67021149C1600B1412A /* Address.storyboard */; };
7C2F326520C0301700AEB314 /* SignUp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7C2F326420C0301700AEB314 /* SignUp.storyboard */; };
7C2F326720C0303900AEB314 /* SignUpVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2F326620C0303900AEB314 /* SignUpVC.swift */; };
7C2F326920C0424700AEB314 /* TermsAndConditionsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2F326820C0424700AEB314 /* TermsAndConditionsVC.swift */; };
Expand Down Expand Up @@ -176,6 +178,8 @@
7C161A241FBDB526004FD9A0 /* Enums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Enums.swift; sourceTree = "<group>"; };
7C161A4A1FBDEA05004FD9A0 /* UITextFieldExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextFieldExt.swift; sourceTree = "<group>"; };
7C22A66B21142ECC00B1412A /* CloudCoreExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudCoreExt.swift; sourceTree = "<group>"; };
7C22A66E21149C0C00B1412A /* AddressVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressVC.swift; sourceTree = "<group>"; };
7C22A67021149C1600B1412A /* Address.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Address.storyboard; sourceTree = "<group>"; };
7C2F326420C0301700AEB314 /* SignUp.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SignUp.storyboard; sourceTree = "<group>"; };
7C2F326620C0303900AEB314 /* SignUpVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpVC.swift; sourceTree = "<group>"; };
7C2F326820C0424700AEB314 /* TermsAndConditionsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsAndConditionsVC.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -350,6 +354,8 @@
7C22A66D211451C500B1412A /* Address */ = {
isa = PBXGroup;
children = (
7C22A66E21149C0C00B1412A /* AddressVC.swift */,
7C22A67021149C1600B1412A /* Address.storyboard */,
);
path = Address;
sourceTree = "<group>";
Expand Down Expand Up @@ -729,6 +735,7 @@
7C48384C1FB5F62400FC864A /* Resources */,
DB2BEA7B75DD495A223EDDA9 /* [CP] Embed Pods Frameworks */,
1795117020EFEBEA0071772D /* Fabric */,
F7358560F25F86BA93C994CB /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -803,6 +810,7 @@
7C90C4B720C811BA006EEF87 /* TouchID.storyboard in Resources */,
7C8437EC20D2259400DD754D /* Muli-Regular.ttf in Resources */,
7C5FD1432110369800229CE8 /* QRCode.storyboard in Resources */,
7C22A67121149C1600B1412A /* Address.storyboard in Resources */,
7CA54B1F210EB942002555C7 /* VerifyID.storyboard in Resources */,
7CF655711FBAF19F00CA9C1A /* Localizable.strings in Resources */,
7C6FC84D20CE72EE0026AF1C /* Profile.storyboard in Resources */,
Expand Down Expand Up @@ -919,6 +927,24 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-kimlic/Pods-kimlic-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F7358560F25F86BA93C994CB /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-kimlic/Pods-kimlic-resources.sh",
"${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-kimlic/Pods-kimlic-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -998,6 +1024,7 @@
7C379AA31FB9DCF900D005CC /* SplashScreenVC.swift in Sources */,
79AF1D2F20C4BCD100CCA150 /* PinTextField.swift in Sources */,
7C99D6D11FC7FE3C00A593C5 /* PhoneResponse.swift in Sources */,
7C22A66F21149C0C00B1412A /* AddressVC.swift in Sources */,
0F359D8F1FC07EDD007E07DC /* Animz.swift in Sources */,
17D8B2A820FE293C00CEE289 /* ConfigWebServiceRequest.swift in Sources */,
7C85BC0520E625870000A4BA /* CustomPopupVC.swift in Sources */,
Expand Down
1 change: 1 addition & 0 deletions kimlic/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import IQKeyboardManagerSwift
import Fabric
import Crashlytics
import CoreData

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

Expand Down
2 changes: 1 addition & 1 deletion kimlic/Utils/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum PasscodePageType {

enum AppStoryboard : String {
// Must be the same as storyboard name
case SplashScreen, SignUp, Tutorial, TermsAndConditions, PhoneNumber, Verification, Message, TouchID, Passcode, QRCode,
case SplashScreen, SignUp, Tutorial, TermsAndConditions, PhoneNumber, Verification, Message, TouchID, Passcode, QRCode, Address,
MnemonicImport, MnemonicCreate, MnemonicVerification, Settings, UserEmail, Profile, UserInfo, ProfileCamera, VerifyIDDetail, VerifyID
var instance : UIStoryboard {
return UIStoryboard(name: self.rawValue, bundle: Bundle.main)
Expand Down
6 changes: 6 additions & 0 deletions kimlic/Utils/UIUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ public class UIUtils {
vc.navigationController?.pushViewController(tarVC, animated: true)
}

static func navigateToAddress(_ vc: UIViewController){
let storyboard = AppStoryboard.Address.instance
let tarVC = storyboard.instantiateViewController(withIdentifier: AddressVC.className) as! AddressVC
vc.navigationController?.pushViewController(tarVC, animated: true)
}

// Message = Constants > StaticMessage
static func navigateToMessage(_ vc: UIViewController, messageType: MessageType, message: Message? = nil){
let storyboard = AppStoryboard.Message.instance
Expand Down
42 changes: 42 additions & 0 deletions kimlic/View/Address/Address.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" 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="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--AddressVC-->
<scene sceneID="944-KF-dFD">
<objects>
<viewController storyboardIdentifier="AddressVC" id="OaL-xf-Qgx" customClass="AddressVC" customModule="kimlic" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="NIt-MV-gdf">
<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="ZRh-fl-tl6">
<rect key="frame" x="164" y="318" width="46" height="30"/>
<state key="normal" title="Button"/>
<connections>
<action selector="autocompleteClicked:" destination="OaL-xf-Qgx" eventType="touchUpInside" id="mK4-A7-DRB"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="ZRh-fl-tl6" firstAttribute="centerY" secondItem="NIt-MV-gdf" secondAttribute="centerY" id="cN6-Pk-kIR"/>
<constraint firstItem="ZRh-fl-tl6" firstAttribute="centerX" secondItem="NIt-MV-gdf" secondAttribute="centerX" id="x1i-V4-jtY"/>
</constraints>
<viewLayoutGuide key="safeArea" id="4zd-aw-gbp"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MFA-uL-aKU" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-287" y="107"/>
</scene>
</scenes>
</document>
58 changes: 58 additions & 0 deletions kimlic/View/Address/AddressVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// AddressVC.swift
// kimlic
//
// Created by İzzet Öztürk on 3.08.2018.
// Copyright © 2018 Kimlic. All rights reserved.
//

import UIKit
import GooglePlaces

class AddressVC: UIViewController {

let googlePlaceAPIKey = "AIzaSyAhJoblJTjmCVjLKVmBAf2APWEhiqkbJWc"

override func viewDidLoad() {
super.viewDidLoad()

GMSPlacesClient.provideAPIKey(googlePlaceAPIKey)
}

// Present the Autocomplete view controller when the button is pressed.
@IBAction func autocompleteClicked(_ sender: UIButton) {
let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self
present(autocompleteController, animated: true, completion: nil)
}

}

extension AddressVC: GMSAutocompleteViewControllerDelegate {

// Handle the user's selection.
func viewController(_ viewController: GMSAutocompleteViewController, didAutocompleteWith place: GMSPlace) {
print("Place name: \(place.name)")
dismiss(animated: true, completion: nil)
}

func viewController(_ viewController: GMSAutocompleteViewController, didFailAutocompleteWithError error: Error) {
// TODO: handle the error.
print("Error: ", error.localizedDescription)
}

// User canceled the operation.
func wasCancelled(_ viewController: GMSAutocompleteViewController) {
dismiss(animated: true, completion: nil)
}

// Turn the network activity indicator on and off again.
func didRequestAutocompletePredictions(_ viewController: GMSAutocompleteViewController) {
UIApplication.shared.isNetworkActivityIndicatorVisible = true
}

func didUpdateAutocompletePredictions(_ viewController: GMSAutocompleteViewController) {
UIApplication.shared.isNetworkActivityIndicatorVisible = false
}

}
5 changes: 3 additions & 2 deletions kimlic/View/SignUp/SignUpVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class SignUpVC: UIViewController {
// MARK: - IBActions

@IBAction func newIdentityButtonPressed(_ sender: Any) {
createQuorum()
UIUtils.navigateToTutorial(self)
// createQuorum()
// UIUtils.navigateToTutorial(self)
UIUtils.navigateToAddress(self)
}

@IBAction func recoverIdentityButtonPressed(_ sender: Any) {
Expand Down

0 comments on commit e3792fb

Please sign in to comment.