Skip to content

Commit

Permalink
Merge branch 'release/5.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed May 20, 2022
2 parents cfd2b13 + 64624ca commit 8fb77ea
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 115 deletions.
5 changes: 2 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ inherit_mode:

AllCops:
Exclude:
- 'Carthage/**/*'
- 'Demo/Carthage/**/*'
- 'vendor/**/*'
Include:
- 'fastlane/Pluginfile'
NewCops: enable

# this would cause errors with long lanes
Metrics/BlockLength:
Enabled: true
ExcludedMethods: ['platform', 'for_platform']
IgnoredMethods: ['platform', 'for_platform']

# Lane description and gem lines can be long
Layout/LineLength:
Expand Down
17 changes: 17 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
disabled_rules:
- identifier_name
- statement_position
- todo

line_length: 300

trailing_whitespace:
ignores_empty_lines: true
severity: warning

nesting:
type_level: 2

excluded:
- .build
- vendor
2 changes: 1 addition & 1 deletion Demo/Demo.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Version information
MARKETING_VERSION = 5.0.0
MARKETING_VERSION = 5.1.0

// Deployment targets
IPHONEOS_DEPLOYMENT_TARGET = 12.0
Expand Down
14 changes: 12 additions & 2 deletions Demo/Sources/Fonts/PlaygroundView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@ struct PlaygroundView: View {
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et \
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. \
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. \
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et \
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. \
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. \
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et \
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. \
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
"""
).srgFont(family: family, weight: .init(rawValue: weight), size: size, maximumSize: maximumSize)
)
.srgFont(family: family, weight: .init(rawValue: weight), size: size, maximumSize: maximumSize)

Spacer(minLength: 20)

VStack {
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ source 'https://rubygems.org'

gem 'fastlane'
gem 'xcode-install'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
77 changes: 38 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.3)
CFPropertyList (3.0.5)
rexml
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.502.0)
aws-sdk-core (3.121.0)
aws-partitions (1.554.0)
aws-sdk-core (3.126.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.48.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-kms (1.54.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.103.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-s3 (1.112.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
Expand All @@ -34,18 +35,19 @@ GEM
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.2)
excon (0.85.0)
faraday (1.7.2)
emoji_regex (3.2.3)
excon (0.91.0)
faraday (1.9.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
Expand All @@ -54,14 +56,17 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday_middleware (1.1.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.5)
fastlane (2.194.0)
fastimage (2.2.6)
fastlane (2.204.3)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -100,12 +105,10 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-trainer (0.4.1)
trainer (>= 0.7.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.11.0)
google-apis-androidpublisher_v3 (0.16.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
google-apis-core (0.4.2)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -114,49 +117,49 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.7.0)
google-apis-iamcredentials_v1 (0.10.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-playcustomapp_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.6.0)
google-apis-storage_v1 (0.11.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.1.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
google-cloud-errors (1.2.0)
google-cloud-storage (1.36.1)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (0.17.1)
googleauth (1.1.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.15)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.3)
jmespath (1.6.0)
json (2.6.1)
jwt (2.3.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.1)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
os (1.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
Expand All @@ -181,10 +184,7 @@ GEM
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
trailblazer-option (0.1.1)
trainer (0.9.1)
fastlane (>= 2.25.0)
plist (>= 3.1.0, < 4.0.0)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
Expand Down Expand Up @@ -216,7 +216,6 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-trainer
xcode-install

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription

struct ProjectSettings {
static let marketingVersion: String = "5.0.0"
static let marketingVersion: String = "5.1.0"
}

let package = Package(
Expand Down
45 changes: 23 additions & 22 deletions Sources/SRGAppearanceSwift/Font.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,7 @@ public extension SRGFont {
}

@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
public extension Text {
/**
* Wrapper class to observe content size category changes. Fonts created with `Font.custom(...)` initializers
* namely automatically reload `Text` displaying them, while this is not the case for fonts created with
* `Font.init()`.
*/
// TODO: If content size changes are automatically tracked for texts using custom fonts in future SwiftUI versions,
// remove this wrapper and return `Text` instead of `some View` from modifiers.
private struct SizeCategoryTracker<Content: View>: View {
private let content: () -> Content

@Environment(\.sizeCategory) private var sizeCategory

init(content: @escaping () -> Content) {
self.content = content
}

var body: some View {
content()
}
}

public extension View {
/**
* Applies a font with a predefined style to the receiver. The font scales according to an internally associated
* matching text style and the current accessibility settings.
Expand Down Expand Up @@ -139,3 +118,25 @@ public extension Text {
}
}
}

/**
* Wrapper class to observe content size category changes. Fonts created with `Font.custom(...)` initializers
* namely automatically reload `Text` displaying them, while this is not the case for fonts created with
* `Font.init()`.
*/
// TODO: If content size changes are automatically tracked for texts using custom fonts in future SwiftUI versions,
// remove this wrapper and return `Text` instead of `some View` from modifiers.
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
private struct SizeCategoryTracker<Content: View>: View {
private let content: () -> Content

@Environment(\.sizeCategory) private var sizeCategory

init(content: @escaping () -> Content) {
self.content = content
}

var body: some View {
content()
}
}
2 changes: 1 addition & 1 deletion Sources/SRGAppearanceSwift/Metrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
* A dynamic property that scales a numeric value, based on SRG SSR font styles (scaling curve, maximum value).
*/
@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
@propertyWrapper public struct SRGScaledMetric<Value>: DynamicProperty where Value : BinaryFloatingPoint {
@propertyWrapper public struct SRGScaledMetric<Value>: DynamicProperty where Value: BinaryFloatingPoint {
let value: Value
let style: SRGFont.Style

Expand Down
Loading

0 comments on commit 8fb77ea

Please sign in to comment.