-
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.
- Loading branch information
1 parent
39f2f0a
commit c1ff6c5
Showing
51 changed files
with
2,876 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
495 changes: 495 additions & 0 deletions
495
BasicCustomView/Final/BasicCustomView/BasicCustomView.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...al/BasicCustomView/BasicCustomView.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
...mView/BasicCustomView.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> |
36 changes: 36 additions & 0 deletions
36
BasicCustomView/Final/BasicCustomView/BasicCustomView/Application/AppDelegate.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,36 @@ | ||
// | ||
// AppDelegate.swift | ||
// BasicCustomView | ||
// | ||
// Created by taehy.k on 2022/05/05. | ||
// | ||
|
||
import UIKit | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
|
||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
// Override point for customization after application launch. | ||
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. | ||
} | ||
|
||
|
||
} | ||
|
19 changes: 19 additions & 0 deletions
19
BasicCustomView/Final/BasicCustomView/BasicCustomView/Application/SceneDelegate.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,19 @@ | ||
// | ||
// SceneDelegate.swift | ||
// BasicCustomView | ||
// | ||
// Created by taehy.k on 2022/05/05. | ||
// | ||
|
||
import UIKit | ||
|
||
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
|
||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | ||
guard let _ = (scene as? UIWindowScene) else { return } | ||
} | ||
} | ||
|
224 changes: 224 additions & 0 deletions
224
BasicCustomView/Final/BasicCustomView/BasicCustomView/Bottom Sheet/BottomSheet.storyboard
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
BasicCustomView/Final/BasicCustomView/BasicCustomView/Bottom Sheet/BottomSheet.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,25 @@ | ||
// | ||
// BottomSheet.swift | ||
// BasicCustomView | ||
// | ||
// Created by taehy.k on 2022/05/05. | ||
// | ||
|
||
import UIKit | ||
|
||
class BottomSheet: UIViewController { | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
} | ||
|
||
@IBAction func showBottomSheetTapped(_ sender: Any) { | ||
print("커스텀 바텀시트 띄우기") | ||
guard let customBottomSheet = self.storyboard?.instantiateViewController(withIdentifier: "CustomBottomSheet") as? CustomBottomSheet else { return } | ||
customBottomSheet.modalTransitionStyle = .crossDissolve | ||
customBottomSheet.modalPresentationStyle = .overFullScreen | ||
present(customBottomSheet, animated: false) { | ||
customBottomSheet.showBottomSheetWithAnimation() | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...stomView/Final/BasicCustomView/BasicCustomView/Bottom Sheet/Views/CustomBottomSheet.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,57 @@ | ||
// | ||
// CustomBottomSheet.swift | ||
// BasicCustomView | ||
// | ||
// Created by taehy.k on 2022/05/05. | ||
// | ||
|
||
import UIKit | ||
|
||
class CustomBottomSheet: UIViewController { | ||
|
||
@IBOutlet weak var containerView: UIView! | ||
@IBOutlet weak var containerHeight: NSLayoutConstraint! | ||
@IBOutlet weak var itemStackView: UIStackView! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setupUI() | ||
} | ||
|
||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | ||
super.touchesBegan(touches, with: event) | ||
if let touch = touches.first, | ||
touch.view == self.view { | ||
hideBottomSheetWithAnimation() | ||
} | ||
} | ||
|
||
private func setupUI() { | ||
containerHeight.constant = 0 | ||
containerView.layer.cornerRadius = 12 | ||
containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | ||
} | ||
|
||
@IBAction func cancelButtonTapped(_ sender: Any) { | ||
hideBottomSheetWithAnimation() | ||
} | ||
} | ||
|
||
// MARK: - Show/Hide Animation | ||
extension CustomBottomSheet { | ||
func showBottomSheetWithAnimation() { | ||
UIView.animate(withDuration: 0.3) { | ||
self.containerHeight.constant = 330 | ||
self.view.layoutIfNeeded() | ||
} | ||
} | ||
|
||
func hideBottomSheetWithAnimation() { | ||
UIView.animate(withDuration: 0.3) { | ||
self.containerHeight.constant = 0 | ||
self.view.layoutIfNeeded() | ||
} completion: { _ in | ||
self.dismiss(animated: false) | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
BasicCustomView/Final/BasicCustomView/BasicCustomView/Main/Base.lproj/Main.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,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ZhK-L9-g7R"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Tab Bar Controller--> | ||
<scene sceneID="CjD-DG-mJh"> | ||
<objects> | ||
<tabBarController automaticallyAdjustsScrollViewInsets="NO" id="ZhK-L9-g7R" sceneMemberID="viewController"> | ||
<toolbarItems/> | ||
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="FOM-IF-WnB"> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<color key="selectedImageTintColor" red="0.32549019610000002" green="0.28235294119999998" blue="0.80784313730000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
</tabBar> | ||
<connections> | ||
<segue destination="Npe-VN-PwX" kind="relationship" relationship="viewControllers" id="X51-eN-w9n"/> | ||
<segue destination="ARI-yi-ty8" kind="relationship" relationship="viewControllers" id="vie-94-bGB"/> | ||
<segue destination="Kjp-Tu-sjq" kind="relationship" relationship="viewControllers" id="K5p-x8-aIM"/> | ||
</connections> | ||
</tabBarController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="lMW-wi-kkf" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="111.59420289855073" y="115.84821428571428"/> | ||
</scene> | ||
<!--PopUp--> | ||
<scene sceneID="ZQQ-MP-U1i"> | ||
<objects> | ||
<viewControllerPlaceholder storyboardName="PopUp" id="Npe-VN-PwX" sceneMemberID="viewController"> | ||
<tabBarItem key="tabBarItem" title="Item" id="Uog-wr-6RE"/> | ||
</viewControllerPlaceholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="TWL-AP-AeY" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="933" y="-109"/> | ||
</scene> | ||
<!--BottomSheet--> | ||
<scene sceneID="bPZ-2V-yR7"> | ||
<objects> | ||
<viewControllerPlaceholder storyboardName="BottomSheet" id="ARI-yi-ty8" sceneMemberID="viewController"> | ||
<tabBarItem key="tabBarItem" title="Item" id="fDK-Gx-4bS"/> | ||
</viewControllerPlaceholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="hht-r8-HA8" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="917" y="70"/> | ||
</scene> | ||
<!--ViewPager--> | ||
<scene sceneID="YPc-mM-pSD"> | ||
<objects> | ||
<viewControllerPlaceholder storyboardName="ViewPager" id="Kjp-Tu-sjq" sceneMemberID="viewController"> | ||
<tabBarItem key="tabBarItem" title="Item" id="DK9-2X-byI"/> | ||
</viewControllerPlaceholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="BWU-Lx-78T" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="917" y="252"/> | ||
</scene> | ||
</scenes> | ||
</document> |
16 changes: 16 additions & 0 deletions
16
BasicCustomView/Final/BasicCustomView/BasicCustomView/Main/ViewController.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,16 @@ | ||
// | ||
// ViewController.swift | ||
// BasicCustomView | ||
// | ||
// Created by taehy.k on 2022/05/05. | ||
// | ||
|
||
import UIKit | ||
|
||
class ViewController: UIViewController { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any additional setup after loading the view. | ||
} | ||
} |
Oops, something went wrong.