Skip to content

Commit

Permalink
add launch&init view
Browse files Browse the repository at this point in the history
  • Loading branch information
320010ly committed Jun 8, 2023
1 parent 3adc397 commit d210ad5
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions sportsMan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
170735B32A2CC80F000A1E6B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 170735B12A2CC80F000A1E6B /* Main.storyboard */; };
170735B52A2CC811000A1E6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 170735B42A2CC811000A1E6B /* Assets.xcassets */; };
170735B82A2CC811000A1E6B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 170735B62A2CC811000A1E6B /* LaunchScreen.storyboard */; };
176892112A31B27400D22F68 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 176892102A31B27400D22F68 /* 1.png */; };
17D8E89A2A3215AD00E41D4A /* First.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17D8E8992A3215AD00E41D4A /* First.storyboard */; };
17D8E89E2A32160F00E41D4A /* First.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D8E89D2A32160F00E41D4A /* First.swift */; };
74F8D2292A2E100F00F78C61 /* RunningViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F8D2282A2E100F00F78C61 /* RunningViewController.swift */; };
74F8D22D2A2F7B8B00F78C61 /* TimerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F8D22C2A2F7B8B00F78C61 /* TimerViewController.swift */; };
74F8D22F2A30984500F78C61 /* runningRecords.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F8D22E2A30984500F78C61 /* runningRecords.swift */; };
Expand All @@ -27,6 +30,9 @@
170735B42A2CC811000A1E6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
170735B72A2CC811000A1E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
170735B92A2CC811000A1E6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
176892102A31B27400D22F68 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 1.png; path = ../../../ly/1.png; sourceTree = "<group>"; };
17D8E8992A3215AD00E41D4A /* First.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = First.storyboard; sourceTree = "<group>"; };
17D8E89D2A32160F00E41D4A /* First.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = First.swift; sourceTree = "<group>"; };
74F8D2282A2E100F00F78C61 /* RunningViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunningViewController.swift; sourceTree = "<group>"; };
74F8D22C2A2F7B8B00F78C61 /* TimerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerViewController.swift; sourceTree = "<group>"; };
74F8D22E2A30984500F78C61 /* runningRecords.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = runningRecords.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -70,6 +76,7 @@
170735B42A2CC811000A1E6B /* Assets.xcassets */,
170735B62A2CC811000A1E6B /* LaunchScreen.storyboard */,
170735B92A2CC811000A1E6B /* Info.plist */,
176892102A31B27400D22F68 /* 1.png */,
);
path = sportsMan;
sourceTree = "<group>";
Expand All @@ -78,6 +85,7 @@
isa = PBXGroup;
children = (
170735B12A2CC80F000A1E6B /* Main.storyboard */,
17D8E8992A3215AD00E41D4A /* First.storyboard */,
);
path = View;
sourceTree = "<group>";
Expand All @@ -88,6 +96,7 @@
170735AF2A2CC80F000A1E6B /* ViewController.swift */,
74F8D2282A2E100F00F78C61 /* RunningViewController.swift */,
74F8D22C2A2F7B8B00F78C61 /* TimerViewController.swift */,
17D8E89D2A32160F00E41D4A /* First.swift */,
);
path = Controller;
sourceTree = "<group>";
Expand Down Expand Up @@ -162,6 +171,8 @@
170735B82A2CC811000A1E6B /* LaunchScreen.storyboard in Resources */,
170735B52A2CC811000A1E6B /* Assets.xcassets in Resources */,
170735B32A2CC80F000A1E6B /* Main.storyboard in Resources */,
176892112A31B27400D22F68 /* 1.png in Resources */,
17D8E89A2A3215AD00E41D4A /* First.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -174,6 +185,7 @@
files = (
74F8D22D2A2F7B8B00F78C61 /* TimerViewController.swift in Sources */,
170735B02A2CC80F000A1E6B /* ViewController.swift in Sources */,
17D8E89E2A32160F00E41D4A /* First.swift in Sources */,
170735AC2A2CC80F000A1E6B /* AppDelegate.swift in Sources */,
74F8D2292A2E100F00F78C61 /* RunningViewController.swift in Sources */,
74F8D22F2A30984500F78C61 /* runningRecords.swift in Sources */,
Expand Down
Binary file not shown.
31 changes: 25 additions & 6 deletions sportsMan/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?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="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<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>
<scenes>
Expand All @@ -11,15 +13,32 @@
<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="393" height="852"/>
<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" misplaced="YES" image="1.png" translatesAutoresizingMaskIntoConstraints="NO" id="Q5m-PR-upe">
<rect key="frame" x="0.0" y="-26" width="393" height="878"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Q5m-PR-upe" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="4M8-ZV-Dff"/>
<constraint firstItem="Q5m-PR-upe" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="IAv-n6-jrh"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="Q5m-PR-upe" secondAttribute="bottom" id="IzK-iS-ZMP"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="Q5m-PR-upe" secondAttribute="trailing" id="OVT-z0-H9c"/>
</constraints>
</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.671755725190835" y="374.64788732394368"/>
</scene>
</scenes>
<resources>
<image name="1.png" width="750" height="1334"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
27 changes: 27 additions & 0 deletions sportsMan/Controller/First.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// First.swift
// sportsMan
//
// Created by liuyu on 2023/6/8.
//

import Foundation
import UIKit

class First:UIViewController{


override func viewDidLoad() {
super.viewDidLoad()
}

@IBAction func entermainview(_ sender: UIButton) {
let mainstoryboard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let mainvc = mainstoryboard.instantiateViewController(withIdentifier: "main")
//self.navigationController?.pushViewController(mainvc, animated: true)
mainvc.modalPresentationStyle = .fullScreen
self.present(mainvc, animated: true)
}


}
21 changes: 20 additions & 1 deletion sportsMan/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,26 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// 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).
guard let _ = (scene as? UIWindowScene) else { return }
guard let scene = (scene as? UIWindowScene) else { return }
//UserDefaults.standard.set(false, forKey: "launchedBefore")
let launchedBefore = UserDefaults.standard.bool(forKey: "launchedBefore")

let window = UIWindow(windowScene: scene)
self.window = window
if launchedBefore {
//UserDefaults.standard.set(false, forKey: "launchedBefore")
print("not first launch.")
let mainStoryboard :UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let myVC = mainStoryboard.instantiateViewController(withIdentifier: "main")
window.rootViewController = myVC
} else {
print("first launch,setting userdefault.")
UserDefaults.standard.set(true, forKey: "launchedBefore")
let mainStoryboard :UIStoryboard = UIStoryboard(name: "First", bundle: nil)
let myVC = mainStoryboard.instantiateViewController(withIdentifier: "firstview")
window.rootViewController = myVC
}
window.makeKeyAndVisible()
}

func sceneDidDisconnect(_ scene: UIScene) {
Expand Down
2 changes: 1 addition & 1 deletion sportsMan/View/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="sportsMan" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="main" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="sportsMan" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down
47 changes: 47 additions & 0 deletions sportsMan/View/First.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<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>
<scenes>
<!--First-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController storyboardIdentifier="firstview" title="First" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Y6W-OH-hqX" customClass="First" customModule="sportsMan" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xZt-LE-rml">
<rect key="frame" x="130" y="459" width="117" height="133"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" systemColor="systemOrangeColor"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="enter"/>
<connections>
<action selector="entermainview:" destination="Y6W-OH-hqX" eventType="touchDown" id="1C3-sb-gQf"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="101.5267175572519" y="3.5211267605633805"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemOrangeColor">
<color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

0 comments on commit d210ad5

Please sign in to comment.