Skip to content

Commit

Permalink
Merge pull request #21 from dahun-lee-daji/iOS/feature/13/Splash
Browse files Browse the repository at this point in the history
iOS/feature/13/splash
  • Loading branch information
HongzCloud committed Apr 27, 2021
2 parents 6c69341 + d7cdf6a commit fb70cc2
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 11 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions SideDishApp/SideDishApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
1ECD5F6D262F3C1700DC56C0 /* Dish.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECD5F6C262F3C1700DC56C0 /* Dish.swift */; };
1ECD5F70262F3F1C00DC56C0 /* MenuListUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECD5F6F262F3F1C00DC56C0 /* MenuListUseCase.swift */; };
1ECD5F73262F405100DC56C0 /* MenuListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECD5F72262F405100DC56C0 /* MenuListViewModel.swift */; };
1ECF2E812632A70F006982BE /* LoadingView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECF2E802632A70F006982BE /* LoadingView.xib */; };
1ECF2E842632A862006982BE /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECF2E832632A862006982BE /* LoadingView.swift */; };
B0911E6F262EA29200D5EBEC /* DishCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0911E6E262EA29200D5EBEC /* DishCardCell.swift */; };
B04466292636911D00DAD616 /* DishCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B04466272636911D00DAD616 /* DishCell.swift */; };
B044662A2636911D00DAD616 /* DishCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B04466282636911D00DAD616 /* DishCell.xib */; };
B0911EA026316B9A00D5EBEC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0911E9F26316B9A00D5EBEC /* String+Extension.swift */; };
Expand All @@ -42,6 +45,8 @@
1ECD5F6C262F3C1700DC56C0 /* Dish.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dish.swift; sourceTree = "<group>"; };
1ECD5F6F262F3F1C00DC56C0 /* MenuListUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuListUseCase.swift; sourceTree = "<group>"; };
1ECD5F72262F405100DC56C0 /* MenuListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuListViewModel.swift; sourceTree = "<group>"; };
1ECF2E802632A70F006982BE /* LoadingView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LoadingView.xib; sourceTree = "<group>"; };
1ECF2E832632A862006982BE /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
4942C5A177086C5C99933038 /* Pods-SideDishApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideDishApp.debug.xcconfig"; path = "Target Support Files/Pods-SideDishApp/Pods-SideDishApp.debug.xcconfig"; sourceTree = "<group>"; };
605A37FD869863C7E023EE85 /* Pods-SideDishApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideDishApp.release.xcconfig"; path = "Target Support Files/Pods-SideDishApp/Pods-SideDishApp.release.xcconfig"; sourceTree = "<group>"; };
96A87B12151B0D006007CD63 /* Pods_SideDishApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SideDishApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -159,6 +164,9 @@
isa = PBXGroup;
children = (
1E1DBAD7262DDDFC0050FE6C /* Main.storyboard */,
B0911E6E262EA29200D5EBEC /* DishCardCell.swift */,
1ECF2E802632A70F006982BE /* LoadingView.xib */,
1ECF2E832632A862006982BE /* LoadingView.swift */,
B04466272636911D00DAD616 /* DishCell.swift */,
B04466282636911D00DAD616 /* DishCell.xib */,
);
Expand Down Expand Up @@ -304,6 +312,7 @@
buildActionMask = 2147483647;
files = (
1E1DBADE262DDDFD0050FE6C /* LaunchScreen.storyboard in Resources */,
1ECF2E812632A70F006982BE /* LoadingView.xib in Resources */,
B044662A2636911D00DAD616 /* DishCell.xib in Resources */,
1E1DBADB262DDDFD0050FE6C /* Assets.xcassets in Resources */,
1E1DBAD9262DDDFC0050FE6C /* Main.storyboard in Resources */,
Expand Down Expand Up @@ -371,6 +380,7 @@
B0911EA42631AF3400D5EBEC /* DiffableProvider.swift in Sources */,
B0911EA82632B7A100D5EBEC /* DishCollectionViewDelegate.swift in Sources */,
1E1DBAD4262DDDFC0050FE6C /* SceneDelegate.swift in Sources */,
1ECF2E842632A862006982BE /* LoadingView.swift in Sources */,
1ECD5F73262F405100DC56C0 /* MenuListViewModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>SideDishApp.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "A5E17B2F-95B0-4582-ACBD-4CD3BE453B84"
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4BB5EFC5-F3F1-4674-966F-4AE74C65632A"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SideDishApp/Presentation/UI/ViewController/ViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "36"
endingLineNumber = "36"
landmarkName = "setLoadingView()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
30 changes: 30 additions & 0 deletions SideDishApp/SideDishApp/Presentation/UI/View/LoadingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// LoadingView.swift
// SideDishApp
//
// Created by 오킹 on 2021/04/23.
//

import UIKit

class LoadingView: UIView {

@IBOutlet weak var imageView: UIImageView!

override init(frame: CGRect) {
super.init(frame: frame)
initXIB()
}

required init?(coder: NSCoder) {
super.init(coder: coder)
initXIB()
}

func initXIB() {
guard let view = Bundle.main.loadNibNamed("LoadingView", owner: self, options: nil)?.first as? UIView else { return }

view.frame = self.bounds
self.addSubview(view)
}
}
38 changes: 38 additions & 0 deletions SideDishApp/SideDishApp/Presentation/UI/View/LoadingView.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoadingView" customModule="SideDishApp" customModuleProvider="target">
<connections>
<outlet property="imageView" destination="nUJ-qJ-bc1" id="Zph-7p-19t"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="100" height="99"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="shopping" translatesAutoresizingMaskIntoConstraints="NO" id="nUJ-qJ-bc1">
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="-1.4492753623188408" y="9.0401785714285712"/>
</view>
</objects>
<resources>
<image name="shopping" width="300" height="300"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class DiffableProvider {

let tap = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(recognizer:)))
headerView.addGestureRecognizer(tap)

headerView.contentConfiguration = configuration
}
return headerRegistration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@ class ViewController: UIViewController {

private let menuListViewModel = MenuListViewModel()
private var subscriptions = Set<AnyCancellable>()

let dishCollectionViewDelegate = DishCollectionViewDelegate()
private var loadingView = LoadingView()
var dataSource : UICollectionViewDiffableDataSource<Dishes,Dish>!
let dishCollectionViewDelegate = DishCollectionViewDelegate()
var snapshot = NSDiffableDataSourceSnapshot<Dishes,Dish>()

override func viewDidLoad() {
super.viewDidLoad()

setLoadingView()
dishCollectionView.delegate = dishCollectionViewDelegate
dataSource = DiffableProvider().configureDataSource(collectionView: dishCollectionView)
bind()
menuListViewModel.requestDishes()

}

func setLoadingView() {
let loadingiewFrame = CGRect(x: 0, y: 0, width: 100, height: 100)
loadingView = LoadingView(frame: loadingiewFrame)
loadingView.center = self.view.center
self.view.addSubview(loadingView)
}

private func addDataToSnapshot (dishes: [Dishes]) {
Expand All @@ -46,6 +54,7 @@ class ViewController: UIViewController {
.sink(receiveCompletion: { _ in
//error
}, receiveValue: { mainDishes in
self.loadingView.removeFromSuperview()
self.addDataToSnapshot(dishes: mainDishes)
})
.store(in: &subscriptions)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "shopping.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?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">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -11,15 +12,24 @@
<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"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="shopping" translatesAutoresizingMaskIntoConstraints="NO" id="rrG-Ya-frb">
<rect key="frame" x="157" y="398" width="100" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
<resources>
<image name="shopping" width="300" height="300"/>
</resources>
</document>

0 comments on commit fb70cc2

Please sign in to comment.