git.iko.soy/dashared/GDproject
on master help sign in
added user defaults for log in process. working on multiple entries and general channel
478eb78Darya Rednikina
GDproject.xcodeproj/project.pbxproj+31−11
@@ -7,9 +7,12 @@
7 objects = {
7 objects = {
8
8
9/* Begin PBXBuildFile section */
9/* Begin PBXBuildFile section */
10+ 123E37A5221F1B3200F6E42A /* LogInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123E37A4221F1B3200F6E42A /* LogInViewController.swift */; };
11+ 123E37A7221F1DD700F6E42A /* MainController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123E37A6221F1DD700F6E42A /* MainController.swift */; };
10 125BD57D22171D2A008A3575 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD57C22171D2A008A3575 /* ProfileViewController.swift */; };
12 125BD57D22171D2A008A3575 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD57C22171D2A008A3575 /* ProfileViewController.swift */; };
11 125BD57F22171D73008A3575 /* Extentions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD57E22171D73008A3575 /* Extentions.swift */; };
13 125BD57F22171D73008A3575 /* Extentions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD57E22171D73008A3575 /* Extentions.swift */; };
12 125BD5812217314A008A3575 /* NewsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD5802217314A008A3575 /* NewsVC.swift */; };
14 125BD5812217314A008A3575 /* NewsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125BD5802217314A008A3575 /* NewsVC.swift */; };
15+ 1288B5CE221F1158002BE6B1 /* DataStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1288B5CD221F1158002BE6B1 /* DataStorage.swift */; };
13 12D7D133221C321600B35452 /* ChannelListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D132221C321600B35452 /* ChannelListController.swift */; };
16 12D7D133221C321600B35452 /* ChannelListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D132221C321600B35452 /* ChannelListController.swift */; };
14 12D7D135221C42B700B35452 /* ChannelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D134221C42B700B35452 /* ChannelController.swift */; };
17 12D7D135221C42B700B35452 /* ChannelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D134221C42B700B35452 /* ChannelController.swift */; };
15 12D7D137221D78E800B35452 /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D136221D78E800B35452 /* Channel.swift */; };
18 12D7D137221D78E800B35452 /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D7D136221D78E800B35452 /* Channel.swift */; };
@@ -61,9 +64,12 @@
61/* End PBXCopyFilesBuildPhase section */
64/* End PBXCopyFilesBuildPhase section */
62
65
63/* Begin PBXFileReference section */
66/* Begin PBXFileReference section */
67+ 123E37A4221F1B3200F6E42A /* LogInViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogInViewController.swift; sourceTree = "<group>"; };
68+ 123E37A6221F1DD700F6E42A /* MainController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainController.swift; sourceTree = "<group>"; };
64 125BD57C22171D2A008A3575 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
69 125BD57C22171D2A008A3575 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
65 125BD57E22171D73008A3575 /* Extentions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extentions.swift; sourceTree = "<group>"; };
70 125BD57E22171D73008A3575 /* Extentions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extentions.swift; sourceTree = "<group>"; };
66 125BD5802217314A008A3575 /* NewsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsVC.swift; sourceTree = "<group>"; };
71 125BD5802217314A008A3575 /* NewsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsVC.swift; sourceTree = "<group>"; };
72+ 1288B5CD221F1158002BE6B1 /* DataStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataStorage.swift; sourceTree = "<group>"; };
67 12D7D132221C321600B35452 /* ChannelListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelListController.swift; sourceTree = "<group>"; };
73 12D7D132221C321600B35452 /* ChannelListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelListController.swift; sourceTree = "<group>"; };
68 12D7D134221C42B700B35452 /* ChannelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelController.swift; sourceTree = "<group>"; };
74 12D7D134221C42B700B35452 /* ChannelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelController.swift; sourceTree = "<group>"; };
69 12D7D136221D78E800B35452 /* Channel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = "<group>"; };
75 12D7D136221D78E800B35452 /* Channel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = "<group>"; };
@@ -109,6 +115,19 @@
109/* End PBXFrameworksBuildPhase section */
115/* End PBXFrameworksBuildPhase section */
110
116
111/* Begin PBXGroup section */
117/* Begin PBXGroup section */
118+ 1288B5CC221F0EFE002BE6B1 /* Profile */ = {
119+ isa = PBXGroup;
120+ children = (
121+ 125BD57C22171D2A008A3575 /* ProfileViewController.swift */,
122+ 12DB7FDE221877160096878E /* InviteViewController.swift */,
123+ 12DB7FDC221872F80096878E /* SettingsViewController.swift */,
124+ 12DB7FD622181CD20096878E /* BasicInfoController.swift */,
125+ 12DB7FDA2218590C0096878E /* InfoCell.swift */,
126+ 12DB7FD822181E660096878E /* BasicInfoCell.swift */,
127+ );
128+ path = Profile;
129+ sourceTree = "<group>";
130+ };
112 12E36D8F221424EA006FCDD7 = {
131 12E36D8F221424EA006FCDD7 = {
113 isa = PBXGroup;
132 isa = PBXGroup;
114 children = (
133 children = (
@@ -134,6 +153,8 @@
134 12E36D9A221424EA006FCDD7 /* GDproject */ = {
153 12E36D9A221424EA006FCDD7 /* GDproject */ = {
135 isa = PBXGroup;
154 isa = PBXGroup;
136 children = (
155 children = (
156+ 1288B5CD221F1158002BE6B1 /* DataStorage.swift */,
157+ 123E37A6221F1DD700F6E42A /* MainController.swift */,
137 12E36DCF22145923006FCDD7 /* Controller */,
158 12E36DCF22145923006FCDD7 /* Controller */,
138 12E36DCD22144756006FCDD7 /* Constants.swift */,
159 12E36DCD22144756006FCDD7 /* Constants.swift */,
139 125BD57E22171D73008A3575 /* Extentions.swift */,
160 125BD57E22171D73008A3575 /* Extentions.swift */,
@@ -169,29 +190,25 @@
169 12E36DCF22145923006FCDD7 /* Controller */ = {
190 12E36DCF22145923006FCDD7 /* Controller */ = {
170 isa = PBXGroup;
191 isa = PBXGroup;
171 children = (
192 children = (
172− 12D7D134221C42B700B35452 /* ChannelController.swift */,
193+ 123E37A4221F1B3200F6E42A /* LogInViewController.swift */,
173− 12D7D132221C321600B35452 /* ChannelListController.swift */,
194+ 1288B5CC221F0EFE002BE6B1 /* Profile */,
174− 125BD57C22171D2A008A3575 /* ProfileViewController.swift */,
175− 12DB7FDE221877160096878E /* InviteViewController.swift */,
176− 12DB7FDC221872F80096878E /* SettingsViewController.swift */,
177− 12DB7FD622181CD20096878E /* BasicInfoController.swift */,
178− 12DB7FDA2218590C0096878E /* InfoCell.swift */,
179− 12DB7FD822181E660096878E /* BasicInfoCell.swift */,
180− 12E36DD322156519006FCDD7 /* News */,
195+ 12E36DD322156519006FCDD7 /* News and channels */,
181 );
196 );
182 path = Controller;
197 path = Controller;
183 sourceTree = "<group>";
198 sourceTree = "<group>";
184 };
199 };
185− 12E36DD322156519006FCDD7 /* News */ = {
200+ 12E36DD322156519006FCDD7 /* News and channels */ = {
186 isa = PBXGroup;
201 isa = PBXGroup;
187 children = (
202 children = (
203+ 12D7D134221C42B700B35452 /* ChannelController.swift */,
204+ 12D7D132221C321600B35452 /* ChannelListController.swift */,
188 12E36DC922144635006FCDD7 /* NewPostViewController.swift */,
205 12E36DC922144635006FCDD7 /* NewPostViewController.swift */,
189 12E36DD022148122006FCDD7 /* FullPostController.swift */,
206 12E36DD022148122006FCDD7 /* FullPostController.swift */,
190 12E36D9D221424EA006FCDD7 /* NewsController.swift */,
207 12E36D9D221424EA006FCDD7 /* NewsController.swift */,
191 125BD5802217314A008A3575 /* NewsVC.swift */,
208 125BD5802217314A008A3575 /* NewsVC.swift */,
192 12E36DCB22144725006FCDD7 /* PostViewCell.swift */,
209 12E36DCB22144725006FCDD7 /* PostViewCell.swift */,
193 );
210 );
194− path = News;
211+ path = " News and channels";
195 sourceTree = "<group>";
212 sourceTree = "<group>";
196 };
213 };
197 12E36DDA221594B1006FCDD7 /* Frameworks */ = {
214 12E36DDA221594B1006FCDD7 /* Frameworks */ = {
@@ -282,9 +299,11 @@
282 12E36DCA22144635006FCDD7 /* NewPostViewController.swift in Sources */,
299 12E36DCA22144635006FCDD7 /* NewPostViewController.swift in Sources */,
283 12E36D9E221424EA006FCDD7 /* NewsController.swift in Sources */,
300 12E36D9E221424EA006FCDD7 /* NewsController.swift in Sources */,
284 12E36DCC22144725006FCDD7 /* PostViewCell.swift in Sources */,
301 12E36DCC22144725006FCDD7 /* PostViewCell.swift in Sources */,
302+ 123E37A5221F1B3200F6E42A /* LogInViewController.swift in Sources */,
285 125BD57F22171D73008A3575 /* Extentions.swift in Sources */,
303 125BD57F22171D73008A3575 /* Extentions.swift in Sources */,
286 12D7D133221C321600B35452 /* ChannelListController.swift in Sources */,
304 12D7D133221C321600B35452 /* ChannelListController.swift in Sources */,
287 12E36DD122148122006FCDD7 /* FullPostController.swift in Sources */,
305 12E36DD122148122006FCDD7 /* FullPostController.swift in Sources */,
306+ 1288B5CE221F1158002BE6B1 /* DataStorage.swift in Sources */,
288 125BD57D22171D2A008A3575 /* ProfileViewController.swift in Sources */,
307 125BD57D22171D2A008A3575 /* ProfileViewController.swift in Sources */,
289 12DB7FDB2218590C0096878E /* InfoCell.swift in Sources */,
308 12DB7FDB2218590C0096878E /* InfoCell.swift in Sources */,
290 12DB7FD922181E660096878E /* BasicInfoCell.swift in Sources */,
309 12DB7FD922181E660096878E /* BasicInfoCell.swift in Sources */,
@@ -293,6 +312,7 @@
293 12DB7FD722181CD20096878E /* BasicInfoController.swift in Sources */,
312 12DB7FD722181CD20096878E /* BasicInfoController.swift in Sources */,
294 12E36DCE22144756006FCDD7 /* Constants.swift in Sources */,
313 12E36DCE22144756006FCDD7 /* Constants.swift in Sources */,
295 12DB7FDD221872F80096878E /* SettingsViewController.swift in Sources */,
314 12DB7FDD221872F80096878E /* SettingsViewController.swift in Sources */,
315+ 123E37A7221F1DD700F6E42A /* MainController.swift in Sources */,
296 );
316 );
297 runOnlyForDeploymentPostprocessing = 0;
317 runOnlyForDeploymentPostprocessing = 0;
298 };
318 };
GDproject/Base.lproj/Main.storyboard+44−1
@@ -392,6 +392,49 @@
392 </objects>
392 </objects>
393 <point key="canvasLocation" x="3444" y="129.98500749625188"/>
393 <point key="canvasLocation" x="3444" y="129.98500749625188"/>
394 </scene>
394 </scene>
395+ <!--Log In View Controller-->
396+ <scene sceneID="Pkd-pB-bQs">
397+ <objects>
398+ <viewController storyboardIdentifier="LogInController" id="ZCz-70-hDh" customClass="LogInViewController" customModule="GDproject" customModuleProvider="target" sceneMemberID="viewController">
399+ <view key="view" contentMode="scaleToFill" id="1q2-4g-KZs">
400+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
401+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
402+ <subviews>
403+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="UwC-m5-jA5">
404+ <rect key="frame" x="16" y="100" width="343" height="83"/>
405+ <subviews>
406+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Log In" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="efn-ze-jca">
407+ <rect key="frame" x="0.0" y="0.0" width="343" height="41"/>
408+ <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
409+ <nil key="textColor"/>
410+ <nil key="highlightedColor"/>
411+ </label>
412+ <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Mail" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mFP-WG-jY5">
413+ <rect key="frame" x="0.0" y="53" width="343" height="30"/>
414+ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
415+ <nil key="textColor"/>
416+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
417+ <textInputTraits key="textInputTraits"/>
418+ </textField>
419+ </subviews>
420+ </stackView>
421+ </subviews>
422+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
423+ <constraints>
424+ <constraint firstItem="UwC-m5-jA5" firstAttribute="leading" secondItem="LOR-Yw-0FU" secondAttribute="leading" constant="16" id="M6z-nU-H40"/>
425+ <constraint firstItem="LOR-Yw-0FU" firstAttribute="trailing" secondItem="UwC-m5-jA5" secondAttribute="trailing" constant="16" id="jST-rr-MMX"/>
426+ <constraint firstItem="UwC-m5-jA5" firstAttribute="top" secondItem="LOR-Yw-0FU" secondAttribute="top" constant="80" id="rvy-Ii-bwS"/>
427+ </constraints>
428+ <viewLayoutGuide key="safeArea" id="LOR-Yw-0FU"/>
429+ </view>
430+ <connections>
431+ <outlet property="mailTextField" destination="mFP-WG-jY5" id="7SN-qe-DDm"/>
432+ </connections>
433+ </viewController>
434+ <placeholder placeholderIdentifier="IBFirstResponder" id="6e8-oo-bbc" userLabel="First Responder" sceneMemberID="firstResponder"/>
435+ </objects>
436+ <point key="canvasLocation" x="-466" y="-821"/>
437+ </scene>
395 <!--Posts-->
438 <!--Posts-->
396 <scene sceneID="RSd-UJ-34B">
439 <scene sceneID="RSd-UJ-34B">
397 <objects>
440 <objects>
@@ -433,7 +476,7 @@
433 <!--Tab Bar Controller-->
476 <!--Tab Bar Controller-->
434 <scene sceneID="HCR-WO-p7g">
477 <scene sceneID="HCR-WO-p7g">
435 <objects>
478 <objects>
436− <tabBarController automaticallyAdjustsScrollViewInsets="NO" id="IeP-4W-8LT" sceneMemberID="viewController">
479+ <tabBarController storyboardIdentifier="TabBar" automaticallyAdjustsScrollViewInsets="NO" id="IeP-4W-8LT" sceneMemberID="viewController">
437 <toolbarItems/>
480 <toolbarItems/>
438 <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="3pl-mU-U30">
481 <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="3pl-mU-U30">
439 <rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
482 <rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
GDproject/Constants.swift+16−3
@@ -6,25 +6,38 @@
6// Copyright © 2019 drHSE. All rights reserved.
6// Copyright © 2019 drHSE. All rights reserved.
7//
7//
8
8
9−//constant for cell in posts NewsController.swift
9+/// constant for cell in posts NewsController.swift
10let postCellId = "PostCell"
10let postCellId = "PostCell"
11+
11−// constant for segmented controll in NewsController.swift and ChannelsController.swift
12+/// constant for segmented controll in NewsController.swift and ChannelsController.swift
12let headerNewsChannelsVC = "HeaderSegmentedControll"
13let headerNewsChannelsVC = "HeaderSegmentedControll"
14+
13−// for transitioning to full post view
15+/// for transitioning to full post view
14let fullPostControllerId = "FullPostController"
16let fullPostControllerId = "FullPostController"
15
17
18+/// constant for dequing basic cell
16let basicInfoCellId = "BasicInfoCell"
19let basicInfoCellId = "BasicInfoCell"
17
20
21+/// constant for dequing info cell
18let infoCellId = "InfoCell"
22let infoCellId = "InfoCell"
19
23
24+/// constant for switching to view controller for invitations
20let inviteVC = "InviteViewController"
25let inviteVC = "InviteViewController"
21
26
27+/// constant for dequing basic cell
22let channelCellId = "ChannelCell"
28let channelCellId = "ChannelCell"
23
29
30+/// constant for switching to channel list view controller for choosing channel
24let channelListControllerId = "ChannelListController"
31let channelListControllerId = "ChannelListController"
25
32
33+/// constant for dequing channel item cell
26let itemCellId = "ItemCell"
34let itemCellId = "ItemCell"
27
35
36+/// constant for switching to view controller to add or edit one channel
28let channelControllerId = "ChannelController"
37let channelControllerId = "ChannelController"
29
38
39+/// constant for switching to news controller
30let newsController = "NewsController"
40let newsController = "NewsController"
41+
42+/// constant for switching to view controller for log in app
43+let logInController = "LogInController"
GDproject/Controller/ChannelController.swift → GDproject/Controller/ News and channels/ChannelController.swiftrenamed

The content is the same.

GDproject/Controller/ChannelListController.swift → GDproject/Controller/ News and channels/ChannelListController.swiftrenamed+2
@@ -21,6 +21,8 @@ class ChannelListController: UITableViewController, DataDelegate {
21 var filteredDataSource = [Channel]()
21 var filteredDataSource = [Channel]()
22 var myProtocol: DataDelegate?
22 var myProtocol: DataDelegate?
23
23
24+ var generalChannel: Channel = Channel(title: "General", subtitle: "All posts", hashtags: ["All"], people: ["All"], posts: [])
25+
24 var isFiltering: Bool {
26 var isFiltering: Bool {
25 return searchController.isActive && !searchBarIsEmpty()
27 return searchController.isActive && !searchBarIsEmpty()
26 }
28 }
GDproject/Controller/News/FullPostController.swift → GDproject/Controller/ News and channels/FullPostController.swiftrenamed

The content is the same.

GDproject/Controller/News/NewPostViewController.swift → GDproject/Controller/ News and channels/NewPostViewController.swiftrenamed

The content is the same.

GDproject/Controller/News/NewsController.swift → GDproject/Controller/ News and channels/NewsController.swiftrenamed

The content is the same.

GDproject/Controller/News/NewsVC.swift → GDproject/Controller/ News and channels/NewsVC.swiftrenamed

The content is the same.

GDproject/Controller/News/PostViewCell.swift → GDproject/Controller/ News and channels/PostViewCell.swiftrenamed

The content is the same.

GDproject/Controller/LogInViewController.swiftnew file+138
@@ -0,0 +1,138 @@
1+//
2+// LogInViewController.swift
3+// NewsFeed
4+//
5+// Created by cstore on 20/01/2019.
6+// Copyright © 2019 drHSE. All rights reserved.
7+//
8+
9+import UIKit
10+
11+class LogInViewController: UIViewController {
12+
13+ @IBOutlet weak var mailTextField: UITextField!
14+
15+ static let titleColor = UIColor(red: 0, green: 137/255, blue: 249/255, alpha: 0.5)
16+
17+ var bottomConstraint: NSLayoutConstraint?
18+
19+ let logInButton: UIButton = {
20+ let button = UIButton(type: .system)
21+ button.setTitle("Log In", for: .normal)
22+ button.setTitleColor(titleColor, for: .normal)
23+ button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
24+ button.isEnabled = false
25+ button.addTarget(self, action: #selector(activateLogInProcess), for: .touchUpInside)
26+ return button
27+ }()
28+
29+ let keyboardBar: UIView = {
30+ let view = UIView()
31+ view.backgroundColor = .white
32+ return view
33+ }()
34+
35+ override func viewDidLoad() {
36+ super.viewDidLoad()
37+ setUpView()
38+ configureTapgesture()
39+ }
40+
41+ override func viewWillAppear(_ animated: Bool) {
42+ super.viewWillAppear(animated)
43+ // MARK:- uncomment when mail registration will be availiable
44+ //self.navigationController?.setNavigationBarHidden(true, animated: animated)
45+ }
46+
47+ override func viewWillDisappear(_ animated: Bool) {
48+ super.viewWillDisappear(animated)
49+ // MARK:- uncomment when mail registration will be availiable
50+ //self.navigationController?.setNavigationBarHidden(false, animated: animated)
51+ }
52+
53+ private func configureTapgesture(){
54+ let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap))
55+ view.addGestureRecognizer(tapGesture)
56+ }
57+
58+ @objc func handleTap(){
59+ view.endEditing(true)
60+ }
61+
62+ @objc func activateLogInProcess(){
63+ if logInButton.isEnabled {
64+ // MARK:- when log in is succeeded do I need to go there?
65+ let vc = storyboard!.instantiateViewController(withIdentifier: newsController) as! NewsController
66+ present(vc, animated: true) {
67+ print("logged in")
68+ }
69+ DataStorage.standard.setIsLoggedIn(value: true)
70+ view.endEditing(true)
71+ }
72+ }
73+
74+ func setUpView(){
75+ mailTextField.delegate = self
76+ view.addSubview(keyboardBar)
77+
78+ view.addConstraintsWithFormat(format: "H:|[v0]|", views: keyboardBar)
79+ view.addConstraintsWithFormat(format: "V:[v0(50)]", views: keyboardBar)
80+
81+ setUpBarComponents()
82+
83+ bottomConstraint = NSLayoutConstraint(item: keyboardBar, attribute: .bottom, relatedBy: .equal, toItem: view.safeAreaLayoutGuide, attribute: .bottom, multiplier: 1, constant: 0)
84+ view.addConstraint(bottomConstraint!)
85+
86+ // for keyboard notifications
87+ NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotifications), name: UIResponder.keyboardWillShowNotification, object: nil)
88+
89+ NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotifications), name: UIResponder.keyboardWillHideNotification, object: nil)
90+
91+ // for log in button notifications
92+ NotificationCenter.default.addObserver(self, selector: #selector(inputDidChanged), name: UITextField.textDidChangeNotification, object: mailTextField)
93+
94+ NotificationCenter.default.addObserver(self, selector: #selector(inputDidChanged), name: UITextField.textDidBeginEditingNotification, object: mailTextField)
95+ }
96+
97+ @objc func inputDidChanged(notification: NSNotification){
98+ if mailTextField.text?.isEmpty ?? true
99+ {
100+ logInButton.isEnabled = false
101+ logInButton.setTitleColor(LogInViewController.titleColor.withAlphaComponent(0.5), for: .normal)
102+ }
103+ else
104+ {
105+ logInButton.isEnabled = true
106+ logInButton.setTitleColor(LogInViewController.titleColor.withAlphaComponent(1), for: .normal)
107+ }
108+ }
109+
110+ @objc func handleKeyboardNotifications(notification: NSNotification){
111+ if let userInfo = notification.userInfo{
112+ // UIKeyboardFrameEndUserInfoKey
113+ let keyBoardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
114+ bottomConstraint?.constant = notification.name == UIResponder.keyboardWillShowNotification ? -keyBoardFrame.height+view.safeAreaInsets.bottom : 0
115+
116+ UIView.animate(withDuration: 0, delay: 0, options: .curveEaseOut, animations: {
117+ self.view.layoutIfNeeded()
118+ }) { (completed) in
119+
120+ }
121+ }
122+ }
123+
124+ func setUpBarComponents(){
125+ keyboardBar.addSubview(logInButton)
126+ keyboardBar.addConstraintsWithFormat(format: "H:[v0(60)]-16-|", views: logInButton)
127+ keyboardBar.addConstraintsWithFormat(format: "V:|[v0]|", views: logInButton)
128+ }
129+}
130+
131+
132+extension LogInViewController: UITextFieldDelegate{
133+ func textFieldShouldReturn(_ textField: UITextField) -> Bool
134+ {
135+ textField.resignFirstResponder()
136+ return true
137+ }
138+}
GDproject/Controller/BasicInfoCell.swift → GDproject/Controller/Profile/BasicInfoCell.swiftrenamed

The content is the same.

GDproject/Controller/BasicInfoController.swift → GDproject/Controller/Profile/BasicInfoController.swiftrenamed

The content is the same.

GDproject/Controller/InfoCell.swift → GDproject/Controller/Profile/InfoCell.swiftrenamed

The content is the same.

GDproject/Controller/InviteViewController.swift → GDproject/Controller/Profile/InviteViewController.swiftrenamed

The content is the same.

GDproject/Controller/ProfileViewController.swift → GDproject/Controller/Profile/ProfileViewController.swiftrenamed

The content is the same.

GDproject/Controller/SettingsViewController.swift → GDproject/Controller/Profile/SettingsViewController.swiftrenamed

The content is the same.

GDproject/DataStorage.swiftnew file+45
@@ -0,0 +1,45 @@
1+//
2+// DataStorage.swift
3+// GDproject
4+//
5+// Created by cstore on 21/02/2019.
6+// Copyright © 2019 drHSE. All rights reserved.
7+//
8+
9+import Foundation
10+
11+/**
12+ _DataStorage_ class is aimed to store user private settings
13+ to display correct data after user leaving the app
14+ */
15+class DataStorage{
16+
17+ private init(){}
18+
19+ static let standard = DataStorage()
20+
21+ // add channel
22+
23+ // delete channel
24+
25+ /**
26+ Function for setting log in status of user
27+ */
28+ func setIsLoggedIn(value: Bool){
29+ UserDefaults.standard.set(value, forKey: UserDefaultsKeys.loggedIn.rawValue)
30+ }
31+
32+ /**
33+ Function to determine is user logged in already or not
34+ */
35+ func isLoggedIn() -> Bool {
36+ return UserDefaults.standard.bool(forKey: UserDefaultsKeys.loggedIn.rawValue)
37+ }
38+}
39+
40+/**
41+ Enum to store UserDefaults keys for getting and setting values
42+ */
43+enum UserDefaultsKeys: String{
44+ case loggedIn
45+}
GDproject/MainController.swiftnew file+44
@@ -0,0 +1,44 @@
1+//
2+// MainController.swift
3+// GDproject
4+//
5+// Created by cstore on 21/02/2019.
6+// Copyright © 2019 drHSE. All rights reserved.
7+//
8+
9+import UIKit
10+
11+class MainController: UINavigationController {
12+
13+ override func viewDidLoad() {
14+ super.viewDidLoad()
15+
16+// if false {
17+// perform(#selector(showLogInController), with: nil, afterDelay: 0.01)
18+// } else {
19+// perform(#selector(fhfh), with: nil, afterDelay: 0.01)
20+//
21+// }
22+ }
23+
24+// @objc func showLogInController(){
25+// let vc = storyboard!.instantiateViewController(withIdentifier: logInController) as! LogInViewController
26+// present(vc, animated: true) {
27+// print("opportunity to log in")
28+// }
29+// }
30+
31+// @objc func fhfh(){
32+//
33+// let newsController = NC()
34+// viewControllers = [newsController]
35+// }
36+// override func viewDidAppear(_ animated: Bool) {
37+// super.viewDidAppear(animated)
38+//
39+//
40+// }
41+}
42+
43+
44+
GDproject/Supporting files/AppDelegate.swift+3−2
@@ -16,6 +16,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
16
16
17 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 // Override point for customization after application launch.
18 // Override point for customization after application launch.
19+// window = UIWindow(frame: UIScreen.main.bounds)
20+// window?.makeKeyAndVisible()
21+// window?.rootViewController = MainController()
19 return true
22 return true
20 }
23 }
21
24
@@ -40,7 +43,5 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
40 func applicationWillTerminate(_ application: UIApplication) {
43 func applicationWillTerminate(_ application: UIApplication) {
41 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 }
45 }
43−
44−
45}
46}
46
47
GDproject/Supporting files/Base.lproj/LaunchScreen.storyboard+7−3
@@ -1,7 +1,11 @@
1−<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1+<?xml version="1.0" encoding="UTF-8"?>
2−<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+ <device id="retina4_7" orientation="portrait">
4+ <adaptation id="fullscreen"/>
5+ </device>
3 <dependencies>
6 <dependencies>
7+ <deployment identifier="iOS"/>
4− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
8+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
5 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
9 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
6 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7 </dependencies>
11 </dependencies>