Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-schibsted committed Jul 8, 2024
1 parent 86a1d02 commit 3a5969f
Show file tree
Hide file tree
Showing 204 changed files with 726 additions and 523 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

class AddressComponentDemoView: UIView, Demoable {

Expand All @@ -25,8 +26,8 @@ class AddressComponentDemoView: UIView, Demoable {
addSubview(addressComponentView)

NSLayoutConstraint.activate([
addressComponentView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
addressComponentView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
addressComponentView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
addressComponentView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
addressComponentView.centerYAnchor.constraint(equalTo: centerYAnchor)
])
}
Expand Down
3 changes: 2 additions & 1 deletion Demo/Sources/Components/BadgeView/BadgeDemoView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

final class BadgeDemoView: UIView, Demoable {

Expand All @@ -15,7 +16,7 @@ final class BadgeDemoView: UIView, Demoable {
}

func setup() {
let stackView = UIStackView(axis: .vertical, spacing: .spacingM, withAutoLayout: true)
let stackView = UIStackView(axis: .vertical, spacing: Warp.Spacing.spacing200, withAutoLayout: true)
stackView.alignment = .center
addSubview(stackView)
stackView.centerInSuperview()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import FinniversKit
import DemoKit
import Warp

class BrazePromotionDemoView: UIView, Demoable {
private lazy var viewModels: [BrazePromotionViewModel] = [titleTextImageButton, titleTextButton, titleText, titleTextBorderlessButton, titleTextBorderlessButtonPrimaryButton]
Expand Down Expand Up @@ -59,8 +60,8 @@ class BrazePromotionDemoView: UIView, Demoable {
addSubview(stackView)

NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
stackView.centerYAnchor.constraint(equalTo: centerYAnchor)
])

Expand Down
5 changes: 3 additions & 2 deletions Demo/Sources/Components/Button/Button/ButtonDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import UIKit
import FinniversKit
import DemoKit
import Warp

public class ButtonDemoView: UIView, Demoable {
let states: [UIControl.State] = [.normal, .disabled]
Expand All @@ -31,9 +32,9 @@ public class ButtonDemoView: UIView, Demoable {

private func setup() {
let scrollView = UIScrollView(withAutoLayout: true)
scrollView.contentInset = UIEdgeInsets(vertical: .spacingM, horizontal: .spacingL)
scrollView.contentInset = UIEdgeInsets(vertical: Warp.Spacing.spacing200, horizontal: .spacingL)

let verticalStack = UIStackView(axis: .vertical, spacing: .spacingM, withAutoLayout: true)
let verticalStack = UIStackView(axis: .vertical, spacing: Warp.Spacing.spacing200, withAutoLayout: true)

styles.forEach { styleTuple in
let buttonStyleStack = UIStackView(axis: .vertical, spacing: .spacingS, withAutoLayout: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

class CollapsibleContentDemoView: UIView {

Expand All @@ -17,7 +18,7 @@ class CollapsibleContentDemoView: UIView {
let stackView = UIStackView(withAutoLayout: true)
stackView.axis = .vertical
stackView.distribution = .fillEqually
stackView.spacing = .spacingM
stackView.spacing = Warp.Spacing.spacing200
(1...20).forEach({ index in
let label = Label(style: .body, withAutoLayout: true)
label.text = "Item \(index)"
Expand Down Expand Up @@ -54,7 +55,7 @@ class CollapsibleContentDemoView: UIView {
collapsibleContentView.configure(with: title, contentView: contentView)

scrollView.addSubview(collapsibleContentView)
collapsibleContentView.fillInSuperview(margin: .spacingM)
collapsibleContentView.fillInSuperview(margin: Warp.Spacing.spacing200)
collapsibleContentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, constant: -.spacingXL).isActive = true

self.collapsibleContentView = collapsibleContentView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

class ColumnListsDemoView: UIView, Demoable {
override init(frame: CGRect) {
Expand Down Expand Up @@ -88,8 +89,8 @@ class ColumnListsDemoView: UIView, Demoable {
columnListsView.configure(with: sampleData, numberOfColumns: numberOfColumnsForTraits(), style: .caption)
NSLayoutConstraint.activate([
columnListsView.centerYAnchor.constraint(equalTo: centerYAnchor),
columnListsView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
columnListsView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
columnListsView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
columnListsView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
])
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

class ContractActionDemoView: UIView {
private lazy var contractActionView: ContractActionView = {
Expand Down Expand Up @@ -58,9 +59,9 @@ extension ContractActionDemoView: TweakableDemo {
contractActionView.configure(
with: .requestAccessToContract,
topIcon: UIImage(named: .contract),
trailingImageTopConstant: .spacingM,
trailingImageTrailingConstant: -.spacingM,
contentSpacing: .spacingM,
trailingImageTopConstant: Warp.Spacing.spacing200,
trailingImageTrailingConstant: -Warp.Spacing.spacing200,
contentSpacing: Warp.Spacing.spacing200,
paragraphSpacing: 12
)
}
Expand Down
5 changes: 3 additions & 2 deletions Demo/Sources/Components/Disclaimer/DisclaimerDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

public class DisclaimerDemoView: UIView, Demoable {

Expand All @@ -25,8 +26,8 @@ public class DisclaimerDemoView: UIView, Demoable {

NSLayoutConstraint.activate([
disclaimerView.topAnchor.constraint(equalTo: topAnchor, constant: .spacingXL),
disclaimerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
disclaimerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM)
disclaimerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
disclaimerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200)
])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

class FavoriteButtonDemoView: UIView, Demoable {

Expand Down Expand Up @@ -34,8 +35,8 @@ class FavoriteButtonDemoView: UIView, Demoable {

NSLayoutConstraint.activate([
favoriteButtonView.centerYAnchor.constraint(equalTo: centerYAnchor),
favoriteButtonView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
favoriteButtonView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM)
favoriteButtonView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
favoriteButtonView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200)
])
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import DemoKit
import FinniversKit
import SwiftUI
import Warp

struct FrontPageTransactionListDemoView: View {
let models: [FrontPageTransactionViewModel]

var body: some View {
FrontPageTransactionListView(models: models)
.padding(.spacingM)
.padding(Warp.Spacing.spacing200)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import DemoKit
import FinniversKit
import SwiftUI
import Warp

struct FrontPageTransactionDemoView: View {
let model: FrontPageTransactionViewModel

var body: some View {
FrontPageTransactionView(model: model)
.padding(.spacingM)
.padding(Warp.Spacing.spacing200)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import FinniversKit
import DemoKit
import Warp

class HyperlinkTextViewDemoView: UIView {

Expand All @@ -27,8 +28,8 @@ class HyperlinkTextViewDemoView: UIView {

NSLayoutConstraint.activate([
hyperlinkTextView.centerYAnchor.constraint(equalTo: centerYAnchor),
hyperlinkTextView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
hyperlinkTextView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM)
hyperlinkTextView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
hyperlinkTextView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200)
])
}

Expand Down
5 changes: 3 additions & 2 deletions Demo/Sources/Components/Infobox/InfoboxDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

public class InfoboxDemoView: UIView, Demoable {
private lazy var stackView = UIStackView(axis: .vertical, spacing: .spacingL, distribution: .equalSpacing, withAutoLayout: true)
Expand Down Expand Up @@ -32,13 +33,13 @@ public class InfoboxDemoView: UIView, Demoable {
stackView.addArrangedSubviews(infoboxes)

scrollView.addSubview(stackView)
stackView.fillInSuperview(margin: .spacingM)
stackView.fillInSuperview(margin: Warp.Spacing.spacing200)

addSubview(scrollView)
scrollView.fillInSuperview()

NSLayoutConstraint.activate([
stackView.widthAnchor.constraint(equalTo: widthAnchor, constant: -.spacingM * 2)
stackView.widthAnchor.constraint(equalTo: widthAnchor, constant: -Warp.Spacing.spacing200 * 2)
])
}

Expand Down
5 changes: 3 additions & 2 deletions Demo/Sources/Components/JobApplyBox/JobApplyBoxDemoView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

class JobApplyBoxDemoView: UIView {

Expand All @@ -24,8 +25,8 @@ class JobApplyBoxDemoView: UIView {
let demoView = JobApplyBoxView(viewModel: viewModel, delegate: self, withAutoLayout: true)
addSubview(demoView)
NSLayoutConstraint.activate([
demoView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
demoView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
demoView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
demoView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
demoView.centerYAnchor.constraint(equalTo: centerYAnchor)
])

Expand Down
5 changes: 3 additions & 2 deletions Demo/Sources/Components/JobKeyInfo/JobKeyInfoDemoView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

class JobKeyInfoDemoView: UIView, Demoable {

Expand All @@ -21,8 +22,8 @@ class JobKeyInfoDemoView: UIView, Demoable {
private func setup() {
addSubview(demoView)
NSLayoutConstraint.activate([
demoView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
demoView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
demoView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
demoView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
demoView.centerYAnchor.constraint(equalTo: centerYAnchor)
])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

class LinkButtonListDemoView: UIView {
private lazy var linkListView: LinkButtonListView = {
Expand All @@ -27,8 +28,8 @@ class LinkButtonListDemoView: UIView {
private func setup() {
addSubview(linkListView)
NSLayoutConstraint.activate([
linkListView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
linkListView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
linkListView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
linkListView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
linkListView.centerYAnchor.constraint(equalTo: centerYAnchor)
])
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FinniversKit
import DemoKit
import Warp

class MapAddressButtonDemoView: UIView, Demoable {

Expand Down Expand Up @@ -27,9 +28,9 @@ class MapAddressButtonDemoView: UIView, Demoable {
addSubview(stackView)

NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: topAnchor, constant: .spacingM),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM)
stackView.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing200),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200)
])
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FinniversKit
import Foundation
import DemoKit
import Warp

class MonthAndYearPickerDemoView: UIView, Demoable {

Expand Down Expand Up @@ -74,18 +75,18 @@ class MonthAndYearPickerDemoView: UIView, Demoable {
addSubview(textField)

NSLayoutConstraint.activate([
currentDateLabel.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: .spacingM),
currentDateLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
currentDateLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),

textField.topAnchor.constraint(equalTo: currentDateLabel.bottomAnchor, constant: .spacingM),
textField.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
textField.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),

pickerView.topAnchor.constraint(equalTo: textField.bottomAnchor, constant: .spacingM),
pickerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM),
pickerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM),
pickerView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: .spacingM),
currentDateLabel.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: Warp.Spacing.spacing200),
currentDateLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
currentDateLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),

textField.topAnchor.constraint(equalTo: currentDateLabel.bottomAnchor, constant: Warp.Spacing.spacing200),
textField.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
textField.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),

pickerView.topAnchor.constraint(equalTo: textField.bottomAnchor, constant: Warp.Spacing.spacing200),
pickerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200),
pickerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200),
pickerView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: Warp.Spacing.spacing200),
])

setInitialDate()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import FinniversKit
import DemoKit
import Warp

class MultilineButtonDemoView: UIView, Demoable {
let states: [UIControl.State] = [.normal, .disabled]
Expand Down Expand Up @@ -30,9 +31,9 @@ class MultilineButtonDemoView: UIView, Demoable {

private func setup() {
let scrollView = UIScrollView(withAutoLayout: true)
scrollView.contentInset = UIEdgeInsets(vertical: .spacingM, horizontal: .spacingL)
scrollView.contentInset = UIEdgeInsets(vertical: Warp.Spacing.spacing200, horizontal: .spacingL)

let verticalStack = UIStackView(axis: .vertical, spacing: .spacingM, withAutoLayout: true)
let verticalStack = UIStackView(axis: .vertical, spacing: Warp.Spacing.spacing200, withAutoLayout: true)

styles.forEach { styleTuple in
let buttonStyleStack = UIStackView(axis: .vertical, spacing: .spacingS, withAutoLayout: true)
Expand Down
Loading

0 comments on commit 3a5969f

Please sign in to comment.