Skip to content

Commit

Permalink
Remove magic keyboard observer initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleve committed Aug 29, 2024
1 parent edd0bb6 commit 1057724
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 76 deletions.
4 changes: 2 additions & 2 deletions BlueprintUILists.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.dependency 'ListableUI'
s.dependency 'BlueprintUI', *BLUEPRINT_VERSION

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

s.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'YES',
Expand All @@ -27,7 +27,7 @@ Pod::Spec.new do |s|
# These tests can only be run locally, because they depend on local pods.

s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'BlueprintUILists/Tests/**/*.{swift}'
test_spec.source_files = 'BlueprintUILists/Tests/**/*.swift'
test_spec.ios.resource_bundle = { 'BlueprintUIListsResources' => 'BlueprintUILists/Tests/Resources/**/*.*' }

test_spec.dependency 'BlueprintUICommonControls', *BLUEPRINT_VERSION
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Removed

- Removed "magic" behavior that automatically loaded our internal keyboard observer. You must now manually call `ListView.configure(with:)` early in your application's lifecycle.

### Changed

### Misc
Expand Down
3 changes: 3 additions & 0 deletions Demo/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import ListableUI


@UIApplicationMain
Expand All @@ -16,6 +17,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

ListView.configure(with: application)

let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = DemoNavigationController()

Expand Down
4 changes: 2 additions & 2 deletions ListableUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|

s.swift_versions = [LISTABLE_SWIFT_VERSION]

s.source_files = 'ListableUI/Sources/**/*.{swift,h,m}'
s.source_files = 'ListableUI/Sources/**/*.swift'
s.resource_bundle = { 'ListableUIResources' => 'ListableUI/Resources/**/*' }

s.weak_framework = 'SwiftUI'
Expand All @@ -27,7 +27,7 @@ Pod::Spec.new do |s|
# These tests can only be run locally, because they depend on local pods.

s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'ListableUI/Tests/**/*.{swift}'
test_spec.source_files = 'ListableUI/Tests/**/*.swift'
test_spec.ios.resource_bundle = { 'ListableUITestsResources' => 'ListableUI/Tests/Resources/**/*.*' }

test_spec.framework = 'XCTest'
Expand Down
9 changes: 6 additions & 3 deletions ListableUI/Sources/KeyboardObserver/KeyboardObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,13 @@ extension KeyboardObserver {

print(
"""
LISTABLE WARNING: The shared instance of the `KeyboardObserver` was not instantiated
during app startup. While not fatal, this could result in a list being created
that does not properly position itself to account for the keyboard, if the list is created
LISTABLE WARNING: The shared instance of the `KeyboardObserver` was not instantiated \
during app startup. While not fatal, this could result in a list being created \
that does not properly position itself to account for the keyboard, if the list is created \
while the keyboard is already visible.
Please ensure you invoke `ListView.configure(with: application)` before the first `ListView` \
is placed on screen to ensure proper keyboard handling.
"""
)
}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ let package = Package(
name: "ListableUI",
path: "ListableUI",
exclude: [
"Sources/KeyboardObserver/SetupKeyboardObserverOnAppStartup.m",
"Sources/Layout/Paged/PagedAppearance.monopic",
"Sources/ContentBounds/ListContentBounds.monopic",
"Sources/Layout/Table/TableAppearance.monopic",
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BlueprintUI: 1818f187a6be6c69266a4e30f03a6ad7755530e9
BlueprintUICommonControls: 6ceffc16822dea3d1910029aa87eed7a386e4e3b
BlueprintUILists: 799f21a75c76968f84ab768dcba0950ff53e23f8
BlueprintUILists: 5b96041d96e22a3f7d26398ae402f43124ba74da
EnglishDictionary: 2cf40d33cc1b68c4152a1cc69561aaf6e4ba0209
ListableUI: 04974e3cc04a2df7f93242b489431ea86e69329b
ListableUI: 5a583f04682acba8b773416d19dcba2f4bdb4404
Snapshot: 574e65b08c02491a541efbd2619c92cc26514d1c

PODFILE CHECKSUM: 2b979d4f2436d28af7c87b125b646836119b89b7
Expand Down

0 comments on commit 1057724

Please sign in to comment.