git.iko.soy/dashared/GDproject
on master help sign in
a lot of changes: still trying to embed coordinators. slowly modfiying channels. added empty card for editing channel
32e1d26Darya Rednikina
Cartfile+2−2
@@ -2,7 +2,7 @@ github "robb/Cartography"
2github "ivanbruel/MarkdownKit"
2github "ivanbruel/MarkdownKit"
3github "roberthein/TinyConstraints"
3github "roberthein/TinyConstraints"
4github "macteo/Marklight"
4github "macteo/Marklight"
5−github "ElaWorkshop/TagListView"
6github "Alamofire/Alamofire" "5.0.0-beta.2"
5github "Alamofire/Alamofire" "5.0.0-beta.2"
7github "whitesmith/WSTagsField"
6github "whitesmith/WSTagsField"
8−github "ReactiveCocoa/ReactiveCocoa" ~> 8.0
7+github "ReactiveCocoa/ReactiveCocoa" ~> 8.0
8+github "52inc/Pulley"
GDproject.xcodeproj/project.pbxproj+6
@@ -63,6 +63,8 @@
63 12F3D6BE2241130000A69214 /* Result.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B7224112E800A69214 /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
63 12F3D6BE2241130000A69214 /* Result.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B7224112E800A69214 /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
64 12F3D6C02241130200A69214 /* ReactiveSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
64 12F3D6C02241130200A69214 /* ReactiveSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
65 12F3D6C22241130400A69214 /* ReactiveMapKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B3224112D600A69214 /* ReactiveMapKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
65 12F3D6C22241130400A69214 /* ReactiveMapKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6B3224112D600A69214 /* ReactiveMapKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
66+ 12F3D6C92242645800A69214 /* Pulley.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6C72242644D00A69214 /* Pulley.framework */; };
67+ 12F3D6CA2242645800A69214 /* Pulley.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12F3D6C72242644D00A69214 /* Pulley.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
66/* End PBXBuildFile section */
68/* End PBXBuildFile section */
67
69
68/* Begin PBXCopyFilesBuildPhase section */
70/* Begin PBXCopyFilesBuildPhase section */
@@ -81,6 +83,7 @@
81 12F3D6C02241130200A69214 /* ReactiveSwift.framework in Embed Frameworks */,
83 12F3D6C02241130200A69214 /* ReactiveSwift.framework in Embed Frameworks */,
82 12F3D6BC224112FD00A69214 /* ReactiveCocoa.framework in Embed Frameworks */,
84 12F3D6BC224112FD00A69214 /* ReactiveCocoa.framework in Embed Frameworks */,
83 123AD0E5223C1C4300326173 /* WSTagsField.framework in Embed Frameworks */,
85 123AD0E5223C1C4300326173 /* WSTagsField.framework in Embed Frameworks */,
86+ 12F3D6CA2242645800A69214 /* Pulley.framework in Embed Frameworks */,
84 12E36DC2221441E1006FCDD7 /* MarkdownKit.framework in Embed Frameworks */,
87 12E36DC2221441E1006FCDD7 /* MarkdownKit.framework in Embed Frameworks */,
85 );
88 );
86 name = "Embed Frameworks";
89 name = "Embed Frameworks";
@@ -137,6 +140,7 @@
137 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveSwift.framework; path = Carthage/Build/iOS/ReactiveSwift.framework; sourceTree = "<group>"; };
140 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveSwift.framework; path = Carthage/Build/iOS/ReactiveSwift.framework; sourceTree = "<group>"; };
138 12F3D6B7224112E800A69214 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = "<group>"; };
141 12F3D6B7224112E800A69214 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = "<group>"; };
139 12F3D6B9224112F500A69214 /* ReactiveCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveCocoa.framework; path = Carthage/Build/iOS/ReactiveCocoa.framework; sourceTree = "<group>"; };
142 12F3D6B9224112F500A69214 /* ReactiveCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveCocoa.framework; path = Carthage/Build/iOS/ReactiveCocoa.framework; sourceTree = "<group>"; };
143+ 12F3D6C72242644D00A69214 /* Pulley.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pulley.framework; path = Carthage/Build/iOS/Pulley.framework; sourceTree = "<group>"; };
140/* End PBXFileReference section */
144/* End PBXFileReference section */
141
145
142/* Begin PBXFrameworksBuildPhase section */
146/* Begin PBXFrameworksBuildPhase section */
@@ -147,6 +151,7 @@
147 12E36DB522143D54006FCDD7 /* TinyConstraints.framework in Frameworks */,
151 12E36DB522143D54006FCDD7 /* TinyConstraints.framework in Frameworks */,
148 12F3D6B4224112D600A69214 /* ReactiveMapKit.framework in Frameworks */,
152 12F3D6B4224112D600A69214 /* ReactiveMapKit.framework in Frameworks */,
149 124CC7052221C2BB009DF531 /* Alamofire.framework in Frameworks */,
153 124CC7052221C2BB009DF531 /* Alamofire.framework in Frameworks */,
154+ 12F3D6C92242645800A69214 /* Pulley.framework in Frameworks */,
150 12F3D6BB224112FD00A69214 /* ReactiveCocoa.framework in Frameworks */,
155 12F3D6BB224112FD00A69214 /* ReactiveCocoa.framework in Frameworks */,
151 12F3D6B8224112E900A69214 /* Result.framework in Frameworks */,
156 12F3D6B8224112E900A69214 /* Result.framework in Frameworks */,
152 12F3D6B6224112E100A69214 /* ReactiveSwift.framework in Frameworks */,
157 12F3D6B6224112E100A69214 /* ReactiveSwift.framework in Frameworks */,
@@ -199,6 +204,7 @@
199 12E36D8F221424EA006FCDD7 = {
204 12E36D8F221424EA006FCDD7 = {
200 isa = PBXGroup;
205 isa = PBXGroup;
201 children = (
206 children = (
207+ 12F3D6C72242644D00A69214 /* Pulley.framework */,
202 12F3D6B9224112F500A69214 /* ReactiveCocoa.framework */,
208 12F3D6B9224112F500A69214 /* ReactiveCocoa.framework */,
203 12F3D6B7224112E800A69214 /* Result.framework */,
209 12F3D6B7224112E800A69214 /* Result.framework */,
204 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */,
210 12F3D6B5224112E000A69214 /* ReactiveSwift.framework */,
GDproject/Base.lproj/Main.storyboard+82−20
@@ -416,6 +416,45 @@
416 </objects>
416 </objects>
417 <point key="canvasLocation" x="3444" y="129.98500749625188"/>
417 <point key="canvasLocation" x="3444" y="129.98500749625188"/>
418 </scene>
418 </scene>
419+ <!--Pulley View Controller-->
420+ <scene sceneID="cBw-kf-fO5">
421+ <objects>
422+ <viewController id="IbM-Ix-dsI" customClass="PulleyViewController" customModule="Pulley" sceneMemberID="viewController">
423+ <view key="view" contentMode="scaleToFill" id="hBO-ys-jBX">
424+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
425+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
426+ <subviews>
427+ <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JAV-ei-FE9">
428+ <rect key="frame" x="0.0" y="343.5" width="375" height="323.5"/>
429+ <connections>
430+ <segue destination="gBC-pa-4Y8" kind="embed" id="e5o-yX-vfJ"/>
431+ </connections>
432+ </containerView>
433+ <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KD4-lL-5lI">
434+ <rect key="frame" x="0.0" y="20" width="375" height="323.5"/>
435+ <connections>
436+ <segue destination="sPi-8s-ya2" kind="embed" id="0dA-aV-epC"/>
437+ </connections>
438+ </containerView>
439+ </subviews>
440+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
441+ <constraints>
442+ <constraint firstItem="AM9-XR-Q11" firstAttribute="trailing" secondItem="JAV-ei-FE9" secondAttribute="trailing" id="0nc-wd-359"/>
443+ <constraint firstItem="JAV-ei-FE9" firstAttribute="top" secondItem="KD4-lL-5lI" secondAttribute="bottom" id="2ap-xA-MZc"/>
444+ <constraint firstItem="KD4-lL-5lI" firstAttribute="top" secondItem="AM9-XR-Q11" secondAttribute="top" id="57N-k9-3Da"/>
445+ <constraint firstItem="KD4-lL-5lI" firstAttribute="leading" secondItem="AM9-XR-Q11" secondAttribute="leading" id="KS0-2b-0Zn"/>
446+ <constraint firstItem="KD4-lL-5lI" firstAttribute="height" secondItem="JAV-ei-FE9" secondAttribute="height" id="W9b-Gn-1ZT"/>
447+ <constraint firstItem="AM9-XR-Q11" firstAttribute="trailing" secondItem="KD4-lL-5lI" secondAttribute="trailing" id="bxO-FD-qi7"/>
448+ <constraint firstItem="AM9-XR-Q11" firstAttribute="bottom" secondItem="JAV-ei-FE9" secondAttribute="bottom" id="eCt-RJ-W5F"/>
449+ <constraint firstItem="JAV-ei-FE9" firstAttribute="leading" secondItem="AM9-XR-Q11" secondAttribute="leading" id="tJO-om-OjN"/>
450+ </constraints>
451+ <viewLayoutGuide key="safeArea" id="AM9-XR-Q11"/>
452+ </view>
453+ </viewController>
454+ <placeholder placeholderIdentifier="IBFirstResponder" id="dJR-ry-ymY" userLabel="First Responder" sceneMemberID="firstResponder"/>
455+ </objects>
456+ <point key="canvasLocation" x="5055.1999999999998" y="757.87106446776613"/>
457+ </scene>
419 <!--Posts-->
458 <!--Posts-->
420 <scene sceneID="RSd-UJ-34B">
459 <scene sceneID="RSd-UJ-34B">
421 <objects>
460 <objects>
@@ -432,26 +471,6 @@
432 </objects>
471 </objects>
433 <point key="canvasLocation" x="1088.8" y="132.68365817091455"/>
472 <point key="canvasLocation" x="1088.8" y="132.68365817091455"/>
434 </scene>
473 </scene>
435− <!--News Controller-->
436− <scene sceneID="eR7-97-LRL">
437− <objects>
438− <tableViewController storyboardIdentifier="NewsController" id="Nqc-TI-ueQ" customClass="NewsController" customModule="GDproject" customModuleProvider="target" sceneMemberID="viewController">
439− <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="hwA-SE-xpS">
440− <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
441− <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
442− <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
443− <color key="sectionIndexBackgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
444− <connections>
445− <outlet property="dataSource" destination="Nqc-TI-ueQ" id="bu5-tQ-7lb"/>
446− <outlet property="delegate" destination="Nqc-TI-ueQ" id="kTM-Be-8qb"/>
447− </connections>
448− </tableView>
449− <navigationItem key="navigationItem" largeTitleDisplayMode="always" id="b8E-6f-hLM"/>
450− </tableViewController>
451− <placeholder placeholderIdentifier="IBFirstResponder" id="c9d-Kh-itI" userLabel="First Responder" sceneMemberID="firstResponder"/>
452− </objects>
453− <point key="canvasLocation" x="1880" y="136"/>
454− </scene>
455 <!--Profile-->
474 <!--Profile-->
456 <scene sceneID="dJj-Hp-Wa9">
475 <scene sceneID="dJj-Hp-Wa9">
457 <objects>
476 <objects>
@@ -487,6 +506,49 @@
487 </objects>
506 </objects>
488 <point key="canvasLocation" x="-466" y="641"/>
507 <point key="canvasLocation" x="-466" y="641"/>
489 </scene>
508 </scene>
509+ <!--News Controller-->
510+ <scene sceneID="6SA-L8-PwW">
511+ <objects>
512+ <viewController storyboardIdentifier="NewsController" id="sPi-8s-ya2" customClass="NewsController" customModule="GDproject" customModuleProvider="target" sceneMemberID="viewController">
513+ <view key="view" contentMode="scaleToFill" id="Qwh-6O-iyN">
514+ <rect key="frame" x="0.0" y="0.0" width="375" height="323.5"/>
515+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
516+ <subviews>
517+ <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4pw-5n-XsC">
518+ <rect key="frame" x="0.0" y="0.0" width="375" height="323.5"/>
519+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
520+ </tableView>
521+ </subviews>
522+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
523+ <constraints>
524+ <constraint firstAttribute="bottomMargin" secondItem="4pw-5n-XsC" secondAttribute="bottom" id="iji-Cm-2Xx"/>
525+ <constraint firstItem="4pw-5n-XsC" firstAttribute="top" secondItem="Qwh-6O-iyN" secondAttribute="topMargin" id="j2B-b5-dg7"/>
526+ <constraint firstItem="4pw-5n-XsC" firstAttribute="leading" secondItem="Qwh-6O-iyN" secondAttribute="leading" id="nau-1I-Bh7"/>
527+ <constraint firstAttribute="trailing" secondItem="4pw-5n-XsC" secondAttribute="trailing" id="vnT-kX-h1h"/>
528+ </constraints>
529+ </view>
530+ <connections>
531+ <outlet property="tableView" destination="4pw-5n-XsC" id="usq-Vi-rXA"/>
532+ </connections>
533+ </viewController>
534+ <placeholder placeholderIdentifier="IBFirstResponder" id="3Pe-af-1NZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
535+ </objects>
536+ <point key="canvasLocation" x="5890" y="482"/>
537+ </scene>
538+ <!--View Controller-->
539+ <scene sceneID="LJw-Xf-aJT">
540+ <objects>
541+ <viewController storyboardIdentifier="DrawerContentViewController" id="gBC-pa-4Y8" sceneMemberID="viewController">
542+ <view key="view" contentMode="scaleToFill" id="Z3E-He-aJI">
543+ <rect key="frame" x="0.0" y="0.0" width="375" height="323.5"/>
544+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
545+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
546+ </view>
547+ </viewController>
548+ <placeholder placeholderIdentifier="IBFirstResponder" id="KTe-P9-g8t" userLabel="First Responder" sceneMemberID="firstResponder"/>
549+ </objects>
550+ <point key="canvasLocation" x="5888.8000000000002" y="999.40029985007504"/>
551+ </scene>
490 </scenes>
552 </scenes>
491 <resources>
553 <resources>
492 <image name="1" width="30" height="30"/>
554 <image name="1" width="30" height="30"/>
GDproject/Controller/ News and channels/NewsController.swift+8−4
@@ -21,8 +21,11 @@ protocol UpdateableWithUser: class {
21}
21}
22// MARK:- Controller with posts and channels availiable.
22// MARK:- Controller with posts and channels availiable.
23// Search is availiable within every table (posts and channels). Has button-functionality for boths post and chnnels
23// Search is availiable within every table (posts and channels). Has button-functionality for boths post and chnnels
24−class NewsController: UITableViewController, UISearchControllerDelegate, NewPostDelegate, UpdateableWithChannel, DataDelegate
24+class NewsController: UIViewController, UISearchControllerDelegate, NewPostDelegate, UpdateableWithChannel, DataDelegate
25{
25{
26+
27+ var changedChannelName: ((String)->())?
28+
26 func passData(for row: Int, channel: Model.Channels) {
29 func passData(for row: Int, channel: Model.Channels) {
27 if channel.id == -1{
30 if channel.id == -1{
28 self.channel = nil
31 self.channel = nil
@@ -31,6 +34,8 @@ class NewsController: UITableViewController, UISearchControllerDelegate, NewPost
31 }
34 }
32 }
35 }
33
36
37+ @IBOutlet weak var tableView: UITableView!
38+
34 var dictionary: [Int: Model.Users]? {
39 var dictionary: [Int: Model.Users]? {
35 didSet {
40 didSet {
36
41
@@ -147,9 +152,8 @@ class NewsController: UITableViewController, UISearchControllerDelegate, NewPost
147 self?.posts = $0.posts
152 self?.posts = $0.posts
148 self?.dictionary = $0.users
153 self?.dictionary = $0.users
149 self?.refreshContr.endRefreshing()
154 self?.refreshContr.endRefreshing()
150− self?.navigationItem.title = "General"
155+ self?.changedChannelName?("General")
151 }
156 }
152−
153 }
157 }
154 }
158 }
155
159
@@ -245,7 +249,7 @@ class NewsController: UITableViewController, UISearchControllerDelegate, NewPost
245
249
246 var isBannerVisible: Bool = false
250 var isBannerVisible: Bool = false
247
251
248− override func scrollViewDidScroll(_ scrollView: UIScrollView) {
252+ func scrollViewDidScroll(_ scrollView: UIScrollView) {
249 print(scrollView.contentOffset.y)
253 print(scrollView.contentOffset.y)
250 if scrollView.contentOffset.y >= 50 && !isBannerVisible{
254 if scrollView.contentOffset.y >= 50 && !isBannerVisible{
251 isBannerVisible = true
255 isBannerVisible = true
GDproject/Controller/Coordinator tab bar?/TabbarCoordinator.swiftdeleted−14
@@ -1,14 +0,0 @@
1−import UIKit
2−
3−class TabbarCoordinator{
4− var window: UIWindow!
5−
6− func start(){
7− let tabbar = UIStoryboard.tabBarController()
8− window.rootViewController = tabbar
9− }
10−
11− init(window: UIWindow) {
12− self.window = window
13− }
14−}
GDproject/Controller/Coordinators/ChannelsCoordinator.swift+15−1
@@ -8,6 +8,7 @@
8
8
9import Foundation
9import Foundation
10import UIKit
10import UIKit
11+import Pulley
11
12
12class ChannelsCoordinator: BaseCoordinator{
13class ChannelsCoordinator: BaseCoordinator{
13 private weak var navigationController: UINavigationController?
14 private weak var navigationController: UINavigationController?
@@ -22,7 +23,20 @@ class ChannelsCoordinator: BaseCoordinator{
22
23
23 private func show() {
24 private func show() {
24 let storyboard = UIStoryboard(name: "Main", bundle: nil)
25 let storyboard = UIStoryboard(name: "Main", bundle: nil)
26+
25 let channels = storyboard.instantiateViewController(withIdentifier: channelListControllerId) as! ChannelListController
27 let channels = storyboard.instantiateViewController(withIdentifier: channelListControllerId) as! ChannelListController
28+
29+ let mainContentVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: newsController) as! NewsController
30+
31+ let drawerContentVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DrawerContentViewController")
32+
33+ let pulleyDrawerVC = PulleyViewController(contentViewController: mainContentVC, drawerViewController: drawerContentVC)
34+
35+ pulleyDrawerVC.initialDrawerPosition = .collapsed
36+ mainContentVC.changedChannelName = {
37+ [weak pulleyDrawerVC] (title) in pulleyDrawerVC?.navigationItem.title = title
38+ }
39+
26− navigationController?.setViewControllers([channels], animated: false)
40+ navigationController?.setViewControllers([channels,pulleyDrawerVC], animated: false)
27 }
41 }
28}
42}