Skip to content

Commit

Permalink
Merge pull request #2 from KITSSteveAnthony/master
Browse files Browse the repository at this point in the history
Show style in description
  • Loading branch information
dhardiman authored Feb 5, 2019
2 parents 7656643 + 07ac5bf commit e37f0b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
35 changes: 30 additions & 5 deletions Router/Destination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ extension PresentationHint: CustomStringConvertible {
switch self {
case .navigate:
return "navigate"
case .modal(let metrics):
let style = metrics.style != nil ? String(describing: metrics.style!) : "none"
return "modal - animated: \(metrics.animated), style: \(style)"
case .tab(let index):
case let .modal(metrics):
return "modal - animated: \(metrics.animated), style: \(metrics.style.styleDescription)"
case let .tab(index):
return "tab - index: \(index)"
case .replaceTab(let index, let shouldSwitch):
case let .replaceTab(index, shouldSwitch):
return "replaceTab - index: \(index), shouldSwitch: \(shouldSwitch)"
}
}
Expand Down Expand Up @@ -79,3 +78,29 @@ extension PresentationHint: Equatable {
}
}
}

extension Optional where Wrapped == UIModalPresentationStyle {
var styleDescription: String {
guard case let .some(style) = self else { return "none" }
switch style {
case .fullScreen:
return "fullScreen"
case .pageSheet:
return "pageSheet"
case .formSheet:
return "formSheet"
case .currentContext:
return "currentContext"
case .custom:
return "custom"
case .overFullScreen:
return "overFullScreen"
case .overCurrentContext:
return "overCurrentContext"
case .popover:
return "popover"
case .none:
return "none"
}
}
}
2 changes: 1 addition & 1 deletion Router/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit e37f0b0

Please sign in to comment.