Commit 6c9b7835 by Dmitriy Stepanets

Added WidgetPromotionController UI

parent 63e5bf75
......@@ -97,6 +97,9 @@
CD82300325D69DE400A05501 /* TodayConditionsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD82300225D69DE400A05501 /* TodayConditionsCell.swift */; };
CD82300725D6A73F00A05501 /* TodayConditionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD82300625D6A73E00A05501 /* TodayConditionButton.swift */; };
CD82300A25D6B2AF00A05501 /* AppTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD82300925D6B2AF00A05501 /* AppTabBarController.swift */; };
CD857EA2268B290500B5E069 /* WidgetPromotionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD857EA1268B290500B5E069 /* WidgetPromotionController.swift */; };
CD857EA5268B36EA00B5E069 /* PromotionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD857EA4268B36EA00B5E069 /* PromotionHeaderView.swift */; };
CD857EA7268B45DD00B5E069 /* PromotionSmallWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD857EA6268B45DD00B5E069 /* PromotionSmallWidgetView.swift */; };
CD86245E25E646350097F3FB /* SunUvView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD86245D25E646350097F3FB /* SunUvView.swift */; };
CD86246125E662BC0097F3FB /* SunUvLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD86246025E662BC0097F3FB /* SunUvLineView.swift */; };
CD86246525E66E8A0097F3FB /* PrecipitationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD86246425E66E8A0097F3FB /* PrecipitationCell.swift */; };
......@@ -341,6 +344,9 @@
CD82300225D69DE400A05501 /* TodayConditionsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayConditionsCell.swift; sourceTree = "<group>"; };
CD82300625D6A73E00A05501 /* TodayConditionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayConditionButton.swift; sourceTree = "<group>"; };
CD82300925D6B2AF00A05501 /* AppTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTabBarController.swift; sourceTree = "<group>"; };
CD857EA1268B290500B5E069 /* WidgetPromotionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WidgetPromotionController.swift; sourceTree = "<group>"; };
CD857EA4268B36EA00B5E069 /* PromotionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromotionHeaderView.swift; sourceTree = "<group>"; };
CD857EA6268B45DD00B5E069 /* PromotionSmallWidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromotionSmallWidgetView.swift; sourceTree = "<group>"; };
CD86245D25E646350097F3FB /* SunUvView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SunUvView.swift; sourceTree = "<group>"; };
CD86246025E662BC0097F3FB /* SunUvLineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SunUvLineView.swift; sourceTree = "<group>"; };
CD86246425E66E8A0097F3FB /* PrecipitationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrecipitationCell.swift; sourceTree = "<group>"; };
......@@ -725,6 +731,7 @@
CD6B3038257267E2004B34B3 /* View controllers */ = {
isa = PBXGroup;
children = (
CD857EA0268B290500B5E069 /* WidgetPromotion */,
CD5692B22653D46100A3CDBE /* SplashAnimation */,
CEC8FBAD263975170001A6BF /* Onboarding */,
CD8B60AF263819780055CB3F /* Notifications */,
......@@ -805,6 +812,24 @@
path = TodayConditions;
sourceTree = "<group>";
};
CD857EA0268B290500B5E069 /* WidgetPromotion */ = {
isa = PBXGroup;
children = (
CD857EA3268B36D000B5E069 /* Views */,
CD857EA1268B290500B5E069 /* WidgetPromotionController.swift */,
);
path = WidgetPromotion;
sourceTree = "<group>";
};
CD857EA3268B36D000B5E069 /* Views */ = {
isa = PBXGroup;
children = (
CD857EA4268B36EA00B5E069 /* PromotionHeaderView.swift */,
CD857EA6268B45DD00B5E069 /* PromotionSmallWidgetView.swift */,
);
path = Views;
sourceTree = "<group>";
};
CD86245B25E646000097F3FB /* SunPhaseCell */ = {
isa = PBXGroup;
children = (
......@@ -1480,6 +1505,7 @@
CD6C22F2266780ED00D75659 /* AdConfigManager.swift in Sources */,
CD6C22F1266780BE00D75659 /* AdConfig.swift in Sources */,
CD35DFD0260344A500F2138F /* ForecastConditionView.swift in Sources */,
CD857EA7268B45DD00B5E069 /* PromotionSmallWidgetView.swift in Sources */,
CD2ABF32261489F700C1A92E /* LocationCellFactory.swift in Sources */,
CD7BF15526203E6900A30DF5 /* RadarViewController.swift in Sources */,
CD82300325D69DE400A05501 /* TodayConditionsCell.swift in Sources */,
......@@ -1527,9 +1553,11 @@
CD866A6F260F67F200E96A5C /* SettingsDetailsViewModel.swift in Sources */,
CD71709025FA317700A63C27 /* ForecastTimePeriodView.swift in Sources */,
CE13B812262480B3007CBD4D /* NativeAdItem.swift in Sources */,
CD857EA5268B36EA00B5E069 /* PromotionHeaderView.swift in Sources */,
CD37D3E5260CB05C002669D6 /* MenuFooterView.swift in Sources */,
CDE18DD825D16CB200C80ED9 /* NavigationCityButton.swift in Sources */,
CDAD97B1262042B2007FCFB1 /* MapButton.swift in Sources */,
CD857EA2268B290500B5E069 /* WidgetPromotionController.swift in Sources */,
CD17C60225D15C8500EE884E /* CoordinatorProtocol.swift in Sources */,
CDA5542825EF734200A2E08C /* TodayCellFactory.swift in Sources */,
CD86C22225F0DCCB00F38A16 /* PrecipitationView.swift in Sources */,
......
......@@ -12,7 +12,7 @@
<key>OneWeatherNotificationServiceExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>58</integer>
<integer>57</integer>
</dict>
<key>PG (Playground) 1.xcscheme</key>
<dict>
......
......@@ -2,9 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "group:OneWeatherUI/OneWeatherUI.xcodeproj">
</FileRef>
<FileRef
location = "group:OneWeatherAnalytics/OneWeatherAnalytics.xcodeproj">
</FileRef>
<FileRef
......
......@@ -9,7 +9,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>57</integer>
<integer>63</integer>
</dict>
<key>OneWeatherCorePlayground (Playground) 10.xcscheme</key>
<dict>
......@@ -86,7 +86,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>58</integer>
<integer>64</integer>
</dict>
<key>OneWeatherCorePlayground (Playground) 20.xcscheme</key>
<dict>
......@@ -149,7 +149,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>59</integer>
<integer>65</integer>
</dict>
<key>OneWeatherCorePlayground (Playground) 4.xcscheme</key>
<dict>
......@@ -198,14 +198,14 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
<integer>1</integer>
</dict>
<key>PG (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>66</integer>
<integer>59</integer>
</dict>
<key>PG (Playground) 10.xcscheme</key>
<dict>
......@@ -282,7 +282,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>67</integer>
<integer>60</integer>
</dict>
<key>PG (Playground) 20.xcscheme</key>
<dict>
......@@ -345,7 +345,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>68</integer>
<integer>61</integer>
</dict>
<key>PG (Playground) 4.xcscheme</key>
<dict>
......@@ -394,7 +394,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
</dict>
</dict>
......
{
"images" : [
{
"filename" : "promotion_flag.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
......@@ -272,3 +272,13 @@
// Ads
"ads.native.sponsored" = "Sponsored";
"ads.placeholder" = "Advertisment";
//Widget Promotion
"widget.promotion.widgets" = "widgets";
"widget.promotion.new" = "New";
"widget.promotion.desc" = "Stay on top of the weather by adding the latest 1weather widgets.";
"widget.promotion.selectList" = "Select from a list of";
"widget.promotion.sizes" = "sizes";
"widget.promotion.small" = "Small";
"widget.promotion.medium" = "Medium";
"widget.promotion.large" = "Large";
//
// PromotionHeaderView.swift
// 1Weather
//
// Created by Dmitry Stepanets on 29.06.2021.
//
import UIKit
@available(iOS 14, *)
class PromotionHeaderView: UIView {
//Private
private let plusImageView = UIImageView()
private let widgetLabel = UILabel()
private let flagView = UIView()
private let descriptionLabel = UILabel()
private let bottomLineView = UIView()
override init(frame: CGRect) {
super.init(frame: frame)
preparePlusImage()
prepareWidgetLabel()
prepareFlag()
prepareDescription()
prepareBottomLine()
updateUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
updateUI()
}
private func updateUI() {
switch interfaceStyle {
case .light:
plusImageView.tintColor = UIColor(hex: 0x26262b)
widgetLabel.textColor = UIColor(hex: 0x26262b)
descriptionLabel.textColor = UIColor(hex: 0x26262b)
case .dark:
plusImageView.tintColor = .white
widgetLabel.textColor = .white
descriptionLabel.textColor = .white
}
}
}
//MARK:- Prepare
@available(iOS 14, *)
private extension PromotionHeaderView {
func preparePlusImage() {
plusImageView.contentMode = .scaleAspectFit
plusImageView.image = UIImage(systemName: "plus.circle",
withConfiguration: UIImage.SymbolConfiguration(pointSize: 24,
weight: .regular))
addSubview(plusImageView)
plusImageView.snp.makeConstraints { make in
make.width.height.equalTo(25)
make.left.equalToSuperview().inset(18)
make.top.equalToSuperview()
}
}
func prepareWidgetLabel() {
widgetLabel.text = "widget.promotion.widgets".localized().capitalized
widgetLabel.font = .systemFont(ofSize: 24, weight: .bold)
addSubview(widgetLabel)
widgetLabel.snp.makeConstraints { make in
make.left.equalTo(plusImageView.snp.right).offset(6)
make.centerY.equalTo(plusImageView)
}
}
func prepareFlag() {
addSubview(flagView)
let flagImageView = UIImageView(image: UIImage(named: "promotion_flag"))
flagImageView.contentMode = .scaleAspectFill
flagView.addSubview(flagImageView)
let newLabel = UILabel()
newLabel.text = "widget.promotion.new".localized()
newLabel.textColor = .white
newLabel.font = UIFont.systemFont(ofSize: 12, weight: .medium)
flagView.addSubview(newLabel)
flagView.snp.makeConstraints { make in
make.width.equalTo(42)
make.height.equalTo(18)
make.centerY.equalTo(widgetLabel).offset(2)
make.left.equalTo(widgetLabel.snp.right).offset(15)
}
flagImageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
newLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().inset(7)
}
}
func prepareDescription() {
let paragraph = NSMutableParagraphStyle()
paragraph.lineSpacing = 18 - UIFont.systemFont(ofSize: 14, weight: .regular).lineHeight
descriptionLabel.attributedText = NSMutableAttributedString(string: "widget.promotion.desc".localized(),
attributes: [.font : UIFont.systemFont(ofSize: 14, weight: .regular),
.paragraphStyle : paragraph,
.kern : 0.79])
descriptionLabel.numberOfLines = 0
descriptionLabel.lineBreakMode = .byWordWrapping
addSubview(descriptionLabel)
descriptionLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(18)
make.top.equalTo(widgetLabel.snp.bottom).offset(5)
}
}
func prepareBottomLine() {
bottomLineView.backgroundColor = UIColor(hex: 0x979797).withAlphaComponent(0.15)
bottomLineView.layer.cornerRadius = 1.5
addSubview(bottomLineView)
bottomLineView.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(18)
make.height.equalTo(3)
make.bottom.equalToSuperview()
make.top.equalTo(descriptionLabel.snp.bottom).offset(10)
}
}
}
//
// PromotionSmallWidgetView.swift
// 1Weather
//
// Created by Dmitry Stepanets on 29.06.2021.
//
import UIKit
class PromotionSmallWidgetView: UIView {
private let widgetPlaceholder = UIView()
private let topLabel = UILabel()
private let horizontalLineView = UIView()
private let verticalLineView = UIView()
private let sizeNumberLabel = UILabel()
private let sizesLabel = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
preparePlaceholder()
prepareTopLabel()
prepareHorizontalLine()
prepareSizeNumberLabel()
prepareVerticalLine()
prepareSizesLabel()
updateUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
updateUI()
}
private func updateUI() {
switch interfaceStyle {
case .light:
topLabel.textColor = UIColor(hex: 0x26262b)
sizeNumberLabel.textColor = UIColor(hex: 0x26262b)
sizesLabel.textColor = UIColor(hex: 0x26262b)
horizontalLineView.backgroundColor = UIColor.black.withAlphaComponent(0.1)
verticalLineView.backgroundColor = UIColor.black.withAlphaComponent(0.1)
case .dark:
topLabel.textColor = .white
sizeNumberLabel.textColor = .white
sizesLabel.textColor = .white
horizontalLineView.backgroundColor = UIColor(hex: 0xffffff).withAlphaComponent(0.1)
verticalLineView.backgroundColor = UIColor(hex: 0xffffff).withAlphaComponent(0.1)
}
}
}
//MARK:- Prepare
private extension PromotionSmallWidgetView {
func preparePlaceholder() {
widgetPlaceholder.backgroundColor = .lightGray
addSubview(widgetPlaceholder)
widgetPlaceholder.snp.makeConstraints { make in
make.width.height.equalTo(158)
make.left.equalToSuperview().inset(18)
make.top.equalToSuperview().inset(16)
make.bottom.equalToSuperview()
}
}
func prepareTopLabel() {
let select = "widget.promotion.selectList".localized()
let widgets = "16 \("widget.promotion.widgets".localized())"
let attrString = NSMutableAttributedString(string: select + "\n" + widgets)
attrString.addAttribute(.font,
value: UIFont.systemFont(ofSize: 20, weight: .light),
range: .init(location: 0, length: select.count))
attrString.addAttribute(.font,
value: UIFont.systemFont(ofSize: 36, weight: .semibold),
range: .init(location: select.count, length: widgets.count + 1))
topLabel.numberOfLines = 0
topLabel.lineBreakMode = .byWordWrapping
topLabel.attributedText = attrString
addSubview(topLabel)
topLabel.snp.makeConstraints { make in
make.left.equalTo(widgetPlaceholder.snp.right).offset(14)
make.top.equalTo(widgetPlaceholder)
}
}
func prepareHorizontalLine() {
horizontalLineView.backgroundColor = UIColor(hex: 0xffffff).withAlphaComponent(0.1)
addSubview(horizontalLineView)
horizontalLineView.snp.makeConstraints { make in
make.height.equalTo(1)
make.left.right.equalTo(topLabel)
make.top.equalTo(topLabel.snp.bottom).offset(6)
}
}
func prepareSizeNumberLabel() {
sizeNumberLabel.text = "3\n\("widget.promotion.sizes".localized())"
sizeNumberLabel.textAlignment = .center
sizeNumberLabel.lineBreakMode = .byWordWrapping
sizeNumberLabel.numberOfLines = 0
sizeNumberLabel.font = UIFont.systemFont(ofSize: 20, weight: .light)
addSubview(sizeNumberLabel)
sizeNumberLabel.snp.makeConstraints { make in
make.left.equalTo(widgetPlaceholder.snp.right).offset(33)
make.top.equalTo(horizontalLineView.snp.bottom).offset(17)
}
}
func prepareVerticalLine() {
verticalLineView.backgroundColor = UIColor(hex: 0xffffff).withAlphaComponent(0.1)
addSubview(verticalLineView)
verticalLineView.snp.makeConstraints { make in
make.width.equalTo(1)
make.top.equalTo(horizontalLineView.snp.bottom).offset(10)
make.height.equalTo(70)
make.centerX.equalTo(horizontalLineView)
}
}
func prepareSizesLabel() {
let small = "widget.promotion.small".localized()
let medium = "widget.promotion.medium".localized()
let large = "widget.promotion.large".localized()
let attrString = NSMutableAttributedString(string: small + "\n" + medium + "\n" + large)
attrString.addAttribute(.font,
value: UIFont.systemFont(ofSize: 14, weight: .medium),
range: .init(location: 0, length: small.count))
attrString.addAttribute(.font,
value: UIFont.systemFont(ofSize: 20, weight: .semibold),
range: .init(location: small.count, length: medium.count + 1))
attrString.addAttribute(.font,
value: UIFont.systemFont(ofSize: 28, weight: .bold),
range: .init(location: small.count + medium.count + 1, length: large.count + 1))
sizesLabel.attributedText = attrString
sizesLabel.numberOfLines = 0
sizesLabel.lineBreakMode = .byWordWrapping
sizesLabel.textAlignment = .left
addSubview(sizesLabel)
sizesLabel.snp.makeConstraints { make in
make.left.equalTo(verticalLineView.snp.right).offset(13)
make.top.equalTo(verticalLineView)
make.right.equalToSuperview()
}
}
}
......@@ -5,16 +5,94 @@
// Created by Dmitry Stepanets on 24.06.2021.
//
import SwiftUI
import UIKit
struct WidgetPromotionController: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
@available(iOS 14, *)
class WidgetPromotionController: UIViewController {
//Private
private let controllerPanView = UIView()
private let closeButton = UIButton()
private let scrollView = UIScrollView()
private let stackView = UIStackView()
init() {
super.init(nibName: nil, bundle: nil)
prepareView()
preparePanView()
prepareCloseButton()
prepareScrollView()
prepareStackView()
updateUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc private func handleCloseButton() {
self.dismiss(animated: true)
}
private func updateUI() {
view.backgroundColor = ThemeManager.currentTheme.baseBackgroundColor
}
}
struct WidgetPromotionController_Previews: PreviewProvider {
static var previews: some View {
WidgetPromotionController()
//MARK:- Prepare
@available(iOS 14, *)
private extension WidgetPromotionController {
func prepareView() {
view.clipsToBounds = true
view.layer.cornerRadius = 24
view.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}
func preparePanView() {
controllerPanView.backgroundColor = UIColor(hex: 0x979797)
controllerPanView.layer.cornerRadius = 2
view.addSubview(controllerPanView)
controllerPanView.snp.makeConstraints { make in
make.width.equalTo(30)
make.height.equalTo(4)
make.top.equalToSuperview().inset(10)
make.centerX.equalToSuperview()
}
}
func prepareCloseButton() {
closeButton.addTarget(self, action: #selector(handleCloseButton), for: .touchUpInside)
closeButton.setImage(UIImage(systemName: "xmark.circle.fill"), for: .normal)
closeButton.imageView?.contentMode = .scaleAspectFit
closeButton.tintColor = UIColor(hex: 0xe4e4e4).withAlphaComponent(0.4)
view.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.top.equalToSuperview().inset(16)
make.right.equalToSuperview().inset(16)
}
}
func prepareScrollView() {
view.addSubview(scrollView)
scrollView.snp.makeConstraints { make in
make.left.bottom.right.equalToSuperview()
make.top.equalToSuperview().inset(36)
}
}
func prepareStackView() {
stackView.axis = .vertical
stackView.distribution = .fill
stackView.spacing = 0
stackView.addArrangedSubview(PromotionHeaderView())
stackView.addArrangedSubview(PromotionSmallWidgetView())
scrollView.addSubview(stackView)
stackView.snp.makeConstraints { make in
make.edges.width.equalToSuperview()
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
//
// OneWeatherUI.h
// OneWeatherUI
//
// Created by Dmitry Stepanets on 28.06.2021.
//
#import <Foundation/Foundation.h>
//! Project version number for OneWeatherUI.
FOUNDATION_EXPORT double OneWeatherUIVersionNumber;
//! Project version string for OneWeatherUI.
FOUNDATION_EXPORT const unsigned char OneWeatherUIVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OneWeatherUI/PublicHeader.h>
//
// ControllerPan.swift
// OneWeatherUI
//
// Created by Dmitry Stepanets on 25.06.2021.
//
import SwiftUI
@available(iOS 14.0, *)
struct ControllerPan: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
path.addRect(.init(origin: .zero, size: rect.size))
return path
}
}
//
// NewFlag.swift
// OneWeatherUI
//
// Created by Dmitry Stepanets on 25.06.2021.
//
import SwiftUI
@available(iOS 14.0, *)
struct NewFlag: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
path.move(to: .zero)
path.addLine(to: .init(x: rect.maxX, y: rect.minY))
path.addLine(to: .init(x: rect.midX + rect.midX * 0.8, y: rect.midY))
path.addLine(to: .init(x: rect.maxX, y: rect.maxY))
path.addLine(to: .init(x: rect.minY, y: rect.maxY))
return path
}
}
//
// WidgetPromotionController.swift
// 1Weather
//
// Created by Dmitry Stepanets on 24.06.2021.
//
import SwiftUI
@available(iOS 14, *)
struct WidgetPromotionController: View {
var body: some View {
VStack(spacing: 0) {
ControllerPan()
.fill(Color.yellow)
.frame(width: 30, height: 4, alignment: .center)
.cornerRadius(2)
.padding(.top, 15)
HStack(spacing: 0) {
Spacer()
Button {
} label: {
Image(systemName: "xmark.circle.fill")
.resizable()
.frame(width: 20, height: 20)
}
.padding(.trailing, 16)
}
HStack {
Image(systemName: "plus.circle")
.resizable()
.frame(width: 30, height: 30)
Text("Widgets")
.font(.system(size: 24, weight: .bold))
ZStack {
NewFlag()
.frame(width: 42, height: 18)
Text("New")
.font(.system(size: 12, weight: .medium))
.foregroundColor(.white)
}
.padding(.top, 4)
Spacer()
}
.padding([.leading, .trailing], 18)
Spacer()
}
.background(Color.gray)
.frame(maxWidth: .infinity,
maxHeight: .infinity,
alignment: .top)
}
}
@available(iOS 14, *)
struct WidgetPromotionController_Previews: PreviewProvider {
static var previews: some View {
WidgetPromotionController()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
//
// OneWeatherUITests.swift
// OneWeatherUITests
//
// Created by Dmitry Stepanets on 28.06.2021.
//
import XCTest
@testable import OneWeatherUI
class OneWeatherUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
......@@ -71,12 +71,6 @@ target 'OneWeatherCore' do
core_pods
end
target 'OneWeatherUI' do
project 'OneWeatherUI/OneWeatherUI.project'
shared_pods
core_pods
end
#CoreDataStorage
target 'CoreDataStorage' do
project 'CoreDataStorage/CoreDataStorage.project'
......
......@@ -288,6 +288,6 @@ SPEC CHECKSUMS:
Swarm: 95393cd52715744c94e3a8475bc20b4de5d79f35
XMLCoder: f884dfa894a6f8b7dce465e4f6c02963bf17e028
PODFILE CHECKSUM: a7cf1865135a0d048a67338b7802c97b0b637098
PODFILE CHECKSUM: aed7799e216485e9cfd7c34373bb1c7b7169dc41
COCOAPODS: 1.10.1
......@@ -288,6 +288,6 @@ SPEC CHECKSUMS:
Swarm: 95393cd52715744c94e3a8475bc20b4de5d79f35
XMLCoder: f884dfa894a6f8b7dce465e4f6c02963bf17e028
PODFILE CHECKSUM: a7cf1865135a0d048a67338b7802c97b0b637098
PODFILE CHECKSUM: aed7799e216485e9cfd7c34373bb1c7b7169dc41
COCOAPODS: 1.10.1
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/Localize-Swift" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/Swarm" "${PODS_CONFIGURATION_BUILD_DIR}/XMLCoder" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting/FirebaseABTesting.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Localize-Swift/Localize_Swift.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Swarm/Swarm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMLCoder/XMLCoder.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/Fyber_Marketplace_SDK" $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "FirebaseABTesting" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseCrashlytics" -framework "FirebaseInstallations" -framework "FirebaseRemoteConfig" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Localize_Swift" -framework "Security" -framework "Swarm" -framework "SystemConfiguration" -framework "UIKit" -framework "XMLCoder" -framework "nanopb"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/Localize-Swift" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/Swarm" "${PODS_CONFIGURATION_BUILD_DIR}/XMLCoder" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting/FirebaseABTesting.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Localize-Swift/Localize_Swift.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Swarm/Swarm.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMLCoder/XMLCoder.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/Fyber_Marketplace_SDK" $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
OTHER_LDFLAGS = $(inherited) -l"c++" -l"z" -framework "CoreTelephony" -framework "FBLPromises" -framework "FirebaseABTesting" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseCrashlytics" -framework "FirebaseInstallations" -framework "FirebaseRemoteConfig" -framework "Foundation" -framework "GoogleDataTransport" -framework "GoogleUtilities" -framework "Localize_Swift" -framework "Security" -framework "Swarm" -framework "SystemConfiguration" -framework "UIKit" -framework "XMLCoder" -framework "nanopb"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/..
......
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