Skip to content

Commit

Permalink
2.0 - better stability (#46)
Browse files Browse the repository at this point in the history
* ⚡ WIP

* ⚡ WIP

* 🌲 Update

* Rename

* Update

* Clean

* 🌲 Update

* 🌲 Update

* Rename

* Clean

* 🌲 Update

* Cleanup trackingState

* 🌲 Update

* clean up

* Update Position struct

* 🌲 Update

* Update state

* make scrolling better

* Fix scrollView

* Cleanup

* 🌲 Update

* wrapping up the configuration

* 🌲 Update

* Update workflow file

* Update Demo

* 🌲 Update

* Update scroll indicator visibility

* update animation

* Update self-sizing update

* Fix strange animation

* Add text input demo

* 🌲 Update

* fix pan-direction

* 🌲 Update

* Update Logger

* Add handlers
  • Loading branch information
muukii authored Sep 26, 2021
1 parent 62a41bd commit 5117a74
Show file tree
Hide file tree
Showing 26 changed files with 2,372 additions and 1,258 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/CocoaPods-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: cocoapods-deploy
on:
push:
tags:
- '*'
- "*"

jobs:
build:
runs-on: macOS-latest
runs-on: macOS-11
steps:
- uses: maxim-lobanov/setup-xcode@v1.1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.3'
- uses: actions/checkout@v2
xcode-version: "12.5"
- uses: actions/checkout@v2
- name: Deploy
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/CocoaPods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ on: [push]

jobs:
build:

runs-on: macos-latest
runs-on: macos-11

steps:
- uses: maxim-lobanov/setup-xcode@v1.1
with:
xcode-version: "12.3"
- uses: actions/checkout@v2
- name: Lint Cocoapods
run: pod lib lint --allow-warnings
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "12.5"
- uses: actions/checkout@v2
- name: Lint Cocoapods
run: pod lib lint --allow-warnings
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.

4 changes: 2 additions & 2 deletions Rideau.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Rideau"
s.version = '1.3.0'
s.swift_version = "5.3"
s.version = '2.0.0'
s.swift_version = "5.4"
s.summary = "A vertical drawer with fluid user interface."

s.homepage = "https://github.com/muukii/Rideau"
Expand Down
70 changes: 55 additions & 15 deletions Rideau.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions Rideau.xcodeproj/xcshareddata/xcschemes/RideauDemo2.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B2B870D26BA88D100887DC8"
BuildableName = "RideauDemo2.app"
BlueprintName = "RideauDemo2"
ReferencedContainer = "container:Rideau.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B2B870D26BA88D100887DC8"
BuildableName = "RideauDemo2.app"
BlueprintName = "RideauDemo2"
ReferencedContainer = "container:Rideau.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "RIDEAU_DEBUG"
value = ""
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B2B870D26BA88D100887DC8"
BuildableName = "RideauDemo2.app"
BlueprintName = "RideauDemo2"
ReferencedContainer = "container:Rideau.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 1 addition & 9 deletions Rideau/InternalUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if canImport(UIKit)
import UIKit

func _getActualContentInset(from scrollView: UIScrollView) -> UIEdgeInsets {
Expand All @@ -32,18 +31,11 @@ func _getActualContentInset(from scrollView: UIScrollView) -> UIEdgeInsets {
}
}

func debugLog(_ items: Any...) {
#if DEBUG
print(items)
#endif
}
#endif

extension NSLayoutConstraint {

@discardableResult
func setInternalIdentifier(_ string: String) -> NSLayoutConstraint {
self.identifier = "BoxLayout." + string
self.identifier = "Rideau." + string
return self
}

Expand Down
53 changes: 53 additions & 0 deletions Rideau/Logger.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import UIKit
import os.log

enum Log {

static func debug(_ log: OSLog, _ object: Any...) {
if #available(iOS 12.0, *) {
os_log(.debug, log: log, "%@", object.map { "\($0)" }.joined(separator: " "))
}
}

static func error(_ log: OSLog, _ object: Any...) {
if #available(iOS 12.0, *) {
os_log(.error, log: log, "%@", object.map { "\($0)" }.joined(separator: " "))
}
}

}

extension OSLog {

private static let isDebugEnabled: Bool = {
ProcessInfo().environment["RIDEAU_DEBUG"] != nil
}()

private static func makeLogger(category: String) -> OSLog {
#if DEBUG
if isDebugEnabled {
return OSLog.init(subsystem: "Rideau", category: category)
} else {
return .disabled
}
#else
return .disabled
#endif
}

static let handlers: OSLog = {
return makeLogger(category: "🚕 handlers")
}()

static let pan: OSLog = {
return makeLogger(category: "👆pan")
}()

static let scrollView: OSLog = {
return makeLogger(category: "🎞 ScrollView")
}()

static let animation: OSLog = {
return makeLogger(category: "🕹 Animation")
}()
}
74 changes: 0 additions & 74 deletions Rideau/RideauContainerBodyType.swift

This file was deleted.

Loading

0 comments on commit 5117a74

Please sign in to comment.