Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into kve/element-usage-imp…
Browse files Browse the repository at this point in the history
…rovements

* origin/main: (123 commits)
  Update CHANGELOG.md (#508)
  Revert "Supplementary Tracking Fixes (#433)"
  Revert "Force layout before appear, to avoid animated updates (#505)"
  Force layout before appear, to avoid animated updates (#505)
  Update workaround versions (#506)
  Fix supplementary view + contained first responder reuse issue (#507)
  Supplementary Tracking Fixes (#433)
  Release 13.0.0 (#504)
  Update KeyboardObserver (#499)
  CONV-1435: Gravity layout frame change fix - Before: Layout gravity doesn't take into account frame changes. For example, when the orientation changes the scroll position (relative to the bottom) changes - After: Layout gravity takes frame changes into account so the when the frame changes the scroll position relative to the bottom remains unchanged
  Release 12.0.0 (#501)
  CONV-1435: Add scroll indicator insets to customScrollViewInsets (#500)
  CONV-1435: Gravity layout - Adds a new Chat App demo and a new behavior called verticalLayoutGravity.  When verticalLayoutGravity is set to bottom, scrolling works the way you would expect for a messaging app.
  expose onKeyboardFrameWillChange on ListProperties
  onKeyboardFrameWillChange: Improve CHANGELOG, DocC
  CONV-1435: Custom keyboard adjustment mode - Adds a .custom KeyboardAdjustmentMode to fully customize inset behavior
  remove contentOffset from isContentScrollable calculation, improve comment
  Add ListView#isContentScrollable property - Add this property to ListView. It will be used in conjunction with upcoming so-called gravity scrolling changes to workaround an animation issue with paging
  Update CI script to reference the `xcodesorg/made/xcodes` package for installing simulator runtimes. (#494)
  Swipe Action Updates (#489)
  ...
  • Loading branch information
kyleve committed Oct 24, 2023
2 parents d00c534 + 35b49e3 commit dadf9dd
Show file tree
Hide file tree
Showing 614 changed files with 142,199 additions and 75,022 deletions.
157 changes: 68 additions & 89 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# https://github.com/actions/cache/blob/ff937cc95032836a535d249de4ce2fc52aeae834/examples.md


Expand All @@ -9,103 +10,82 @@ on:

jobs:

ios_15:
name: iOS 15
spm:
name: Swift Package Manager

runs-on: macos-11
runs-on: macos-12

steps:
- name: Switch To Xcode 13.1
run: sudo xcode-select -switch /Applications/Xcode_13.1.app
- name: Switch To Xcode 14.2
run: sudo xcode-select -switch /Applications/Xcode_14.2.app

- name: Checkout repository
uses: actions/checkout@v1

# Build Caching

- name: Cache Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Cache Cocoapods
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
# Install & Build
# Build

- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Build
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.0-simulator"

- name: Pod Install
run: bundle exec pod install --repo-update
ios_16:
name: iOS 16

- name: Run Tests
run: Scripts/run_ios15_tests.sh
runs-on: macos-12

ios_14:
name: iOS 14
steps:
- name: Switch To Xcode 14.2
run: sudo xcode-select -switch /Applications/Xcode_14.2.app

runs-on: macos-11
- name: Checkout repository
uses: actions/checkout@v1

steps:
- name: Switch To Xcode 12.5.1
run: sudo xcode-select -switch /Applications/Xcode_12.5.1.app
# Build Caching

- name: Checkout repository
uses: actions/checkout@v1
- name: Cache Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Build Caching

- name: Cache Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Cache Cocoapods
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Cache Cocoapods
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
# Install & Build

# Install & Build
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Pod Install
run: bundle exec pod install --repo-update

- name: Pod Install
run: bundle exec pod install --repo-update
- name: Run Tests
run: Scripts/run_ios16_tests.sh

- name: Run Tests
run: Scripts/run_ios14_tests.sh
ios_15:
name: iOS 15

runs-on: macos-12

ios_13:
name: iOS 13
steps:
- name: Switch To Xcode 14
run: sudo xcode-select -switch /Applications/Xcode_14.2.app

runs-on: macos-11
- name: Install xcodes
run: brew install aria2 xcodesorg/made/xcodes

steps:
- name: Switch To Xcode 12.5.1
run: sudo xcode-select -switch /Applications/Xcode_12.5.1.app
- name: Install iOS ${{ matrix.sdk }}
run: sudo xcodes runtimes install "iOS 15.2"

- name: Checkout Repository
- name: Checkout repository
uses: actions/checkout@v1

# Build Caching
Expand All @@ -128,31 +108,33 @@ jobs:
# Install & Build

- name: Bundle Install
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Pod Install
run: bundle exec pod install --repo-update

- name: Install iOS 13.2
run: xcversion simulators --install="iOS 13.2"

- name: Run Tests
run: Scripts/run_ios13_tests.sh

run: Scripts/run_ios15_tests.sh

ios_12:
name: iOS 12
ios_14:
name: iOS 14

runs-on: macos-11
runs-on: macos-12

steps:
- name: Switch To Xcode 12.5.1
run: sudo xcode-select -switch /Applications/Xcode_12.5.1.app
- name: Switch To Xcode 14
run: sudo xcode-select -switch /Applications/Xcode_14.2.app

- name: Install xcodes
run: brew install aria2 xcodesorg/made/xcodes

- name: Install iOS ${{ matrix.sdk }}
run: sudo xcodes runtimes install "iOS 14.5"

- name: Checkout Repository
- name: Checkout repository
uses: actions/checkout@v1

# Build Caching
Expand All @@ -175,16 +157,13 @@ jobs:
# Install & Build

- name: Bundle Install
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Pod Install
run: bundle exec pod install --repo-update

- name: Install iOS 12.1
run: xcversion simulators --install="iOS 12.1"

- name: Run Tests
run: Scripts/run_ios12_tests.sh
run: Scripts/run_ios14_tests.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DerivedData/
*.perspectivev3
!default.perspectivev3
xcuserdata/
.swiftpm/**/*.xcworkspace

## Other
*.moved-aside
Expand Down
14 changes: 9 additions & 5 deletions BlueprintUILists.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ require_relative 'version'
Pod::Spec.new do |s|
s.name = 'BlueprintUILists'
s.version = LISTABLE_VERSION
s.summary = 'Declarative list views for iOS apps that deploy back to iOS 11.0.'
s.summary = 'Declarative list views for iOS apps that deploy back to iOS 14.0.'
s.homepage = 'https://github.com/kyleve/Listable'
s.license = 'Apache License, Version 2.0'
s.author = { 'Kyle' => '[email protected]' }
s.source = { git: 'https://github.com/kyleve/Listable.git', tag: "#{s.version}" }

s.ios.deployment_target = '12.0'
s.ios.deployment_target = LISTABLE_IOS_DEPLOYMENT_TARGET

s.swift_versions = ['5.4']
s.swift_versions = [LISTABLE_SWIFT_VERSION]

s.dependency 'ListableUI'
s.dependency 'BlueprintUI'
s.dependency 'BlueprintUI', *BLUEPRINT_VERSION

s.source_files = 'BlueprintUILists/Sources/**/*.{swift}'

s.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'YES',
}

unless ENV['LISTABLE_PUBLISHING']

# These tests can only be run locally, because they depend on local pods.
Expand All @@ -26,7 +30,7 @@ Pod::Spec.new do |s|
test_spec.source_files = 'BlueprintUILists/Tests/**/*.{swift}'
test_spec.ios.resource_bundle = { 'BlueprintUIListsResources' => 'BlueprintUILists/Tests/Resources/**/*.*' }

test_spec.dependency 'BlueprintUICommonControls'
test_spec.dependency 'BlueprintUICommonControls', *BLUEPRINT_VERSION

test_spec.framework = 'XCTest'

Expand Down
55 changes: 52 additions & 3 deletions BlueprintUILists/Sources/BlueprintHeaderFooterContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ where
}


extension Environment {

/// The `ApplyHeaderFooterContentInfo` which was passed to the `HeaderFooter` before it was
/// last displayed or updated. Nil if not in a Listable `HeaderFooter`.
public internal(set) var applyHeaderFooterContentInfo : ApplyHeaderFooterContentInfo? {
get { self[ApplyHeaderFooterContentInfoKey.self] }
set { self[ApplyHeaderFooterContentInfoKey.self] = newValue }
}

private enum ApplyHeaderFooterContentInfoKey : EnvironmentKey {
static let defaultValue : ApplyHeaderFooterContentInfo? = nil
}
}


public extension BlueprintHeaderFooterContent
{
//
Expand All @@ -113,9 +128,32 @@ public extension BlueprintHeaderFooterContent
for reason: ApplyReason,
with info: ApplyHeaderFooterContentInfo
) {
views.content.element = self.elementRepresentation.wrapInBlueprintEnvironmentFrom(environment: info.environment)
views.background.element = self.background?.wrapInBlueprintEnvironmentFrom(environment: info.environment)
views.pressed.element = self.pressedBackground?.wrapInBlueprintEnvironmentFrom(environment: info.environment)

views.content.element = self
.elementRepresentation
.adaptedEnvironment(with: info)

if let element = self
.background?
.adaptedEnvironment(with: info)
{
/// Load the `background` view and assign our element update.
views.background.element = element
} else {
/// If there's no element, clear out any past element, but only if the view was loaded.
views.backgroundIfLoaded?.element = nil
}

if let element = self
.pressedBackground?
.adaptedEnvironment(with: info)
{
/// Load the `pressedBackground` view and assign our element update.
views.pressedBackground.element = element
} else {
/// If there's no element, clear out any past element, but only if the view was loaded.
views.pressedBackgroundIfLoaded?.element = nil
}
}

static func createReusableContentView(frame: CGRect) -> ContentView {
Expand All @@ -137,3 +175,14 @@ public extension BlueprintHeaderFooterContent
return view
}
}


fileprivate extension Element {

func adaptedEnvironment(with info : ApplyHeaderFooterContentInfo) -> Element {
self.adaptedEnvironment { env in
env = info.environment.blueprintEnvironment
env.applyHeaderFooterContentInfo = info
}
}
}
Loading

0 comments on commit dadf9dd

Please sign in to comment.