Update
202
Other Projects/WWDCPlayer/WWDCPlayer/Base.lproj/LaunchScreen.storyboard
Executable file
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14810.11" 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="14766.13"/>
|
||||
<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="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bIb-4l-Tc8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="148.5"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vXv-ip-ToS">
|
||||
<rect key="frame" x="20" y="88.5" width="240" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="240" id="Eeq-fp-M98"/>
|
||||
<constraint firstAttribute="height" constant="50" id="dtg-df-t1v"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="148.5" id="U7r-9E-9Ba"/>
|
||||
<constraint firstItem="vXv-ip-ToS" firstAttribute="leading" secondItem="bIb-4l-Tc8" secondAttribute="leading" constant="20" id="ahN-Fw-cbL"/>
|
||||
<constraint firstAttribute="bottom" secondItem="vXv-ip-ToS" secondAttribute="bottom" constant="10" id="n5H-zz-Gec"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4vA-UI-tEX">
|
||||
<rect key="frame" x="0.0" y="148.5" width="414" height="333"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="333" id="cd6-r1-yua"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GsT-jT-xfX" userLabel="ListView">
|
||||
<rect key="frame" x="0.0" y="481.5" width="414" height="414.5"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U3F-Gs-4WC" userLabel="View1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="70"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="llU-zJ-ZGF">
|
||||
<rect key="frame" x="20" y="20" width="240" height="30"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="240" id="Prq-jN-UNr"/>
|
||||
<constraint firstAttribute="height" constant="30" id="mTz-I1-yCy"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KXh-lq-RRl">
|
||||
<rect key="frame" x="20" y="69" width="394" height="1"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="UwK-Lj-ODc"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="KXh-lq-RRl" secondAttribute="bottom" id="Cz4-ex-BVk"/>
|
||||
<constraint firstItem="KXh-lq-RRl" firstAttribute="leading" secondItem="U3F-Gs-4WC" secondAttribute="leading" constant="20" id="auY-KJ-TBW"/>
|
||||
<constraint firstItem="llU-zJ-ZGF" firstAttribute="centerY" secondItem="U3F-Gs-4WC" secondAttribute="centerY" id="bGN-6c-sXj"/>
|
||||
<constraint firstAttribute="height" constant="70" id="mte-XG-qi8"/>
|
||||
<constraint firstItem="llU-zJ-ZGF" firstAttribute="leading" secondItem="U3F-Gs-4WC" secondAttribute="leading" constant="20" id="omr-V7-UUU"/>
|
||||
<constraint firstAttribute="trailing" secondItem="KXh-lq-RRl" secondAttribute="trailing" id="ymr-aD-0rE"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PaP-r5-oc8" userLabel="View2">
|
||||
<rect key="frame" x="0.0" y="70" width="414" height="70"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bkD-UM-CTc">
|
||||
<rect key="frame" x="20" y="20" width="240" height="30"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="4fl-eT-kkY"/>
|
||||
<constraint firstAttribute="width" constant="240" id="vYt-qb-jFQ"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uOO-oy-uv3">
|
||||
<rect key="frame" x="20" y="69" width="394" height="1"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="YtO-aa-P42"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="bkD-UM-CTc" firstAttribute="leading" secondItem="PaP-r5-oc8" secondAttribute="leading" constant="20" id="9mr-PQ-He5"/>
|
||||
<constraint firstAttribute="height" constant="70" id="Wtd-Y5-4gQ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="uOO-oy-uv3" secondAttribute="trailing" id="Xik-tq-ryg"/>
|
||||
<constraint firstAttribute="bottom" secondItem="uOO-oy-uv3" secondAttribute="bottom" id="ceH-sL-E04"/>
|
||||
<constraint firstItem="bkD-UM-CTc" firstAttribute="centerY" secondItem="PaP-r5-oc8" secondAttribute="centerY" id="o9J-jd-0x0"/>
|
||||
<constraint firstItem="uOO-oy-uv3" firstAttribute="leading" secondItem="PaP-r5-oc8" secondAttribute="leading" constant="20" id="pJM-ER-Pgt"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UEU-oh-ntl" userLabel="View3">
|
||||
<rect key="frame" x="0.0" y="140" width="414" height="70"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yft-lI-14Q">
|
||||
<rect key="frame" x="20" y="20" width="240" height="30"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="240" id="7B4-y2-Cm3"/>
|
||||
<constraint firstAttribute="height" constant="30" id="bwH-0m-DbC"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qXs-S4-cuJ">
|
||||
<rect key="frame" x="20" y="69" width="394" height="1"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="sEQ-oo-Orp"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Yft-lI-14Q" firstAttribute="centerY" secondItem="UEU-oh-ntl" secondAttribute="centerY" id="5CQ-AR-BrK"/>
|
||||
<constraint firstItem="Yft-lI-14Q" firstAttribute="leading" secondItem="UEU-oh-ntl" secondAttribute="leading" constant="20" id="9VU-Dz-FM4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qXs-S4-cuJ" secondAttribute="trailing" id="KhX-xm-3JS"/>
|
||||
<constraint firstAttribute="height" constant="70" id="OS7-VI-Ea0"/>
|
||||
<constraint firstItem="qXs-S4-cuJ" firstAttribute="leading" secondItem="UEU-oh-ntl" secondAttribute="leading" constant="20" id="klF-H2-vEu"/>
|
||||
<constraint firstAttribute="bottom" secondItem="qXs-S4-cuJ" secondAttribute="bottom" id="vUL-MO-I14"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ybg-ga-e6U" userLabel="View4">
|
||||
<rect key="frame" x="0.0" y="210" width="414" height="70"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eUZ-Ys-y3a">
|
||||
<rect key="frame" x="20" y="20" width="240" height="30"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="I9x-Np-M1x"/>
|
||||
<constraint firstAttribute="width" constant="240" id="ueQ-zp-gsO"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RDL-Rf-c2c">
|
||||
<rect key="frame" x="20" y="69" width="394" height="1"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="pZI-sZ-Quc"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="eUZ-Ys-y3a" firstAttribute="leading" secondItem="ybg-ga-e6U" secondAttribute="leading" constant="20" id="Wu9-SV-apz"/>
|
||||
<constraint firstAttribute="bottom" secondItem="RDL-Rf-c2c" secondAttribute="bottom" id="XPi-Yn-d7K"/>
|
||||
<constraint firstAttribute="height" constant="70" id="bMV-Tx-P2x"/>
|
||||
<constraint firstAttribute="trailing" secondItem="RDL-Rf-c2c" secondAttribute="trailing" id="bu8-Bs-K9g"/>
|
||||
<constraint firstItem="eUZ-Ys-y3a" firstAttribute="centerY" secondItem="ybg-ga-e6U" secondAttribute="centerY" id="e2v-Ha-rZq"/>
|
||||
<constraint firstItem="RDL-Rf-c2c" firstAttribute="leading" secondItem="ybg-ga-e6U" secondAttribute="leading" constant="20" id="ge2-CZ-xmC"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="UEU-oh-ntl" firstAttribute="leading" secondItem="GsT-jT-xfX" secondAttribute="leading" id="3Eg-Q7-dEY"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ybg-ga-e6U" secondAttribute="trailing" id="3hK-Gf-Apu"/>
|
||||
<constraint firstItem="ybg-ga-e6U" firstAttribute="top" secondItem="UEU-oh-ntl" secondAttribute="bottom" id="5Y4-oM-vj0"/>
|
||||
<constraint firstItem="PaP-r5-oc8" firstAttribute="leading" secondItem="GsT-jT-xfX" secondAttribute="leading" id="MYo-q1-LG4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="PaP-r5-oc8" secondAttribute="trailing" id="P5v-b7-ZZa"/>
|
||||
<constraint firstItem="PaP-r5-oc8" firstAttribute="bottom" secondItem="UEU-oh-ntl" secondAttribute="top" id="hY5-j4-d7I"/>
|
||||
<constraint firstAttribute="trailing" secondItem="UEU-oh-ntl" secondAttribute="trailing" id="miW-fC-i8X"/>
|
||||
<constraint firstItem="PaP-r5-oc8" firstAttribute="top" secondItem="U3F-Gs-4WC" secondAttribute="bottom" id="mpc-jM-n7U"/>
|
||||
<constraint firstItem="U3F-Gs-4WC" firstAttribute="leading" secondItem="GsT-jT-xfX" secondAttribute="leading" id="rx1-fn-tNn"/>
|
||||
<constraint firstItem="ybg-ga-e6U" firstAttribute="leading" secondItem="GsT-jT-xfX" secondAttribute="leading" id="t7Q-xh-1tU"/>
|
||||
<constraint firstItem="U3F-Gs-4WC" firstAttribute="top" secondItem="GsT-jT-xfX" secondAttribute="top" id="vIV-OC-hIS"/>
|
||||
<constraint firstAttribute="trailing" secondItem="U3F-Gs-4WC" secondAttribute="trailing" id="xEn-KM-9pi"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="bIb-4l-Tc8" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="2o4-bN-7xE"/>
|
||||
<constraint firstItem="4vA-UI-tEX" firstAttribute="trailing" secondItem="bIb-4l-Tc8" secondAttribute="trailing" id="498-2l-nA8"/>
|
||||
<constraint firstItem="GsT-jT-xfX" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="7XC-hr-0bi"/>
|
||||
<constraint firstItem="GsT-jT-xfX" firstAttribute="top" secondItem="4vA-UI-tEX" secondAttribute="bottom" id="C1g-Ij-U4O"/>
|
||||
<constraint firstItem="4vA-UI-tEX" firstAttribute="leading" secondItem="bIb-4l-Tc8" secondAttribute="leading" id="FV3-tt-eNh"/>
|
||||
<constraint firstItem="bIb-4l-Tc8" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="Q8v-mw-JnD"/>
|
||||
<constraint firstAttribute="bottom" secondItem="GsT-jT-xfX" secondAttribute="bottom" id="agc-V4-zHC"/>
|
||||
<constraint firstAttribute="trailing" secondItem="GsT-jT-xfX" secondAttribute="trailing" id="dDB-Ay-EYy"/>
|
||||
<constraint firstItem="4vA-UI-tEX" firstAttribute="top" secondItem="bIb-4l-Tc8" secondAttribute="bottom" id="mRa-be-DO1"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bIb-4l-Tc8" secondAttribute="trailing" id="sB5-am-1KZ"/>
|
||||
</constraints>
|
||||
<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>
|
||||
41
Other Projects/WWDCPlayer/WWDCPlayer/Delegates/AppDelegate.swift
Executable file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
// 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.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
60
Other Projects/WWDCPlayer/WWDCPlayer/Delegates/SceneDelegate.swift
Executable file
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// SceneDelegate.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Use a UIHostingController as window root view controller
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.rootViewController = UIHostingController(rootView: MainView()
|
||||
.environmentObject(UserData()))
|
||||
self.window = window
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
15
Other Projects/WWDCPlayer/WWDCPlayer/Enum/Platform.swift
Executable file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Platform.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by sohee on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum Platform: String, CaseIterable {
|
||||
case iOS, macOS, tvOS, watchOS
|
||||
}
|
||||
|
||||
let allPlatforms = Platform.allCases
|
||||
23
Other Projects/WWDCPlayer/WWDCPlayer/Enum/WeekDay.swift
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// WeekDay.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
enum WeekDay: String, CaseIterable, Identifiable {
|
||||
var id: String {
|
||||
return self.rawValue
|
||||
}
|
||||
case monday
|
||||
case tuesday
|
||||
case wednesday
|
||||
case thursday
|
||||
case friday
|
||||
}
|
||||
|
||||
let allWeekDays = WeekDay.allCases
|
||||
72
Other Projects/WWDCPlayer/WWDCPlayer/MainView.swift
Executable file
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// MainView.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import AVFoundation
|
||||
|
||||
struct MainView: View {
|
||||
|
||||
@EnvironmentObject var userData: UserData
|
||||
|
||||
let player = AVPlayer()
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
VStack {
|
||||
ZStack(alignment: .bottom) {
|
||||
PlayerViewController(video: $userData.currentVideo)
|
||||
}
|
||||
|
||||
FavoriteToggleView()
|
||||
VideoListView()
|
||||
}
|
||||
.navigationBarTitle(Text(userData.currentVideo.title))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct MainView_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
MainView()
|
||||
.environmentObject(UserData())
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct FavoriteToggleView: View {
|
||||
|
||||
@EnvironmentObject var userData: UserData
|
||||
|
||||
var body: some View {
|
||||
Toggle(isOn: $userData.showFavoriteOnly) {
|
||||
Text("Favorite Only")
|
||||
.foregroundColor(Color.yellow)
|
||||
}
|
||||
.padding([.leading, .trailing], 20)
|
||||
}
|
||||
}
|
||||
|
||||
struct VideoListView : View {
|
||||
|
||||
@EnvironmentObject var userData: UserData
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
ForEach(allWeekDays) { day in
|
||||
Section(header: Text(day.rawValue.uppercased()).fontWeight(.bold)) {
|
||||
ForEach(self.userData.videos.filter { $0.weekDay == day }) { video in
|
||||
if !self.userData.showFavoriteOnly || video.isFavorite {
|
||||
VideoRow(video: video)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.listStyle(.grouped)
|
||||
}
|
||||
}
|
||||
31
Other Projects/WWDCPlayer/WWDCPlayer/Model/UserData.swift
Executable file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// UserData.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by sohee on 2019/06/06.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
final class UserData: BindableObject {
|
||||
let didChange = PassthroughSubject<UserData, Never>()
|
||||
|
||||
var showFavoriteOnly = false {
|
||||
didSet {
|
||||
didChange.send(self)
|
||||
}
|
||||
}
|
||||
|
||||
var videos = videoList {
|
||||
didSet {
|
||||
didChange.send(self)
|
||||
}
|
||||
}
|
||||
|
||||
var currentVideo = videoList[0] {
|
||||
didSet {
|
||||
didChange.send(self)
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Other Projects/WWDCPlayer/WWDCPlayer/Model/Video.swift
Executable file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Video.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct Video: Identifiable, Equatable {
|
||||
var id: Int
|
||||
var title: String
|
||||
var url: String
|
||||
var weekDay: WeekDay
|
||||
var platforms: [Platform]
|
||||
var isFavorite = false
|
||||
|
||||
var platformString: String {
|
||||
return platforms.map { $0.rawValue }.joined(separator: ", ")
|
||||
}
|
||||
|
||||
static func == (lhs: Video, rhs: Video) -> Bool {
|
||||
return lhs.id == rhs.id
|
||||
}
|
||||
}
|
||||
|
||||
let videoList = [
|
||||
Video(id: 101, title: "Keynote🤖", url: "https://p-events-delivery.akamaized.net/3004qzusahnbjppuwydgjzsdyzsippar/m3u8/hls_vod_mvp.m3u8", weekDay: .monday, platforms: allPlatforms),
|
||||
Video(id: 103, title: "Platforms State of the Union🛠", url: "https://devstreaming-cdn.apple.com/videos/wwdc/2019/103bax22h2udxu0n/103/hls_vod_mvp.m3u8", weekDay: .monday, platforms: allPlatforms),
|
||||
Video(id: 104, title: "Apple Design Awards🏆", url: "https://devstreaming-cdn.apple.com/videos/wwdc/2019/104d6zyhb21vki/104/hls_vod_mvp.m3u8", weekDay: .monday, platforms: allPlatforms),
|
||||
Video(id: 204, title: "Introducing SwiftUI: Building Your First App", url: "https://devstreaming-cdn.apple.com/videos/wwdc/2019/204isgnpbqud244/204/hls_vod_mvp.m3u8", weekDay: .tuesday, platforms: allPlatforms),
|
||||
Video(id: 214, title: "Implementing Dark Mode on iOS", url: "https://devstreaming-cdn.apple.com/videos/wwdc/2019/214iqtpuhih53fw2/214/hls_vod_mvp.m3u8", weekDay: .wednesday, platforms: [.iOS])
|
||||
]
|
||||
37
Other Projects/WWDCPlayer/WWDCPlayer/PlayerViewController.swift
Executable file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// PlayerViewController.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by ms on 2019/06/05.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import AVKit
|
||||
|
||||
struct PlayerViewController: UIViewControllerRepresentable {
|
||||
|
||||
@Binding var video: Video
|
||||
|
||||
private let player = AVPlayer()
|
||||
|
||||
func makeUIViewController(context: Context) -> AVPlayerViewController {
|
||||
let playerVC = AVPlayerViewController()
|
||||
playerVC.player = self.player
|
||||
return playerVC
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) {
|
||||
guard let url = URL(string: video.url) else { return }
|
||||
|
||||
resetPlayer(uiViewController)
|
||||
|
||||
let item = AVPlayerItem(url: url)
|
||||
uiViewController.player?.replaceCurrentItem(with: item)
|
||||
}
|
||||
|
||||
func resetPlayer(_ vc: AVPlayerViewController) {
|
||||
vc.player?.pause()
|
||||
vc.player?.replaceCurrentItem(with: nil)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "ItunesArtwork@2x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1000 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 511 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
62
Other Projects/WWDCPlayer/WWDCPlayer/Supporting Files/Info.plist
Executable file
@@ -0,0 +1,62 @@
|
||||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
9
Other Projects/WWDCPlayer/WWDCPlayer/UserData.swift
Executable file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// UserData.swift
|
||||
// SwiftUISample
|
||||
//
|
||||
// Created by sohee on 2019/06/06.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
86
Other Projects/WWDCPlayer/WWDCPlayer/VideoRow.swift
Executable file
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// VideoRow.swift
|
||||
// WWDCPlayer
|
||||
//
|
||||
// Created by sohee on 2019/06/06.
|
||||
// Copyright © 2019 daybreak. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct VideoRow : View {
|
||||
|
||||
@EnvironmentObject var userData: UserData
|
||||
|
||||
var video: Video
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
VStack(alignment: .leading) {
|
||||
TitleText(text: video.title)
|
||||
HStack {
|
||||
DescriptionText(text: "Session \(video.id)")
|
||||
DescriptionText(text: "·")
|
||||
DescriptionText(text: video.platformString)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
HStack(spacing: 15) {
|
||||
if userData.currentVideo == video {
|
||||
Image(systemName: "music.mic")
|
||||
}
|
||||
|
||||
Image(systemName: video.isFavorite ? "star.fill" : "star")
|
||||
.foregroundColor(video.isFavorite ? Color.yellow : Color.gray)
|
||||
.tapAction {
|
||||
self.setFavorite(video: self.video)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding([.top, .bottom], 10)
|
||||
.tapAction {
|
||||
self.setCurrentVideo(video: self.video)
|
||||
}
|
||||
}
|
||||
|
||||
func setCurrentVideo(video: Video) {
|
||||
guard self.userData.currentVideo != self.video else {
|
||||
return
|
||||
}
|
||||
self.userData.currentVideo = self.video
|
||||
}
|
||||
|
||||
func setFavorite(video: Video) {
|
||||
guard let index = userData.videos.firstIndex (where: { $0 == video }) else {
|
||||
return
|
||||
}
|
||||
self.userData.videos[index].isFavorite.toggle()
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct VideoRow_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
VideoRow(video: videoList[0])
|
||||
.environmentObject(UserData())
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct TitleText: View {
|
||||
let text: String
|
||||
var body: some View {
|
||||
return Text(text)
|
||||
.color(.primary)
|
||||
.bold()
|
||||
}
|
||||
}
|
||||
|
||||
struct DescriptionText : View {
|
||||
let text: String
|
||||
var body: some View {
|
||||
return Text(text)
|
||||
.font(.footnote).fontWeight(.semibold)
|
||||
.color(.secondary)
|
||||
}
|
||||
}
|
||||