Skip to content

Commit

Permalink
Add spm support (#16)
Browse files Browse the repository at this point in the history
* Add spm support

* Update podspec

* Add missing imports
  • Loading branch information
sambae authored Oct 5, 2022
1 parent dc3e22a commit 65eebfd
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "StyledText",
platforms: [
.iOS(.v12)
],
products: [
.library(
name: "StyledText",
targets: ["StyledText"])
],
dependencies: [],
targets: [
.target(
name: "StyledText",
dependencies: [],
path: "Sources")
],
swiftLanguageVersions: [.v5]
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#if canImport(UIKit)

import UIKit

public protocol DynamicTypeControllerDelegate: class {
public protocol DynamicTypeControllerDelegate: AnyObject {
func preferredContentSizeCategoryDidUpdate(controller: DynamicTypeController, newCategory: UIContentSizeCategory)
}

Expand Down Expand Up @@ -114,3 +116,5 @@ private extension UIContentSizeCategory {
}
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if canImport(UIKit)

import UIKit

open class StyledButton: UIButton {
Expand Down Expand Up @@ -81,3 +83,5 @@ open class StyledButton: UIButton {
updateStyles()
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if canImport(UIKit)

import UIKit

public class StyledLabel: UILabel {
Expand Down Expand Up @@ -44,3 +46,5 @@ public class StyledLabel: UILabel {
super.attributedText = styledText.styledAttributedStringValue
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if canImport(UIKit)

import Foundation

public protocol StyledText {
Expand Down Expand Up @@ -48,3 +50,5 @@ public struct StyledAttributedString: StyledText {
return mutableString
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if canImport(UIKit)

import UIKit

open class StyledTextView: UITextView {
Expand Down Expand Up @@ -44,3 +46,5 @@ open class StyledTextView: UITextView {
super.attributedText = styledText.styledAttributedStringValue
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Foundation
#if canImport(UIKit)

import UIKit

public protocol TextStyleDefaultsGenerator {
static func defaultKern(for font: UIFont) -> CGFloat?
Expand Down Expand Up @@ -133,3 +135,5 @@ public struct TextStyle {
dynamicTypeBehavior: dynamicTypeBehavior)
}
}

#endif
File renamed without changes.
8 changes: 4 additions & 4 deletions StyledText.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'StyledText'
s.version = '1.3.0'
s.version = '1.4.0'
s.summary = 'Declarative text styles and simple Dynamic Type support for iOS'
s.description = <<-DESC
StyledText is a library that simplifies styling dynamic text in iOS applications. Instead of having to use attributed strings every time you need to update text, you can declaratively set a text style on your labels. When the text of the label is updated, the label uses the preset style.
Expand All @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'huebnerob' => '[email protected]' }
s.source = { :git => 'https://github.com/blueapron/styled-text.git', :tag => 'v' + s.version.to_s }
s.ios.deployment_target = '10.0'
s.swift_version = '5.0'
s.source_files = 'StyledText/Classes/**/*'
s.ios.deployment_target = '12.0'
s.swift_version = '5.7'
s.source_files = 'Sources/StyledText/Classes/**/*'
s.frameworks = 'UIKit'
end
Empty file removed StyledText/Classes/.gitkeep
Empty file.

0 comments on commit 65eebfd

Please sign in to comment.