Dimitris Togias

add custom button class

...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 A080CFD628D170A20045A315 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD428D170A20045A315 /* MapsViewController.swift */; }; 36 A080CFD628D170A20045A315 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD428D170A20045A315 /* MapsViewController.swift */; };
37 A080CFD728D170A20045A315 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A080CFD528D170A20045A315 /* MapsViewController.xib */; }; 37 A080CFD728D170A20045A315 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A080CFD528D170A20045A315 /* MapsViewController.xib */; };
38 A080CFDA28D1889A0045A315 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */; }; 38 A080CFDA28D1889A0045A315 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */; };
39 + A080CFDC28D18B780045A315 /* CSMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFDB28D18B780045A315 /* CSMButton.swift */; };
39 A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */; }; 40 A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */; };
40 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; }; 41 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
41 E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42 E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
...@@ -193,6 +194,7 @@ ...@@ -193,6 +194,7 @@
193 A080CFD428D170A20045A315 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; }; 194 A080CFD428D170A20045A315 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; };
194 A080CFD528D170A20045A315 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; }; 195 A080CFD528D170A20045A315 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; };
195 A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; }; 196 A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
197 + A080CFDB28D18B780045A315 /* CSMButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSMButton.swift; sourceTree = "<group>"; };
196 A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingHistoryViewController.swift; sourceTree = "<group>"; }; 198 A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingHistoryViewController.swift; sourceTree = "<group>"; };
197 A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; }; 199 A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; };
198 B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; }; 200 B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; };
...@@ -410,6 +412,7 @@ ...@@ -410,6 +412,7 @@
410 A080CFD828D17F7A0045A315 /* controls */ = { 412 A080CFD828D17F7A0045A315 /* controls */ = {
411 isa = PBXGroup; 413 isa = PBXGroup;
412 children = ( 414 children = (
415 + A080CFDB28D18B780045A315 /* CSMButton.swift */,
413 ); 416 );
414 name = controls; 417 name = controls;
415 sourceTree = "<group>"; 418 sourceTree = "<group>";
...@@ -933,6 +936,7 @@ ...@@ -933,6 +936,7 @@
933 E6A778EE282933E60045BBA8 /* WLNativeAdsTableMode.m in Sources */, 936 E6A778EE282933E60045BBA8 /* WLNativeAdsTableMode.m in Sources */,
934 A07936732885E67400064122 /* AnalysisItem.swift in Sources */, 937 A07936732885E67400064122 /* AnalysisItem.swift in Sources */,
935 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */, 938 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */,
939 + A080CFDC28D18B780045A315 /* CSMButton.swift in Sources */,
936 E6A77941282933E70045BBA8 /* AFURLRequestSerialization.m in Sources */, 940 E6A77941282933E70045BBA8 /* AFURLRequestSerialization.m in Sources */,
937 E6A77915282933E60045BBA8 /* WLUtils.m in Sources */, 941 E6A77915282933E60045BBA8 /* WLUtils.m in Sources */,
938 E6A77A36282BB4CB0045BBA8 /* MakeItAPresentViewController.swift in Sources */, 942 E6A77A36282BB4CB0045BBA8 /* MakeItAPresentViewController.swift in Sources */,
......
1 +//
2 +// CSMButton.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Dimitris Togias on 14/9/22.
6 +//
7 +
8 +import UIKit
9 +
10 +@IBDesignable
11 +class CSMButton: UIButton {
12 +
13 + required init() {
14 + super.init(frame: .zero)
15 + self.setup()
16 + }
17 +
18 + required init?(coder aDecoder: NSCoder) {
19 + super.init(coder: aDecoder)
20 + self.setup()
21 + }
22 +
23 + private func setup() {
24 + self.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
25 + self.setTitleColor(.white, for: .normal)
26 + self.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
27 + self.layer.cornerRadius = 12.0
28 + }
29 +}
...@@ -19,7 +19,7 @@ class MapsViewController: UIViewController, MKMapViewDelegate { ...@@ -19,7 +19,7 @@ class MapsViewController: UIViewController, MKMapViewDelegate {
19 @IBOutlet private var hoursView: UILabel! 19 @IBOutlet private var hoursView: UILabel!
20 @IBOutlet private var phoneView: UILabel! 20 @IBOutlet private var phoneView: UILabel!
21 @IBOutlet private var addressView: UILabel! 21 @IBOutlet private var addressView: UILabel!
22 - @IBOutlet private var directionsButton: UIButton! 22 + @IBOutlet private var directionsButton: CSMButton!
23 @IBOutlet private var infoTopConstraint: NSLayoutConstraint! 23 @IBOutlet private var infoTopConstraint: NSLayoutConstraint!
24 24
25 // public 25 // public
...@@ -61,9 +61,9 @@ class MapsViewController: UIViewController, MKMapViewDelegate { ...@@ -61,9 +61,9 @@ class MapsViewController: UIViewController, MKMapViewDelegate {
61 61
62 //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) 62 //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
63 directionsButton.setTitle("Οδηγίες", for: .normal) 63 directionsButton.setTitle("Οδηγίες", for: .normal)
64 - directionsButton.setTitleColor(.white, for: .normal) 64 + //directionsButton.setTitleColor(.white, for: .normal)
65 - directionsButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00) 65 + //directionsButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
66 - directionsButton.layer.cornerRadius = 12.0 66 + //directionsButton.layer.cornerRadius = 12.0
67 } 67 }
68 68
69 // mvp 69 // mvp
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
114 <nil key="textColor"/> 114 <nil key="textColor"/>
115 <nil key="highlightedColor"/> 115 <nil key="highlightedColor"/>
116 </label> 116 </label>
117 - <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions"> 117 + <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions" customClass="CSMButton" customModule="SwiftWarplyFramework" customModuleProvider="target">
118 <rect key="frame" x="317" y="235" width="67" height="31"/> 118 <rect key="frame" x="317" y="235" width="67" height="31"/>
119 <state key="normal" title="Button"/> 119 <state key="normal" title="Button"/>
120 <buttonConfiguration key="configuration" style="plain" title="Button"/> 120 <buttonConfiguration key="configuration" style="plain" title="Button"/>
......