Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FulcrumOne committed Jun 3, 2023
0 parents commit 6d58489
Show file tree
Hide file tree
Showing 19 changed files with 665 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<<<<<<< HEAD
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
=======
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
>>>>>>> bfd2701 (Initial Commit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Mijick

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Navigattie",
platforms: [
.iOS(.v15)
],
products: [
.library(name: "Navigattie", targets: ["Navigattie"]),
],
targets: [
.target(name: "Navigattie", dependencies: [])
]
)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Navigattie

A description of this package.
17 changes: 17 additions & 0 deletions Sources/Navigattie/Configurables/TransitionAnimation.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// TransitionAnimation.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import Foundation

public enum TransitionAnimation {
case no
case dissolve
case horizontalSlide, verticalSlide
}
29 changes: 29 additions & 0 deletions Sources/Navigattie/Extensions/Foundation/Array++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// Array++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import Foundation

extension Array {
@inlinable mutating func append(_ newElement: Element, if prerequisite: Bool) { if prerequisite {
append(newElement)
}}
@inlinable mutating func removeLastExceptFirst() { if count > 1 {
removeLast()
}}
@inlinable mutating func removeAllExceptFirst() { if count > 1 {
removeLast(count - 1)
}}
@inlinable mutating func removeLastTo(elementWhere predicate: (Element) throws -> Bool) rethrows { if let index = try lastIndex(where: predicate) {
removeLast(count - index - 1)
}}
}
extension Array {
var isNextToLast: Element? { count >= 2 ? self[count - 2] : nil }
}
15 changes: 15 additions & 0 deletions Sources/Navigattie/Extensions/Foundation/Equatable++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Equatable++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import Foundation

extension Equatable {
func isOne(of other: Self?...) -> Bool { other.contains(self) }
}
13 changes: 13 additions & 0 deletions Sources/Navigattie/Extensions/Foundation/Error++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Error++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import Foundation

extension String: Error {}
15 changes: 15 additions & 0 deletions Sources/Navigattie/Extensions/Views/NavigatableView++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// NavigatableView++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import SwiftUI

public extension NavigatableView {
func implementNavigationView() -> some View { NavigationView(rootView: self) }
}
17 changes: 17 additions & 0 deletions Sources/Navigattie/Extensions/Views/UIApplication++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UIApplication++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import SwiftUI

extension UIApplication {
func hideKeyboard() {
sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
26 changes: 26 additions & 0 deletions Sources/Navigattie/Extensions/Views/UIScreen++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// UIScreen++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import SwiftUI

extension UIScreen {
static let width: CGFloat = main.bounds.size.width
static let height: CGFloat = main.bounds.size.height
static let safeArea: UIEdgeInsets = {
UIApplication.shared.connectedScenes
.filter({$0.activationState == .foregroundActive})
.map({$0 as? UIWindowScene})
.compactMap({$0})
.first?.windows
.filter({$0.isKeyWindow})
.first?
.safeAreaInsets ?? .zero
}()
}
22 changes: 22 additions & 0 deletions Sources/Navigattie/Extensions/Views/View++.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// View++.swift of Navigattie
//
// Created by Tomasz Kurylik
// - Twitter: https://twitter.com/tkurylik
// - Mail: [email protected]
//
// Copyright ©2023 Mijick. Licensed under MIT License.


import SwiftUI

public extension View {
@ViewBuilder func matchedGeometryEffect(id: String, properties: MatchedGeometryProperties = .frame, anchor: UnitPoint = .center, isSource: Bool = true) -> some View {
if let namespace = NavigationManager.shared.namespace { matchedGeometryEffect(id: id, in: namespace, properties: properties, anchor: anchor, isSource: isSource) }
else { self }
}
}

extension View {
func modify<V: View>(_ builder: (Self) -> V) -> some View { builder(self) }
}
Loading

0 comments on commit 6d58489

Please sign in to comment.