Skip to content

Commit 74e55c3

Browse files
author
DovYoung
committed
初始项目
1 parent 6853ecb commit 74e55c3

File tree

18 files changed

+1156
-0
lines changed

18 files changed

+1156
-0
lines changed

Refuel/Refuel.xcodeproj/project.pbxproj

Lines changed: 615 additions & 0 deletions
Large diffs are not rendered by default.

Refuel/Refuel.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Refuel/Refuel/AppDelegate.swift

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
//
2+
// AppDelegate.swift
3+
// Refuel
4+
//
5+
// Created by Yangdongwu on 2020/11/14.
6+
//
7+
8+
import UIKit
9+
import CoreData
10+
11+
@main
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
15+
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17+
// Override point for customization after application launch.
18+
return true
19+
}
20+
21+
// MARK: UISceneSession Lifecycle
22+
23+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24+
// Called when a new scene session is being created.
25+
// Use this method to select a configuration to create the new scene with.
26+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27+
}
28+
29+
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
30+
// Called when the user discards a scene session.
31+
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32+
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33+
}
34+
35+
// MARK: - Core Data stack
36+
37+
lazy var persistentContainer: NSPersistentCloudKitContainer = {
38+
/*
39+
The persistent container for the application. This implementation
40+
creates and returns a container, having loaded the store for the
41+
application to it. This property is optional since there are legitimate
42+
error conditions that could cause the creation of the store to fail.
43+
*/
44+
let container = NSPersistentCloudKitContainer(name: "Refuel")
45+
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
46+
if let error = error as NSError? {
47+
// Replace this implementation with code to handle the error appropriately.
48+
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
49+
50+
/*
51+
Typical reasons for an error here include:
52+
* The parent directory does not exist, cannot be created, or disallows writing.
53+
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
54+
* The device is out of space.
55+
* The store could not be migrated to the current model version.
56+
Check the error message to determine what the actual problem was.
57+
*/
58+
fatalError("Unresolved error \(error), \(error.userInfo)")
59+
}
60+
})
61+
return container
62+
}()
63+
64+
// MARK: - Core Data Saving support
65+
66+
func saveContext () {
67+
let context = persistentContainer.viewContext
68+
if context.hasChanges {
69+
do {
70+
try context.save()
71+
} catch {
72+
// Replace this implementation with code to handle the error appropriately.
73+
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
74+
let nserror = error as NSError
75+
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
76+
}
77+
}
78+
}
79+
80+
}
81+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"scale" : "2x",
6+
"size" : "20x20"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"scale" : "3x",
11+
"size" : "20x20"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"scale" : "2x",
16+
"size" : "29x29"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"scale" : "3x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"scale" : "2x",
26+
"size" : "40x40"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"scale" : "1x",
46+
"size" : "20x20"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"scale" : "2x",
51+
"size" : "20x20"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"scale" : "1x",
56+
"size" : "29x29"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "29x29"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"scale" : "1x",
66+
"size" : "40x40"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"scale" : "2x",
71+
"size" : "40x40"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "1x",
76+
"size" : "76x76"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"scale" : "2x",
81+
"size" : "76x76"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"scale" : "2x",
86+
"size" : "83.5x83.5"
87+
},
88+
{
89+
"idiom" : "ios-marketing",
90+
"scale" : "1x",
91+
"size" : "1024x1024"
92+
}
93+
],
94+
"info" : {
95+
"author" : "xcode",
96+
"version" : 1
97+
}
98+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<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">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
17+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+
</objects>
22+
<point key="canvasLocation" x="53" y="375"/>
23+
</scene>
24+
</scenes>
25+
</document>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
6+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
7+
<capability name="System colors in document resources" minToolsVersion="11.0"/>
8+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9+
</dependencies>
10+
<scenes>
11+
<!--View Controller-->
12+
<scene sceneID="tne-QT-ifu">
13+
<objects>
14+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Refuel" customModuleProvider="target" sceneMemberID="viewController">
15+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
16+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
19+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="94" y="98"/>
25+
</scene>
26+
</scenes>
27+
<resources>
28+
<systemColor name="systemBackgroundColor">
29+
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
30+
</systemColor>
31+
</resources>
32+
</document>

Refuel/Refuel/Info.plist

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>油耗</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UIApplicationSceneManifest</key>
26+
<dict>
27+
<key>UIApplicationSupportsMultipleScenes</key>
28+
<false/>
29+
<key>UISceneConfigurations</key>
30+
<dict>
31+
<key>UIWindowSceneSessionRoleApplication</key>
32+
<array>
33+
<dict>
34+
<key>UISceneConfigurationName</key>
35+
<string>Default Configuration</string>
36+
<key>UISceneDelegateClassName</key>
37+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
38+
<key>UISceneStoryboardFile</key>
39+
<string>Main</string>
40+
</dict>
41+
</array>
42+
</dict>
43+
</dict>
44+
<key>UIApplicationSupportsIndirectInputEvents</key>
45+
<true/>
46+
<key>UILaunchStoryboardName</key>
47+
<string>LaunchScreen</string>
48+
<key>UIMainStoryboardFile</key>
49+
<string>Main</string>
50+
<key>UIRequiredDeviceCapabilities</key>
51+
<array>
52+
<string>armv7</string>
53+
</array>
54+
<key>UISupportedInterfaceOrientations</key>
55+
<array>
56+
<string>UIInterfaceOrientationPortrait</string>
57+
<string>UIInterfaceOrientationLandscapeLeft</string>
58+
<string>UIInterfaceOrientationLandscapeRight</string>
59+
</array>
60+
<key>UISupportedInterfaceOrientations~ipad</key>
61+
<array>
62+
<string>UIInterfaceOrientationPortrait</string>
63+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
64+
<string>UIInterfaceOrientationLandscapeLeft</string>
65+
<string>UIInterfaceOrientationLandscapeRight</string>
66+
</array>
67+
</dict>
68+
</plist>

0 commit comments

Comments
 (0)