Skip to content

Commit

Permalink
Merge pull request #59 from PB-Digital/develop
Browse files Browse the repository at this point in the history
RELEASE: 1.5.1
  • Loading branch information
muradtries authored May 8, 2024
2 parents 792af3c + 2497ca5 commit ed6bc22
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: Build
uses: actions/checkout@v3

- run: xcodebuild -scheme PashaKit -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2'
- run: xcodebuild -scheme PashaKit -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0.1'
4 changes: 2 additions & 2 deletions Config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.5.0",
"release_notes": "Fixed Pasha Business issues"
"version": "1.5.1",
"release_notes": "Custom fonts exports and related swift files was removed"
}
15 changes: 1 addition & 14 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@ public let package = Package(

.target(name: "PashaKit", dependencies: [
.product(name: "InputMask", package: "input-mask-ios")
],
resources: [
.process("Fonts/SFProDisplayBold.otf"),
.process("Fonts/SFProDisplayLight.otf"),
.process("Fonts/SFProDisplayRegular.otf"),
.process("Fonts/SFProDisplayMedium.otf"),
.process("Fonts/SFProDisplaySemibold.otf"),
.process("Fonts/SFProTextBold.otf"),
.process("Fonts/SFProTextLight.otf"),
.process("Fonts/SFProTextRegular.otf"),
.process("Fonts/SFProTextMedium.otf"),
.process("Fonts/SFProTextSemibold.otf"),
]
),
]),
.testTarget(name: "PashaKitTests", dependencies: ["PashaKit"]),
],
swiftLanguageVersions: [
Expand Down
61 changes: 0 additions & 61 deletions Sources/PashaKit/Extensions/UIFont+Extensions.swift

This file was deleted.

Binary file removed Sources/PashaKit/Fonts/SFProDisplayBold.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProDisplayLight.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProDisplayMedium.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProDisplayRegular.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProDisplaySemibold.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProTextBold.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProTextLight.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProTextMedium.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProTextRegular.otf
Binary file not shown.
Binary file removed Sources/PashaKit/Fonts/SFProTextSemibold.otf
Binary file not shown.
41 changes: 26 additions & 15 deletions Sources/PashaKit/PBRowView/PBRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ open class PBRowView: UIView, PBSkeletonable {
}
}

/// Sets the color for the text of `subtitleLabel`.
///
/// By default text color of `subtitleLabel` is `.black` with alpha of `0.6`
///
public var subtitleTextColor: UIColor = .black.withAlphaComponent(0.6) {
didSet {
self.subtitleLabel.textColor = self.subtitleTextColor
}
}

