Add + All Screens
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Example Alert Popup Controller-->
|
||||
<scene sceneID="Zyy-oh-ZWO">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ExampleAlertPopupController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="WD1-w9-jdT" customClass="ExampleAlertPopupController" customModule="ContainerController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="tYk-Rm-2kC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="USX-oT-7SK" customClass="TableAdapterView" customModule="ContainerControllerSwift">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<color key="backgroundColor" red="0.93725490196078431" green="0.94901960784313721" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6qi-GV-N23"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="USX-oT-7SK" firstAttribute="leading" secondItem="tYk-Rm-2kC" secondAttribute="leading" id="7TM-w1-Kfr"/>
|
||||
<constraint firstAttribute="trailing" secondItem="USX-oT-7SK" secondAttribute="trailing" id="CDx-dn-PrB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="USX-oT-7SK" secondAttribute="bottom" id="DqU-nh-5rX"/>
|
||||
<constraint firstItem="USX-oT-7SK" firstAttribute="top" secondItem="tYk-Rm-2kC" secondAttribute="top" id="rVc-YC-tbP"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="USX-oT-7SK" id="6e7-Je-kP7"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4Ix-vf-0x1" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-68" y="-69"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Example Text View Controller-->
|
||||
<scene sceneID="Zyy-oh-ZWO">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ExampleTextViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="WD1-w9-jdT" customClass="ExampleTextViewController" customModule="ContainerController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="tYk-Rm-2kC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="USX-oT-7SK" customClass="TableAdapterView" customModule="ContainerControllerSwift">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<color key="backgroundColor" red="0.93725490196078431" green="0.94901960784313721" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6qi-GV-N23"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="USX-oT-7SK" firstAttribute="leading" secondItem="tYk-Rm-2kC" secondAttribute="leading" id="7TM-w1-Kfr"/>
|
||||
<constraint firstAttribute="trailing" secondItem="USX-oT-7SK" secondAttribute="trailing" id="CDx-dn-PrB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="USX-oT-7SK" secondAttribute="bottom" id="DqU-nh-5rX"/>
|
||||
<constraint firstItem="USX-oT-7SK" firstAttribute="top" secondItem="tYk-Rm-2kC" secondAttribute="top" id="rVc-YC-tbP"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="USX-oT-7SK" id="6e7-Je-kP7"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4Ix-vf-0x1" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-68" y="-69"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
import UIKit
|
||||
import ContainerControllerSwift
|
||||
|
||||
|
||||
class ExampleAlertPopupController: ExampleTextViewController {
|
||||
override func viewDidLoad() {
|
||||
self.alert = true
|
||||
super.viewDidLoad()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class ExampleTextViewController: StoryboardController {
|
||||
|
||||
@IBOutlet weak var tableView: TableAdapterView!
|
||||
var containers: [ContainerController] = []
|
||||
|
||||
var alert: Bool = false
|
||||
|
||||
var textVieww: UITextView?
|
||||
var container: ContainerController?
|
||||
|
||||
var containerTable2: TableAdapterView?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
title = alert ? "Example Alert Popup" : "Example Add TextView"
|
||||
|
||||
// self.navBarHide = true
|
||||
let color1 = #colorLiteral(red: 0.4980392157, green: 0.4980392157, blue: 0.4980392157, alpha: 1)
|
||||
view.backgroundColor = color1
|
||||
// let img1 = #imageLiteral(resourceName: "imgPlaylistMain")
|
||||
|
||||
var items: [TableAdapterItem] = []
|
||||
items.append( PlaylistTitleItem(state: .init(titleText: "") ) )
|
||||
tableView.set(items: items, animated: true)
|
||||
|
||||
|
||||
if alert {
|
||||
|
||||
let header = ExampleTextHeaderView(frame: CGRect(x: 0, y: 0, width: ScreenSize.width, height: 337))
|
||||
let footer = ExampleTextButtonBottomView(frame: CGRect(x: 0, y: 0, width: ScreenSize.width, height: 104))
|
||||
|
||||
let topS = 227 - topbarHeight
|
||||
let ccc = addContainer(position: .init(top: topS, bottom: topS), radius: 25, header: header, footer: footer)
|
||||
container = ccc.0
|
||||
|
||||
|
||||
let textView = createTextView2()
|
||||
self.container?.add(scrollView: textView)
|
||||
self.textVieww = textView
|
||||
|
||||
|
||||
containers.append( ccc.0 )
|
||||
|
||||
main(delay: 0.5) {
|
||||
self.container?.move(type: .top)
|
||||
}
|
||||
|
||||
// main(delay: 2.5) {
|
||||
// self.container?.move(type: .top)
|
||||
// }
|
||||
//
|
||||
// main(delay: 4.5) {
|
||||
// self.container?.move(type: .hide)
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
let ccc2 = createContainerFull(title: "", addBackShadow: true)
|
||||
|
||||
if let c1 = ccc2.0, let t1 = ccc2.1 {
|
||||
|
||||
containerTable2 = t1
|
||||
|
||||
c1.backView?.subviews.forEach {
|
||||
$0.removeFromSuperview()
|
||||
}
|
||||
|
||||
c1.set(bottom: 100 )
|
||||
|
||||
|
||||
let fr = CGRect(x: 0, y: 0, width: ScreenSize.width, height: 161)
|
||||
let header = CustomCardHeaderMainView()
|
||||
header.titleLabel?.text = "HeaderView"
|
||||
header.subtitleLabel?.text = "Added UITextView"
|
||||
header.frame = fr
|
||||
|
||||
|
||||
c1.add(headerView: header)
|
||||
|
||||
c1.set(left: 15)
|
||||
c1.set(right: 15)
|
||||
c1.set(top: 40)
|
||||
c1.view.cornerRadius = 37
|
||||
|
||||
containers.append( c1 )
|
||||
|
||||
c1.set(top: 40)
|
||||
let scrollV = createTextView()
|
||||
scrollV.alpha = 0.0
|
||||
c1.add(scrollView: scrollV)
|
||||
UIView.animate(withDuration: 0.35) {
|
||||
scrollV.alpha = 1.0
|
||||
}
|
||||
|
||||
main {
|
||||
c1.move(type: .top)
|
||||
}
|
||||
|
||||
// main(delay: 2.0) {
|
||||
// c1.move(type: .hide)
|
||||
// }
|
||||
//
|
||||
// main(delay: 4.5) {
|
||||
// c1.move(type: .top)
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func createTextView2() -> UITextView {
|
||||
|
||||
let textView = UITextView()
|
||||
textView.returnKeyType = .done
|
||||
textView.backgroundColor = .clear
|
||||
textView.textContainerInset = .init(top: 10, left: 16, bottom: 5, right: 16)
|
||||
textView.font = UIFont.mediumSystemFont(ofSize: 15)
|
||||
textView.text = """
|
||||
Вы знали, что в Яндекс Go есть не только самокаты, но ещё и электровелосипеды!
|
||||
На них тоже можно кататься по абонементу или с пакетом минут. Берите для себя и друзей и колесите по городу
с удовольствием
|
||||
"""
|
||||
|
||||
return textView
|
||||
}
|
||||
|
||||
|
||||
func createContainerFull(mini: Bool = false, gradient: Bool = false, title: String? = nil, addBackShadow: Bool = false) -> (ContainerController?, TableAdapterView?) {
|
||||
|
||||
let items: [TableAdapterItem] = []
|
||||
// items.append( PlaylistTitleItem(state: .init() ) )
|
||||
tableView.set(items: items, animated: true)
|
||||
|
||||
|
||||
let itemsC: [TableAdapterItem] = []
|
||||
|
||||
|
||||
let ccc = addContainer(position: .init(top: mini ? 241 : 350, bottom: mini ? 223 : 173), radius: mini ? 22 : 37, items: itemsC, addBackShadow: addBackShadow)
|
||||
|
||||
|
||||
let frr = CGRect(x: 0, y: 0, width: ccc.0.backView?.width ?? 0, height: ccc.0.backView?.height ?? 0)
|
||||
let gradientV = CustomCardGradientMainView()
|
||||
gradientV.gr1.isHidden = !gradient
|
||||
gradientV.gr2.isHidden = gradient
|
||||
gradientV.autoresizingMask = [.flexibleWidth, .flexibleHeight, .flexibleLeftMargin,
|
||||
.flexibleRightMargin, .flexibleTopMargin]
|
||||
gradientV.frame = frr
|
||||
|
||||
ccc.0.backView?.addSubview( gradientV )
|
||||
|
||||
|
||||
|
||||
|
||||
if !mini {
|
||||
let fr = CGRect(x: 0, y: 0, width: ScreenSize.width, height: 63)
|
||||
let header = CustomCardHeaderView()
|
||||
header.titleLabel?.text = title ?? ""
|
||||
header.frame = fr
|
||||
|
||||
ccc.0.add(headerView: header)
|
||||
} else {
|
||||
|
||||
let fr = CGRect(x: 0, y: 0, width: ScreenSize.width, height: 39)
|
||||
let header = CustomCardHeaderMiniView()
|
||||
header.frame = fr
|
||||
header.titleLabel?.text = title ?? ""
|
||||
ccc.0.add(headerView: header)
|
||||
}
|
||||
|
||||
|
||||
ccc.0.move(type: .hide)
|
||||
|
||||
|
||||
|
||||
return ccc
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user