-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from juandahurt/swift-ui
feat: add basic components
- Loading branch information
Showing
62 changed files
with
1,653 additions
and
14 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
PYLayoutDemo/PYLayoutDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...youtDemo/PYLayoutDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
16 changes: 16 additions & 0 deletions
16
...youtDemo/PYLayoutDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "Kingfisher", | ||
"repositoryURL": "https://github.com/onevcat/Kingfisher.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "59eb199fdb8dd47733624e8b0277822d0232579e", | ||
"version": "7.2.2" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// AppDelegate.swift | ||
// PYLayoutDemo | ||
// | ||
// Created by Juan Hurtado on 13/05/22. | ||
// | ||
|
||
import UIKit | ||
import PYLayout | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
|
||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
PYLayoutManager.shared.configure() | ||
return true | ||
} | ||
|
||
// MARK: UISceneSession Lifecycle | ||
|
||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { | ||
// Called when a new scene session is being created. | ||
// Use this method to select a configuration to create the new scene with. | ||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
|
||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { | ||
// Called when the user discards a scene session. | ||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. | ||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return. | ||
} | ||
|
||
|
||
} | ||
|
11 changes: 11 additions & 0 deletions
11
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
158 changes: 158 additions & 0 deletions
158
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "notification-icon@2x.png", | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"filename" : "notification-icon@3x.png", | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"filename" : "icon-small.png", | ||
"idiom" : "iphone", | ||
"scale" : "1x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"filename" : "icon-small@2x.png", | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"filename" : "icon-small@3x.png", | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"filename" : "icon-40@2x.png", | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"filename" : "icon-40@3x.png", | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"filename" : "icon.png", | ||
"idiom" : "iphone", | ||
"scale" : "1x", | ||
"size" : "57x57" | ||
}, | ||
{ | ||
"filename" : "icon@2x.png", | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "57x57" | ||
}, | ||
{ | ||
"filename" : "icon-60@2x.png", | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"filename" : "icon-60@3x.png", | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"filename" : "notification-icon~ipad.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"filename" : "notification-icon~ipad@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"filename" : "icon-small.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"filename" : "icon-small@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"filename" : "icon-40.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"filename" : "icon-40@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"filename" : "icon-small-50.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "50x50" | ||
}, | ||
{ | ||
"filename" : "icon-small-50@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "50x50" | ||
}, | ||
{ | ||
"filename" : "icon-72.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "72x72" | ||
}, | ||
{ | ||
"filename" : "icon-72@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "72x72" | ||
}, | ||
{ | ||
"filename" : "icon-76.png", | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"filename" : "icon-76@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"filename" : "icon-83.5@2x.png", | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "83.5x83.5" | ||
}, | ||
{ | ||
"filename" : "ios-marketing.png", | ||
"idiom" : "ios-marketing", | ||
"scale" : "1x", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.05 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.92 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.9 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.9 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.35 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.75 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.39 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.96 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.7 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.06 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.3 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-small-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.45 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-small-50@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+797 Bytes
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-small@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.17 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon-small@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.45 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.79 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/icon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.9 KB
PYLayoutDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/ios-marketing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.05 KB
...utDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/notification-icon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
...utDemo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/notification-icon@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+610 Bytes
...Demo/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.05 KB
...o/PYLayoutDemo/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
PYLayoutDemo/PYLayoutDemo/Base.lproj/LaunchScreen.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="EHf-IW-A2E"> | ||
<objects> | ||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="53" y="375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// ButtonExample.swift | ||
// PYLayoutDemo | ||
// | ||
// Created by Juan Hurtado on 15/05/22. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
import PYLayout | ||
|
||
struct ButtonExample: View { | ||
var body: some View { | ||
Text("`PYButtonView('title', type: .loud)`") | ||
PYButtonView("Font size: 12", fontSize: 12) | ||
PYButtonView("Font size: 14", fontSize: 14) | ||
PYButtonView("Font size: 16", fontSize: 16) | ||
.padding(.bottom) | ||
|
||
Text("`PYButtonView('title', type: .quiet)`") | ||
PYButtonView("Font size: 12", fontSize: 12, type: .quiet) | ||
PYButtonView("Font size: 14", fontSize: 14, type: .quiet) | ||
PYButtonView("Font size: 16", fontSize: 16, type: .quiet) | ||
Spacer() | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
PYLayoutDemo/PYLayoutDemo/Examples/CollectionCardExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// CollectionCardExample.swift | ||
// PYLayoutDemo | ||
// | ||
// Created by Juan Hurtado on 15/05/22. | ||
// | ||
|
||
import Foundation | ||
import PYLayout | ||
import SwiftUI | ||
|
||
struct CollectionCardExample: View { | ||
var body: some View { | ||
Text("`PYCollectionCardView(cards: ...)`") | ||
.padding() | ||
PYCollectionCardView(cards: [ | ||
MockCard("https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg"), | ||
MockCard("https://upload.wikimedia.org/wikipedia/commons/a/ac/Froil%C3%A1n_Largacha_Hurtado.jpg"), | ||
MockCard("https://upload.wikimedia.org/wikipedia/commons/8/86/Camilo_Torres_y_Tenorio.jpg") | ||
]) | ||
Spacer() | ||
} | ||
} | ||
|
||
struct MockCard: PYCollectionCardData { | ||
var deepLink: String = "" | ||
var backgroundImage: URL? | ||
var title: String = "Froilán Largacha Hurtado" | ||
|
||
init(_ url: String) { | ||
self.backgroundImage = URL(string: url) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// GridExample.swift | ||
// PYLayoutDemo | ||
// | ||
// Created by Juan Hurtado on 19/05/22. | ||
// | ||
|
||
import Kingfisher | ||
import Foundation | ||
import SwiftUI | ||
import PYLayout | ||
|
||
struct GridExample: View { | ||
var body: some View { | ||
Text("`PYVerticalGridView(...)`") | ||
.padding() | ||
PYVerticalGridView(columns: 2, spacing: 1) { | ||
KFImage(URL(string: "https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg")) | ||
.resizable() | ||
.frame(height: 200) | ||
KFImage(URL(string: "https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg")) | ||
.resizable() | ||
.frame(height: 200) | ||
KFImage(URL(string: "https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg")) | ||
.resizable() | ||
.frame(height: 200) | ||
KFImage(URL(string: "https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg")) | ||
.resizable() | ||
.frame(height: 200) | ||
} | ||
Spacer() | ||
} | ||
} |
Oops, something went wrong.