/// Sets the font for `subtitleLabel`.
///
/// By default its font size is `15.0`.
Expand Down Expand Up @@ -281,6 +291,7 @@ open class PBRowView: UIView, PBSkeletonable {
///
/// Changing its value to `false` removes it from row view.
///
@available(*, deprecated, renamed: "isRightIconVisible")
public var isChevronIconVisible: Bool = true {
didSet {
if self.isChevronIconVisible {
Expand All @@ -290,18 +301,6 @@ open class PBRowView: UIView, PBSkeletonable {
}
}
}

/// The visual state of divider.
///
/// By default row view will be created with divider is hidden.
///
/// If you need a divider change it to `true`. It will show a divider with the thickness of `0.5 pt`.
///
public var showsDivider: Bool = false {
didSet {
self.divider.isHidden = !showsDivider
}
}

/// A boolean value for deciding whether right icon should be visible.
///
Expand All @@ -321,6 +320,18 @@ open class PBRowView: UIView, PBSkeletonable {
}
}

/// The visual state of divider.
///
/// By default row view will be created with divider is hidden.
///
/// If you need a divider change it to `true`. It will show a divider with the thickness of `0.5 pt`.
///
public var showsDivider: Bool = false {
didSet {
self.divider.isHidden = !showsDivider
}
}

private var leftPaddingForDivider: CGFloat {
return self.layoutMargins.left + self.leftViewSize.width + 12.0
}
Expand Down Expand Up @@ -422,7 +433,7 @@ open class PBRowView: UIView, PBSkeletonable {
label.translatesAutoresizingMaskIntoConstraints = false

label.font = UIFont.systemFont(ofSize: 15, weight: .regular)
label.textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)
label.textColor = self.subtitleTextColor
label.numberOfLines = 1
label.isSkeletonable = true

Expand Down Expand Up @@ -507,7 +518,7 @@ open class PBRowView: UIView, PBSkeletonable {

self.titleLabel.text = titleText
self.subtitleLabel.text = subtitleText
self.isChevronIconVisible = isChevronIconVisible
self.isRightIconVisible = isChevronIconVisible

self.layoutMargins = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)
self.setupViews()
Expand Down Expand Up @@ -545,7 +556,7 @@ open class PBRowView: UIView, PBSkeletonable {
public func setData(titleText: String? = nil, subtitleText: String? = nil, isChevronIconVisible: Bool = false) {
self.titleText = titleText
self.subtitleText = subtitleText
self.isChevronIconVisible = isChevronIconVisible
self.isRightIconVisible = isChevronIconVisible

self.setupViews()
}
Expand Down
32 changes: 16 additions & 16 deletions Sources/PashaKit/PashaBusiness/ActionViews/SMEActionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,7 @@ public class SMEActionView: UIView {

public convenience init(typeOfAction: SMEActionType = .normal(icon: .none, localizedTitleText: "")) {
self.init()

UIFont.registerCustomFonts()


self.typeOfAction = typeOfAction

self.prepareActionViewByType()
Expand All @@ -404,7 +402,6 @@ public class SMEActionView: UIView {
public convenience init(typeOfAction: SMEActionType = .normal(icon: .none, localizedTitleText: ""),
styleOfAction: SMEActionStyle = .none) {
self.init()

self.typeOfAction = typeOfAction
self.styleOfAction = styleOfAction
self.prepareActionViewByType()
Expand All @@ -413,8 +410,10 @@ public class SMEActionView: UIView {
self.setupViews(for: typeOfAction)
}

public convenience init(typeOfAction: SMEActionType = .normal(icon: .none, localizedTitleText: ""),
stateOfAction: SMEActionState = .normal) {
public convenience init(
typeOfAction: SMEActionType = .normal(icon: .none, localizedTitleText: ""),
stateOfAction: SMEActionState = .normal
) {
self.init()

self.typeOfAction = typeOfAction
Expand Down Expand Up @@ -669,24 +668,25 @@ public class SMEActionView: UIView {
switch self.typeOfAction {
case .normal(let icon, let localizedTitleText):
self.title = localizedTitleText
self.titleLabel.font = UIFont.sfProText(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.titleLabel.font = .systemFont(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.prepareActionViewByIcon(icon: icon)
case .detailed(let icon, let localizedTitleText, let localizedSubTitleText):
self.title = localizedTitleText
self.subTitle = localizedSubTitleText
self.titleLabel.font = UIFont.sfProText(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.subTitleLabel.font = UIFont.sfProText(ofSize: 13, weight: .regular) //TODO: Add as parameter
self.titleLabel.font = .systemFont(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.subTitleLabel.font = .systemFont(ofSize: 13, weight: .regular) //TODO: Add as parameter
self.subTitleLabel.textColor = UIColor.Colors.SMEGray
self.prepareActionViewByIcon(icon: icon)
case .footerLabel(let icon, let localizedTitleText, let localizedSubTitleText, let localizedDescriptionText):
self.title = localizedTitleText
self.subTitle = localizedSubTitleText
self.infoDescriptionText = localizedDescriptionText
self.titleLabel.font = UIFont.sfProText(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.subTitleLabel.font = UIFont.sfProText(ofSize: 13, weight: .regular) //TODO: Add as parameter
self.infoDescriptionLabel.font = UIFont.sfProText(ofSize: 12, weight: .regular) //TODO: Add as parameter
self.subTitleLabel.textColor = UIColor.Colors.SMEGray
self.infoDescriptionLabel.textColor = UIColor.Colors.SMEGray
self.titleLabel.font = .systemFont(ofSize: 17, weight: .medium) //TODO: Add as parameter
self.subTitleLabel.font = .systemFont(ofSize: 13, weight: .regular) //TODO: Add as parameter
self.infoDescriptionLabel.font = .systemFont(ofSize: 12, weight: .regular) //TODO: Add as parameter

self.subTitleLabel.textColor = UIColor.Colors.SMEGray // TODO: Color oposity should be 60%
self.infoDescriptionLabel.textColor = UIColor.Colors.SMEGray // TODO: Color oposity should be 60%
self.prepareActionViewByIcon(icon: icon)
}
}
Expand All @@ -704,13 +704,13 @@ public class SMEActionView: UIView {
case .chevron: break
case .chevronWithButton(let localizedText):
self.button.buttonTitle = localizedText
self.button.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .regular)
self.button.titleLabel?.font = .systemFont(ofSize: 17, weight: .regular)
case .chevronWithStatus(let localizedText, let status):
self.statusLabelView.typeOfLabel = .small(localizedText: localizedText)
self.statusLabelView.statusOfLabel = status
case .chevronWithText(let localizedText):
self.descriptionLabel.text = localizedText
self.descriptionLabel.font = UIFont.sfProText(ofSize: 17, weight: .regular)
self.descriptionLabel.font = .systemFont(ofSize: 17, weight: .regular)
self.descriptionLabel.textColor = UIColor.Colors.SMEGray
case .radioButton(let isSelected):
self.radioButtonStatus = isSelected
Expand Down
17 changes: 7 additions & 10 deletions Sources/PashaKit/PashaBusiness/Buttons/SMERoundButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ public class SMERoundButton: UIView {
///
/// By default button will be created with the tint color for selected button style.
///
public var buttonTitleWeight: CustomFontWeight = .semibold {
public var buttonTitleWeight: UIFont.Weight = .semibold {
didSet {
self.titleLabel.font = UIFont.sfProText(ofSize: 13, weight: buttonTitleWeight)
self.titleLabel.font = .systemFont(ofSize: 13, weight: buttonTitleWeight)
}
}

Expand Down Expand Up @@ -279,8 +279,7 @@ public class SMERoundButton: UIView {

public convenience init(typeOfButton: SMERoundButtonType = .plain) {
self.init()

UIFont.registerCustomFonts()

self.typeOfButton = typeOfButton
self.stateOfButton = .normal

Expand All @@ -294,9 +293,7 @@ public class SMERoundButton: UIView {
public convenience init(typeOfButton: SMERoundButtonType = .plain,
stateOfButton: SMERoundButtonState) {
self.init()

UIFont.registerCustomFonts()


self.typeOfButton = typeOfButton
self.prepareButtonByType()
self.stateOfButton = stateOfButton
Expand Down Expand Up @@ -417,13 +414,13 @@ public class SMERoundButton: UIView {
private func prepareButtonByState() {
switch self.stateOfButton {
case .normal:
self.titleLabel.font = UIFont.sfProText(ofSize: 13, weight: self.buttonTitleWeight)
self.titleLabel.font = .systemFont(ofSize: 13, weight: self.buttonTitleWeight)
self.iconBackgroundColor = self.theme.getPrimaryColor()
self.iconWrapperView.backgroundColor = self.theme.getPrimaryColor()
case .disabled:
self.titleLabel.font = UIFont.sfProText(ofSize: 13, weight: .semibold)
self.titleLabel.font = .systemFont(ofSize: 13, weight: .semibold)
self.titleLabel.textColor = UIColor.Colors.SMEGray
self.disableTitleLabel.font = UIFont.sfProText(ofSize: 11, weight: .medium)
self.disableTitleLabel.font = .systemFont(ofSize: 11, weight: .medium)
self.disableTitleLabel.textColor = .white
self.iconBackgroundColor = UIColor.Colors.SMEBackgroundGray
}
Expand Down
13 changes: 5 additions & 8 deletions Sources/PashaKit/PashaBusiness/Buttons/SMEUIButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ public class SMEUIButton: UIButton {
///
public convenience init(localizableTitle: String, styleOfButton: SMEUIButtonStyle = .filled) {
self.init(type: .system)
UIFont.registerCustomFonts()
self.setupDefaults()
self.setTitle(localizableTitle, for: .normal)
self.styleOfButton = styleOfButton
Expand All @@ -214,7 +213,6 @@ public class SMEUIButton: UIButton {

public convenience init(localizableTitle: String, typeOfButton: SMEUIButtonType) {
self.init(type: .system)
UIFont.registerCustomFonts()
self.setupDefaults()
self.setTitle(localizableTitle, for: .normal)
self.buttonTitle = localizableTitle
Expand All @@ -223,29 +221,28 @@ public class SMEUIButton: UIButton {
}

public convenience init() {
UIFont.registerCustomFonts()
self.init(localizableTitle: "")
}

private func prepareButtonByStyle() {
switch self.styleOfButton {
case .plain:
self.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .semibold)
self.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold)
self.baseBackgroundColor = .clear
self.buttonTintColor = self.theme.getPrimaryColor()
self.borderColor = UIColor.clear
case .tinted:
self.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .semibold)
self.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold)
self.baseBackgroundColor = self.theme.getPrimaryColor().withAlphaComponent(0.1)
self.buttonTintColor = self.theme.getPrimaryColor()
self.borderColor = self.theme.getPrimaryColor().withAlphaComponent(0.1)
case .filled:
self.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .semibold)
self.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold)
self.baseBackgroundColor = self.theme.getPrimaryColor()
self.buttonTintColor = UIColor.white
self.borderColor = self.theme.getPrimaryColor()
case .outlined:
self.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .semibold)
self.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold)
self.baseBackgroundColor = .clear
self.borderColor = self.theme.getPrimaryColor()
self.buttonTintColor = self.theme.getPrimaryColor()
Expand Down Expand Up @@ -303,7 +300,7 @@ public class SMEUIButton: UIButton {
self.layer.masksToBounds = true
self.layer.borderWidth = 1.0
self.translatesAutoresizingMaskIntoConstraints = false
self.titleLabel?.font = UIFont.sfProText(ofSize: 17, weight: .bold)
self.titleLabel?.font = .systemFont(ofSize: 17, weight: .bold)
self.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 8)
NSLayoutConstraint.activate([
self.heightAnchor.constraint(equalToConstant: 56)
Expand Down
Loading

0 comments on commit ed6bc22

Please sign in to comment.