Skip to content

Commit 3cb850e

Browse files
author
yanqizhou
committed
add swift demo
1 parent 1c5c464 commit 3cb850e

File tree

16 files changed

+855
-0
lines changed

16 files changed

+855
-0
lines changed

SwiftDebugDatabase/Podfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target 'SwiftDebugDatabase' do
2+
use_frameworks!
3+
pod 'YYDebugDatabase', :path => '../'
4+
end
5+

SwiftDebugDatabase/SwiftDebugDatabase.xcodeproj/project.pbxproj

+410
Large diffs are not rendered by default.

SwiftDebugDatabase/SwiftDebugDatabase.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0820"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "E8D7933E1F989FC6007BECF8"
18+
BuildableName = "SwiftDebugDatabase.app"
19+
BlueprintName = "SwiftDebugDatabase"
20+
ReferencedContainer = "container:SwiftDebugDatabase.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "E8D7933E1F989FC6007BECF8"
36+
BuildableName = "SwiftDebugDatabase.app"
37+
BlueprintName = "SwiftDebugDatabase"
38+
ReferencedContainer = "container:SwiftDebugDatabase.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "E8D7933E1F989FC6007BECF8"
59+
BuildableName = "SwiftDebugDatabase.app"
60+
BlueprintName = "SwiftDebugDatabase"
61+
ReferencedContainer = "container:SwiftDebugDatabase.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "E8D7933E1F989FC6007BECF8"
78+
BuildableName = "SwiftDebugDatabase.app"
79+
BlueprintName = "SwiftDebugDatabase"
80+
ReferencedContainer = "container:SwiftDebugDatabase.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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>SchemeUserState</key>
6+
<dict>
7+
<key>SwiftDebugDatabase.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>E8D7933E1F989FC6007BECF8</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>

SwiftDebugDatabase/SwiftDebugDatabase.xcworkspace/contents.xcworkspacedata

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "0"
4+
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "Yes"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No"
12+
filePath = "Pods/YYDebugDatabase/DebugDatabase/DebugDatabaseManager.m"
13+
timestampString = "530107623.988559"
14+
startingColumnNumber = "9223372036854775807"
15+
endingColumnNumber = "9223372036854775807"
16+
startingLineNumber = "101"
17+
endingLineNumber = "101"
18+
landmarkName = "-socket:didReadData:withTag:"
19+
landmarkType = "7">
20+
</BreakpointContent>
21+
</BreakpointProxy>
22+
<BreakpointProxy
23+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
24+
<BreakpointContent
25+
shouldBeEnabled = "Yes"
26+
ignoreCount = "0"
27+
continueAfterRunningActions = "No"
28+
filePath = "Pods/YYDebugDatabase/DebugDatabase/DebugDatabaseManager.m"
29+
timestampString = "530108008.567792"
30+
startingColumnNumber = "9223372036854775807"
31+
endingColumnNumber = "9223372036854775807"
32+
startingLineNumber = "242"
33+
endingLineNumber = "242"
34+
landmarkName = "-getAllDBPathsWithDirectories:"
35+
landmarkType = "7">
36+
</BreakpointContent>
37+
</BreakpointProxy>
38+
</Breakpoints>
39+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// AppDelegate.swift
3+
// SwiftDebugDatabase
4+
//
5+
// Created by wentian on 17/10/19.
6+
// Copyright © 2017年 wentian. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import YYDebugDatabase
11+
import Foundation
12+
13+
@UIApplicationMain
14+
class AppDelegate: UIResponder, UIApplicationDelegate {
15+
16+
var window: UIWindow?
17+
18+
19+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
20+
// Override point for customization after application launch.
21+
22+
let directory:String = (Bundle.main.resourcePath)!;
23+
DebugDatabaseManager.shared().startServer(onPort: 9002, directories: [directory]);
24+
25+
return true
26+
}
27+
28+
func applicationWillResignActive(_ application: UIApplication) {
29+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
30+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
31+
}
32+
33+
func applicationDidEnterBackground(_ application: UIApplication) {
34+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
35+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
36+
}
37+
38+
func applicationWillEnterForeground(_ application: UIApplication) {
39+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
40+
}
41+
42+
func applicationDidBecomeActive(_ application: UIApplication) {
43+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
44+
}
45+
46+
func applicationWillTerminate(_ application: UIApplication) {
47+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48+
}
49+
50+
51+
}
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"size" : "29x29",
56+
"scale" : "1x"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"size" : "29x29",
61+
"scale" : "2x"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"size" : "40x40",
66+
"scale" : "1x"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"size" : "40x40",
71+
"scale" : "2x"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"size" : "76x76",
76+
"scale" : "1x"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"size" : "76x76",
81+
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
87+
}
88+
],
89+
"info" : {
90+
"version" : 1,
91+
"author" : "xcode"
92+
}
93+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="tne-QT-ifu">
10+
<objects>
11+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
23+
</objects>
24+
</scene>
25+
</scenes>
26+
</document>
16 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)