Commit aa50502f by Olzhas Aldabergenov

service details view controller added

parent 3eb8475d
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
3E2C3E8E1EFA482D00E553CD /* GetCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2C3E8D1EFA482D00E553CD /* GetCodeViewController.swift */; }; 3E2C3E8E1EFA482D00E553CD /* GetCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2C3E8D1EFA482D00E553CD /* GetCodeViewController.swift */; };
3E2C3E9B1EFCB17E00E553CD /* Validator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2C3E9A1EFCB17E00E553CD /* Validator.swift */; }; 3E2C3E9B1EFCB17E00E553CD /* Validator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2C3E9A1EFCB17E00E553CD /* Validator.swift */; };
3E2E1E821F84DB0100DC0FE5 /* LKSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2E1E811F84DB0100DC0FE5 /* LKSettingsViewController.swift */; }; 3E2E1E821F84DB0100DC0FE5 /* LKSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E2E1E811F84DB0100DC0FE5 /* LKSettingsViewController.swift */; };
3E6969B31FA2097200032D95 /* ServiceDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */; };
3EA7F6BA1F00D1A1003F6CBF /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */; }; 3EA7F6BA1F00D1A1003F6CBF /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */; };
3EA7F6C51F021C9D003F6CBF /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */; }; 3EA7F6C51F021C9D003F6CBF /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */; };
3EA7F6C71F0227E1003F6CBF /* FeedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */; }; 3EA7F6C71F0227E1003F6CBF /* FeedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */; };
...@@ -118,6 +119,7 @@ ...@@ -118,6 +119,7 @@
3EB108581F15F428000EAE88 /* BotViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB108571F15F428000EAE88 /* BotViewController.swift */; }; 3EB108581F15F428000EAE88 /* BotViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB108571F15F428000EAE88 /* BotViewController.swift */; };
3EB1085E1F17398C000EAE88 /* BotLeftMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB1085D1F17398C000EAE88 /* BotLeftMessageCell.swift */; }; 3EB1085E1F17398C000EAE88 /* BotLeftMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB1085D1F17398C000EAE88 /* BotLeftMessageCell.swift */; };
3EB108601F173999000EAE88 /* BotRightMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB1085F1F173999000EAE88 /* BotRightMessageCell.swift */; }; 3EB108601F173999000EAE88 /* BotRightMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB1085F1F173999000EAE88 /* BotRightMessageCell.swift */; };
3ED4C3631FA1F7A0008AC7B4 /* ServiceItemMoreButtonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED4C3621FA1F7A0008AC7B4 /* ServiceItemMoreButtonCell.swift */; };
3EFE2E651F1CD15C00657DA2 /* BlueTriangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFE2E641F1CD15C00657DA2 /* BlueTriangleView.swift */; }; 3EFE2E651F1CD15C00657DA2 /* BlueTriangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFE2E641F1CD15C00657DA2 /* BlueTriangleView.swift */; };
3EFE2E6E1F1CDA5000657DA2 /* WhiteTriangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFE2E6D1F1CDA5000657DA2 /* WhiteTriangleView.swift */; }; 3EFE2E6E1F1CDA5000657DA2 /* WhiteTriangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFE2E6D1F1CDA5000657DA2 /* WhiteTriangleView.swift */; };
483C09D61C68754300255BC6 /* MapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483C09D51C68754300255BC6 /* MapManager.swift */; }; 483C09D61C68754300255BC6 /* MapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483C09D51C68754300255BC6 /* MapManager.swift */; };
...@@ -635,6 +637,7 @@ ...@@ -635,6 +637,7 @@
3E2C3E8D1EFA482D00E553CD /* GetCodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetCodeViewController.swift; sourceTree = "<group>"; }; 3E2C3E8D1EFA482D00E553CD /* GetCodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetCodeViewController.swift; sourceTree = "<group>"; };
3E2C3E9A1EFCB17E00E553CD /* Validator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validator.swift; sourceTree = "<group>"; }; 3E2C3E9A1EFCB17E00E553CD /* Validator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validator.swift; sourceTree = "<group>"; };
3E2E1E811F84DB0100DC0FE5 /* LKSettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LKSettingsViewController.swift; sourceTree = "<group>"; }; 3E2E1E811F84DB0100DC0FE5 /* LKSettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LKSettingsViewController.swift; sourceTree = "<group>"; };
3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceDetailsViewController.swift; sourceTree = "<group>"; };
3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; }; 3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; }; 3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; };
3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedItem.swift; sourceTree = "<group>"; }; 3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedItem.swift; sourceTree = "<group>"; };
...@@ -666,6 +669,7 @@ ...@@ -666,6 +669,7 @@
3EB108571F15F428000EAE88 /* BotViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotViewController.swift; sourceTree = "<group>"; }; 3EB108571F15F428000EAE88 /* BotViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotViewController.swift; sourceTree = "<group>"; };
3EB1085D1F17398C000EAE88 /* BotLeftMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotLeftMessageCell.swift; sourceTree = "<group>"; }; 3EB1085D1F17398C000EAE88 /* BotLeftMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotLeftMessageCell.swift; sourceTree = "<group>"; };
3EB1085F1F173999000EAE88 /* BotRightMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotRightMessageCell.swift; sourceTree = "<group>"; }; 3EB1085F1F173999000EAE88 /* BotRightMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotRightMessageCell.swift; sourceTree = "<group>"; };
3ED4C3621FA1F7A0008AC7B4 /* ServiceItemMoreButtonCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceItemMoreButtonCell.swift; sourceTree = "<group>"; };
3EFE2E641F1CD15C00657DA2 /* BlueTriangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlueTriangleView.swift; path = ../Views/BlueTriangleView.swift; sourceTree = "<group>"; }; 3EFE2E641F1CD15C00657DA2 /* BlueTriangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlueTriangleView.swift; path = ../Views/BlueTriangleView.swift; sourceTree = "<group>"; };
3EFE2E6D1F1CDA5000657DA2 /* WhiteTriangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WhiteTriangleView.swift; path = ../Views/WhiteTriangleView.swift; sourceTree = "<group>"; }; 3EFE2E6D1F1CDA5000657DA2 /* WhiteTriangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WhiteTriangleView.swift; path = ../Views/WhiteTriangleView.swift; sourceTree = "<group>"; };
483C09D51C68754300255BC6 /* MapManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapManager.swift; sourceTree = "<group>"; }; 483C09D51C68754300255BC6 /* MapManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapManager.swift; sourceTree = "<group>"; };
...@@ -1233,6 +1237,7 @@ ...@@ -1233,6 +1237,7 @@
3EA7F6E91F04FC8A003F6CBF /* ServiceMainViewController.swift */, 3EA7F6E91F04FC8A003F6CBF /* ServiceMainViewController.swift */,
3EA7F6EB1F04FDCB003F6CBF /* ServiceMainCell.swift */, 3EA7F6EB1F04FDCB003F6CBF /* ServiceMainCell.swift */,
3EAFC48F1F7916A500BB07AD /* CallbackViewController.swift */, 3EAFC48F1F7916A500BB07AD /* CallbackViewController.swift */,
3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */,
); );
path = Service; path = Service;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1491,6 +1496,7 @@ ...@@ -1491,6 +1496,7 @@
98E5CEE51DB7DC6C00A218EA /* TitleServiceItemCell.swift */, 98E5CEE51DB7DC6C00A218EA /* TitleServiceItemCell.swift */,
98E5CF051DB7DDE100A218EA /* ServiceItemWebviewCell.swift */, 98E5CF051DB7DDE100A218EA /* ServiceItemWebviewCell.swift */,
9834BC051DB7E0CE00417599 /* ServiceItemImageCell.swift */, 9834BC051DB7E0CE00417599 /* ServiceItemImageCell.swift */,
3ED4C3621FA1F7A0008AC7B4 /* ServiceItemMoreButtonCell.swift */,
9834BC251DB7FB9000417599 /* TariffCell.swift */, 9834BC251DB7FB9000417599 /* TariffCell.swift */,
98A19BC01DC2FCA8003C8A0A /* ServiceImageBottomTitleCell.swift */, 98A19BC01DC2FCA8003C8A0A /* ServiceImageBottomTitleCell.swift */,
84F2534F1DF5DB35000123D0 /* UIBaseTableViewCell.swift */, 84F2534F1DF5DB35000123D0 /* UIBaseTableViewCell.swift */,
...@@ -2612,6 +2618,7 @@ ...@@ -2612,6 +2618,7 @@
3EAFC4961F7CE68700BB07AD /* VideoViewController.swift in Sources */, 3EAFC4961F7CE68700BB07AD /* VideoViewController.swift in Sources */,
988729041DDCDC9F00CEEBAA /* ClaimSource.swift in Sources */, 988729041DDCDC9F00CEEBAA /* ClaimSource.swift in Sources */,
983169D01C5A02050084C072 /* ScrolledViewController.swift in Sources */, 983169D01C5A02050084C072 /* ScrolledViewController.swift in Sources */,
3ED4C3631FA1F7A0008AC7B4 /* ServiceItemMoreButtonCell.swift in Sources */,
844554461DFB21C3007D9EE9 /* KTWebViewController.swift in Sources */, 844554461DFB21C3007D9EE9 /* KTWebViewController.swift in Sources */,
3EA7F6EA1F04FC8B003F6CBF /* ServiceMainViewController.swift in Sources */, 3EA7F6EA1F04FC8B003F6CBF /* ServiceMainViewController.swift in Sources */,
988D15EB1CF834AA00342478 /* AppealHistoryPickerTableViewCell.swift in Sources */, 988D15EB1CF834AA00342478 /* AppealHistoryPickerTableViewCell.swift in Sources */,
...@@ -2819,6 +2826,7 @@ ...@@ -2819,6 +2826,7 @@
3EA7F6E81F039C41003F6CBF /* RootVC.swift in Sources */, 3EA7F6E81F039C41003F6CBF /* RootVC.swift in Sources */,
98913B671CF1CEB90034B1D5 /* SubscribePeriod.swift in Sources */, 98913B671CF1CEB90034B1D5 /* SubscribePeriod.swift in Sources */,
983FC3751CE5C3CB00EAA651 /* AltelDetalization.swift in Sources */, 983FC3751CE5C3CB00EAA651 /* AltelDetalization.swift in Sources */,
3E6969B31FA2097200032D95 /* ServiceDetailsViewController.swift in Sources */,
9862038D1C6C66CF00E4B20A /* AlertViewUtil.swift in Sources */, 9862038D1C6C66CF00E4B20A /* AlertViewUtil.swift in Sources */,
98C4A3C21C69B269009A73EA /* CabinetButton.swift in Sources */, 98C4A3C21C69B269009A73EA /* CabinetButton.swift in Sources */,
98860A951CEED6F900B54916 /* PublicWifiOrderCell.swift in Sources */, 98860A951CEED6F900B54916 /* PublicWifiOrderCell.swift in Sources */,
......
...@@ -185,44 +185,12 @@ ...@@ -185,44 +185,12 @@
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/ServiceTariffController.swift"
timestampString = "529908968.759975"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "92"
endingLineNumber = "92"
landmarkName = "connectButton_TouchUpInside(sender:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/ServiceTariffController.swift"
timestampString = "529908968.759975"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "101"
endingLineNumber = "101"
landmarkName = "prepareForSegue(segue:sender:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/ServiceItemScrollViewController.swift" filePath = "kt/ViewControllers/Service/ServiceItemScrollViewController.swift"
timestampString = "529906649.214457" timestampString = "530712033.421239"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "272" startingLineNumber = "280"
endingLineNumber = "272" endingLineNumber = "280"
landmarkName = "prepareForSegue(segue:sender:)" landmarkName = "prepareForSegue(segue:sender:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
...@@ -234,12 +202,12 @@ ...@@ -234,12 +202,12 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/ServiceItemScrollViewController.swift" filePath = "kt/ViewControllers/Service/ServiceItemScrollViewController.swift"
timestampString = "529906650.745449" timestampString = "530713210.852928"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "275" startingLineNumber = "286"
endingLineNumber = "275" endingLineNumber = "286"
landmarkName = "prepareForSegue(segue:sender:)" landmarkName = "prepareForSegue(_:sender:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
......
...@@ -49,6 +49,7 @@ struct Segue { ...@@ -49,6 +49,7 @@ struct Segue {
static let ShowServiceItemSegue = "ShowServiceItemSegue" static let ShowServiceItemSegue = "ShowServiceItemSegue"
static let ShowTariffSegue = "ShowTariffSegue" static let ShowTariffSegue = "ShowTariffSegue"
static let ShowCallBackSegue = "ShowCallBackSegue" static let ShowCallBackSegue = "ShowCallBackSegue"
static let ShowServiceDetails = "ShowServiceDetails"
static let ConnectSegue = "connect" static let ConnectSegue = "connect"
static let CallbackSegue = "callback" static let CallbackSegue = "callback"
static let FullDamageModal = "full_damage_modal" static let FullDamageModal = "full_damage_modal"
......
//
// ServiceDetailsViewController.swift
// kt
//
// Created by neox on 26.10.17.
// Copyright © 2017 SimpleCode. All rights reserved.
//
import Foundation
class ServiceDetailsViewController: UIViewController {
}
...@@ -24,6 +24,7 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource, ...@@ -24,6 +24,7 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource,
let serviceItemWebviewCell = "serviceItemWebviewCell" let serviceItemWebviewCell = "serviceItemWebviewCell"
let titleServiceItemCell = "titleServiceItemCell" let titleServiceItemCell = "titleServiceItemCell"
let tariffCell = "tariffCell" let tariffCell = "tariffCell"
let serviceItemMoreCell = "serviceItemMoreCell"
//MARK: UI //MARK: UI
var subviewHeight: NSLayoutConstraint! var subviewHeight: NSLayoutConstraint!
@IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var scrollView: UIScrollView!
...@@ -245,6 +246,10 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource, ...@@ -245,6 +246,10 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource,
performSegueWithIdentifier(Segue.ShowTariffSegue, sender: rate) performSegueWithIdentifier(Segue.ShowTariffSegue, sender: rate)
} }
func openServiceDetails(sender : UIButton) {
performSegueWithIdentifier(Segue.ShowServiceDetails, sender: sender)
}
// MARK: Navigation // MARK: Navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
...@@ -262,6 +267,9 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource, ...@@ -262,6 +267,9 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource,
vc.title = LS("service.connect") vc.title = LS("service.connect")
} }
break break
case Segue.ShowServiceDetails:
print ("open service details")
break
default: default:
break break
} }
...@@ -270,6 +278,9 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource, ...@@ -270,6 +278,9 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource,
vc.rate = sender as! ServiceItem.Rate vc.rate = sender as! ServiceItem.Rate
// vc.tariff = sender as! Tariff // vc.tariff = sender as! Tariff
vc.serviceItem = serviceItemForLoading vc.serviceItem = serviceItemForLoading
} else if ( segue.identifier == Segue.ShowServiceDetails) {
let vc = segue.destinationViewController as! ServiceDetailsViewController
} else { } else {
let vc = segue.destinationViewController as! ServiceCallbackController let vc = segue.destinationViewController as! ServiceCallbackController
vc.serviceItem = serviceItemForLoading vc.serviceItem = serviceItemForLoading
...@@ -386,56 +397,49 @@ extension ServiceItemScrollViewController { ...@@ -386,56 +397,49 @@ extension ServiceItemScrollViewController {
break break
case fromValue + 2: case fromValue + 2:
print("SC: TableView Reloading") print("SC: TableView Reloading")
let cell = tableView.dequeueReusableCellWithIdentifier(serviceItemWebviewCell, forIndexPath: indexPath) as! ServiceItemWebviewCell //let cell2 = tableView.dequeueReusableCellWithIdentifier(serviceItemWebviewCell, forIndexPath: indexPath) as! ServiceItemWebviewCell
let cell = tableView.dequeueReusableCellWithIdentifier(serviceItemMoreCell, forIndexPath: indexPath) as! ServiceItemMoreButtonCell
cell.vc = self cell.vc = self
if !self.webViewLoaded { // if !self.webViewLoaded {
// self.webView.opaque = false // // self.webView.opaque = false
self.webView.userInteractionEnabled = false // self.webView.userInteractionEnabled = false
cell.contentView.addSubview(self.webView) // cell.contentView.addSubview(self.webView)
self.webView.translatesAutoresizingMaskIntoConstraints = false // self.webView.translatesAutoresizingMaskIntoConstraints = false
let views = ["web": self.webView] // let views = ["web": self.webView]
cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[web]|", options: [], metrics: nil, views: views)) // cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[web]|", options: [], metrics: nil, views: views))
cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[web]|", options: [], metrics: nil, views: views)) // cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[web]|", options: [], metrics: nil, views: views))
//
//self.webView.loadHTMLString("<style>img{max-width: 100%; width:auto; height: auto;}</style>" + self.serviceItem!.html, baseURL: nil) // //self.webView.loadHTMLString("<style>img{max-width: 100%; width:auto; height: auto;}</style>" + self.serviceItem!.html, baseURL: nil)
self.webViewHeight = NSLayoutConstraint(item: self.webView, attribute: .Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: 0) // self.webViewHeight = NSLayoutConstraint(item: self.webView, attribute: .Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: 0)
self.webView.userInteractionEnabled = true // self.webView.userInteractionEnabled = true
//
// cell.webViewHeight.priority = UILayoutPriorityDefaultLow // // cell.webViewHeight.priority = UILayoutPriorityDefaultLow
cell.contentView.addConstraint(self.webViewHeight) // cell.contentView.addConstraint(self.webViewHeight)
//
let delay = 1 * Double(NSEC_PER_SEC) // let delay = 1 * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) // let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), {() in // dispatch_after(time, dispatch_get_main_queue(), {() in
self.webViewHeight.constant = self.webView.scrollView.contentSize.height // self.webViewHeight.constant = self.webView.scrollView.contentSize.height
self.wkWebViewContentSizeDefined() // self.wkWebViewContentSizeDefined()
self.webView.loadHTMLString(self.observeHtml(self.serviceItem!.html), baseURL: nil) // self.webView.loadHTMLString(self.observeHtml(self.serviceItem!.html), baseURL: nil)
//
//
//
}) // })
// self.webView.evaluateJavaScript("document.height") { (result, error) in // self.webViewLoaded = true
// if error == nil { // } else {
// print(result) // self.webView.userInteractionEnabled = false
// self.webView.userInteractionEnabled = true // cell.contentView.addSubview(self.webView)
// self.wkWebViewContentSizeDefined() // self.webView.translatesAutoresizingMaskIntoConstraints = false
// } // let views = ["web": self.webView]
// } // cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[web]|", options: [], metrics: nil, views: views))
// self.loadingIndicator!.stopAnimating() // cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[web]|", options: [], metrics: nil, views: views))
self.webViewLoaded = true // cell.contentView.addConstraint(self.webViewHeight)
} else { // self.webView.userInteractionEnabled = true
self.webView.userInteractionEnabled = false //
cell.contentView.addSubview(self.webView) // cell.contentView.setNeedsLayout()
self.webView.translatesAutoresizingMaskIntoConstraints = false //
let views = ["web": self.webView] // }
cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[web]|", options: [], metrics: nil, views: views))
cell.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[web]|", options: [], metrics: nil, views: views))
cell.contentView.addConstraint(self.webViewHeight)
self.webView.userInteractionEnabled = true
cell.contentView.setNeedsLayout()
}
resultCell = cell resultCell = cell
break break
case fromValue + 3: case fromValue + 3:
......
...@@ -13,6 +13,7 @@ class ServiceCell: UITableViewCell { ...@@ -13,6 +13,7 @@ class ServiceCell: UITableViewCell {
@IBOutlet private weak var nameLabel: UILabel! @IBOutlet private weak var nameLabel: UILabel!
@IBOutlet weak var backgroundImage: UIImageView! @IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet weak var extraLabel: UILabel! @IBOutlet weak var extraLabel: UILabel!
@IBOutlet weak var divider: UIView!
func setService(servicesItem : ServiceItem, withRow row: Int) { func setService(servicesItem : ServiceItem, withRow row: Int) {
...@@ -30,13 +31,15 @@ class ServiceCell: UITableViewCell { ...@@ -30,13 +31,15 @@ class ServiceCell: UITableViewCell {
} }
self.iconView.alpha = 0.0 self.iconView.alpha = 0.0
self.nameLabel.textColor = UIColor.blackColor() self.nameLabel.textColor = UIColor.blackColor()
self.divider.alpha = 0.0
// selectedBackgroundView!.backgroundColor = UIColor.clearColor() // selectedBackgroundView!.backgroundColor = UIColor.clearColor()
} else { } else {
self.iconView.alpha = 0.0 self.iconView.alpha = 0.0
self.nameLabel.textColor = UIColor.whiteColor() self.divider.alpha = 1.0
//self.nameLabel.textColor = UIColor.whiteColor()
contentView.backgroundColor = servicesItem.service!.colorForRow(row) //contentView.backgroundColor = servicesItem.service!.colorForRow(row)
selectedBackgroundView!.backgroundColor = servicesItem.service!.colorForRow(row) // selectedBackgroundView!.backgroundColor = servicesItem.service!.colorForRow(row)
self.backgroundImage.addConstraint(NSLayoutConstraint(item: self.backgroundImage, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 0)) self.backgroundImage.addConstraint(NSLayoutConstraint(item: self.backgroundImage, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 0))
} }
......
//
// ServiceItemMoreButtonCell.swift
// kt
//
// Created by neox on 26.10.17.
// Copyright © 2017 SimpleCode. All rights reserved.
//
import Foundation
class ServiceItemMoreButtonCell : UITableViewCell {
var vc: ServiceItemScrollViewController!
override func awakeFromNib() {
super.awakeFromNib()
}
@IBAction func inDetailsButtonClick(sender: UIButton) {
vc.openServiceDetails(sender)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment