Manos Chorianopoulos

add header shadow

......@@ -57,6 +57,7 @@ import SwiftEventBus
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......
......@@ -72,6 +72,7 @@ import AVFoundation
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......
......@@ -63,6 +63,7 @@ import SwiftEventBus
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......
......@@ -12,6 +12,7 @@ import SwiftEventBus
@objc public class GiftsViewController: UIViewController {
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var topBorderShadow: UIImageView!
public var campaigns:Array<swiftApi.CampaignItemModel> = [] {
didSet {
......@@ -59,17 +60,31 @@ import SwiftEventBus
}
tableView.clipsToBounds = true
tableView.layer.cornerRadius = 30
tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// tableView.clipsToBounds = true
// tableView.layer.cornerRadius = 30
// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
tableView.contentInset.top = 50
// Add Top left corner radius
mainView.clipsToBounds = true
mainView.layer.cornerRadius = 30
mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// mainView.clipsToBounds = true
// mainView.layer.cornerRadius = 30
// mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
mainView.backgroundColor = UIColor(red: 0.22, green: 0.32, blue: 0.40, alpha: 1.00)
let image = UIImage(named: "top_border_shadow", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderShadow.translatesAutoresizingMaskIntoConstraints = false
topBorderShadow.image = image
topBorderShadow.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderShadow.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderShadow.heightAnchor.constraint(equalTo: topBorderShadow.widthAnchor, multiplier: 1/aspectR)
])
}
public override func viewWillAppear(_ animated: Bool) {
......
......@@ -12,7 +12,8 @@ import SwiftEventBus
@objc public class MFYViewController: UIViewController {
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var topBorderShadow: UIImageView!
var categories: Array<CampaignCategory> = [CampaignCategory]() {
didSet {
DispatchQueue.main.async {
......@@ -50,17 +51,31 @@ import SwiftEventBus
self.refreshData()
}
tableView.clipsToBounds = true
tableView.layer.cornerRadius = 30
tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// tableView.clipsToBounds = true
// tableView.layer.cornerRadius = 30
// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
tableView.contentInset.top = 50
// Add Top left corner radius
mainView.clipsToBounds = true
mainView.layer.cornerRadius = 30
mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// mainView.clipsToBounds = true
// mainView.layer.cornerRadius = 30
// mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
mainView.backgroundColor = UIColor(red: 0.22, green: 0.32, blue: 0.40, alpha: 1.00)
let image = UIImage(named: "top_border_shadow", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderShadow.translatesAutoresizingMaskIntoConstraints = false
topBorderShadow.image = image
topBorderShadow.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderShadow.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderShadow.heightAnchor.constraint(equalTo: topBorderShadow.widthAnchor, multiplier: 1/aspectR)
])
}
public override func viewWillAppear(_ animated: Bool) {
......
......@@ -324,6 +324,9 @@
<outlet property="delegate" destination="YRk-Az-LOb" id="xhM-mG-VTI"/>
</connections>
</tableView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8mV-zg-aKO">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.21960784310000001" green="0.32156862749999998" blue="0.4039215686" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
......@@ -331,6 +334,9 @@
<constraint firstItem="A8b-3b-5xc" firstAttribute="top" secondItem="NSn-MS-EVn" secondAttribute="top" id="Gfl-IG-H5C"/>
<constraint firstAttribute="trailing" secondItem="A8b-3b-5xc" secondAttribute="trailing" id="Xth-7O-TIk"/>
<constraint firstItem="A8b-3b-5xc" firstAttribute="leading" secondItem="NSn-MS-EVn" secondAttribute="leading" id="bdZ-c7-9jg"/>
<constraint firstItem="8mV-zg-aKO" firstAttribute="leading" secondItem="NSn-MS-EVn" secondAttribute="leading" id="eeL-Df-GVU"/>
<constraint firstItem="8mV-zg-aKO" firstAttribute="top" secondItem="NSn-MS-EVn" secondAttribute="top" id="jVC-qs-cac"/>
<constraint firstAttribute="trailing" secondItem="8mV-zg-aKO" secondAttribute="trailing" id="zBg-nO-B4w"/>
</constraints>
</view>
</subviews>
......@@ -346,6 +352,7 @@
<connections>
<outlet property="mainView" destination="NSn-MS-EVn" id="8Ux-Ip-hGi"/>
<outlet property="tableView" destination="A8b-3b-5xc" id="0Nr-bb-I5x"/>
<outlet property="topBorderShadow" destination="8mV-zg-aKO" id="BxW-Q3-Kr2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cet-Ta-bHg" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......@@ -1302,11 +1309,17 @@
<outlet property="delegate" destination="wy8-hC-CyC" id="mdR-Aj-QGh"/>
</connections>
</tableView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NqU-qs-YbE">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.2196078431372549" green="0.32156862745098036" blue="0.40392156862745099" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="Obj-Bh-L89" firstAttribute="top" secondItem="gxz-nY-dFI" secondAttribute="top" id="ECw-Zp-2Tr"/>
<constraint firstItem="NqU-qs-YbE" firstAttribute="leading" secondItem="gxz-nY-dFI" secondAttribute="leading" id="EOR-Jd-ced"/>
<constraint firstAttribute="trailing" secondItem="Obj-Bh-L89" secondAttribute="trailing" id="M3y-23-abb"/>
<constraint firstAttribute="trailing" secondItem="NqU-qs-YbE" secondAttribute="trailing" id="RSj-oS-ZrU"/>
<constraint firstItem="NqU-qs-YbE" firstAttribute="top" secondItem="gxz-nY-dFI" secondAttribute="top" id="ZVc-bP-xeu"/>
<constraint firstAttribute="bottom" secondItem="Obj-Bh-L89" secondAttribute="bottom" id="lop-u2-nwa"/>
<constraint firstItem="Obj-Bh-L89" firstAttribute="leading" secondItem="gxz-nY-dFI" secondAttribute="leading" id="q6N-T6-U0n"/>
</constraints>
......@@ -1324,6 +1337,7 @@
<connections>
<outlet property="mainView" destination="gxz-nY-dFI" id="nfd-vO-aaA"/>
<outlet property="tableView" destination="Obj-Bh-L89" id="5cL-tU-7Lw"/>
<outlet property="topBorderShadow" destination="NqU-qs-YbE" id="gMS-ef-Szc"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YLX-2E-CQz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......
......@@ -63,6 +63,7 @@ import MapKit
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......
{
"images" : [
{
"filename" : "top_border_shadow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "top_border_shadow-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "top_border_shadow-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -67,6 +67,7 @@ import SwiftEventBus
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......
......@@ -64,6 +64,7 @@ import SwiftEventBus
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
......