Skip to content

Commit b648688

Browse files
committed
update
1 parent 62c20db commit b648688

File tree

25 files changed

+1200
-2
lines changed

25 files changed

+1200
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SwiftUI by Example
22
---
33

4-
SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问题以及了解SwiftUI的实际工作方式
4+
SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问题以及了解 SwiftUI 的实际工作方式
55

66
## 介绍
77

@@ -84,4 +84,6 @@ SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问
8484
- [视图出现后如何立即启动动画?](example/animation/demo6)
8585
- [如何在一个视图中应用多个动画?](example/animation/demo7)
8686
- [如何使用 matchedGeometryEffect() 将动画从一个视图同步到另一个视图?](example/animation/demo8)
87-
- [如何通过过渡添加和删除视图?](example/animation/demo9)
87+
- [如何通过过渡添加和删除视图?](example/animation/demo9)
88+
- [如何创建不对称过渡?](example/animation/demo10)
89+
- [如何创建自定义过渡?](example/animation/demo11)
Lines changed: 338 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,338 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 50;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
7D4990252600C7B400504434 /* DemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D4990242600C7B400504434 /* DemoApp.swift */; };
11+
7D4990272600C7B400504434 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D4990262600C7B400504434 /* ContentView.swift */; };
12+
7D4990292600C7B500504434 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D4990282600C7B500504434 /* Assets.xcassets */; };
13+
7D49902C2600C7B500504434 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D49902B2600C7B500504434 /* Preview Assets.xcassets */; };
14+
/* End PBXBuildFile section */
15+
16+
/* Begin PBXFileReference section */
17+
7D4990212600C7B400504434 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
18+
7D4990242600C7B400504434 /* DemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoApp.swift; sourceTree = "<group>"; };
19+
7D4990262600C7B400504434 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
20+
7D4990282600C7B500504434 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
21+
7D49902B2600C7B500504434 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
22+
7D49902D2600C7B500504434 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
23+
7D49902E2600C7B500504434 /* Demo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Demo.entitlements; sourceTree = "<group>"; };
24+
/* End PBXFileReference section */
25+
26+
/* Begin PBXFrameworksBuildPhase section */
27+
7D49901E2600C7B400504434 /* Frameworks */ = {
28+
isa = PBXFrameworksBuildPhase;
29+
buildActionMask = 2147483647;
30+
files = (
31+
);
32+
runOnlyForDeploymentPostprocessing = 0;
33+
};
34+
/* End PBXFrameworksBuildPhase section */
35+
36+
/* Begin PBXGroup section */
37+
7D4990182600C7B400504434 = {
38+
isa = PBXGroup;
39+
children = (
40+
7D4990232600C7B400504434 /* Demo */,
41+
7D4990222600C7B400504434 /* Products */,
42+
);
43+
sourceTree = "<group>";
44+
};
45+
7D4990222600C7B400504434 /* Products */ = {
46+
isa = PBXGroup;
47+
children = (
48+
7D4990212600C7B400504434 /* Demo.app */,
49+
);
50+
name = Products;
51+
sourceTree = "<group>";
52+
};
53+
7D4990232600C7B400504434 /* Demo */ = {
54+
isa = PBXGroup;
55+
children = (
56+
7D4990242600C7B400504434 /* DemoApp.swift */,
57+
7D4990262600C7B400504434 /* ContentView.swift */,
58+
7D4990282600C7B500504434 /* Assets.xcassets */,
59+
7D49902D2600C7B500504434 /* Info.plist */,
60+
7D49902E2600C7B500504434 /* Demo.entitlements */,
61+
7D49902A2600C7B500504434 /* Preview Content */,
62+
);
63+
path = Demo;
64+
sourceTree = "<group>";
65+
};
66+
7D49902A2600C7B500504434 /* Preview Content */ = {
67+
isa = PBXGroup;
68+
children = (
69+
7D49902B2600C7B500504434 /* Preview Assets.xcassets */,
70+
);
71+
path = "Preview Content";
72+
sourceTree = "<group>";
73+
};
74+
/* End PBXGroup section */
75+
76+
/* Begin PBXNativeTarget section */
77+
7D4990202600C7B400504434 /* Demo */ = {
78+
isa = PBXNativeTarget;
79+
buildConfigurationList = 7D4990312600C7B500504434 /* Build configuration list for PBXNativeTarget "Demo" */;
80+
buildPhases = (
81+
7D49901D2600C7B400504434 /* Sources */,
82+
7D49901E2600C7B400504434 /* Frameworks */,
83+
7D49901F2600C7B400504434 /* Resources */,
84+
);
85+
buildRules = (
86+
);
87+
dependencies = (
88+
);
89+
name = Demo;
90+
productName = Demo;
91+
productReference = 7D4990212600C7B400504434 /* Demo.app */;
92+
productType = "com.apple.product-type.application";
93+
};
94+
/* End PBXNativeTarget section */
95+
96+
/* Begin PBXProject section */
97+
7D4990192600C7B400504434 /* Project object */ = {
98+
isa = PBXProject;
99+
attributes = {
100+
LastSwiftUpdateCheck = 1240;
101+
LastUpgradeCheck = 1240;
102+
TargetAttributes = {
103+
7D4990202600C7B400504434 = {
104+
CreatedOnToolsVersion = 12.4;
105+
};
106+
};
107+
};
108+
buildConfigurationList = 7D49901C2600C7B400504434 /* Build configuration list for PBXProject "Demo" */;
109+
compatibilityVersion = "Xcode 9.3";
110+
developmentRegion = en;
111+
hasScannedForEncodings = 0;
112+
knownRegions = (
113+
en,
114+
Base,
115+
);
116+
mainGroup = 7D4990182600C7B400504434;
117+
productRefGroup = 7D4990222600C7B400504434 /* Products */;
118+
projectDirPath = "";
119+
projectRoot = "";
120+
targets = (
121+
7D4990202600C7B400504434 /* Demo */,
122+
);
123+
};
124+
/* End PBXProject section */
125+
126+
/* Begin PBXResourcesBuildPhase section */
127+
7D49901F2600C7B400504434 /* Resources */ = {
128+
isa = PBXResourcesBuildPhase;
129+
buildActionMask = 2147483647;
130+
files = (
131+
7D49902C2600C7B500504434 /* Preview Assets.xcassets in Resources */,
132+
7D4990292600C7B500504434 /* Assets.xcassets in Resources */,
133+
);
134+
runOnlyForDeploymentPostprocessing = 0;
135+
};
136+
/* End PBXResourcesBuildPhase section */
137+
138+
/* Begin PBXSourcesBuildPhase section */
139+
7D49901D2600C7B400504434 /* Sources */ = {
140+
isa = PBXSourcesBuildPhase;
141+
buildActionMask = 2147483647;
142+
files = (
143+
7D4990272600C7B400504434 /* ContentView.swift in Sources */,
144+
7D4990252600C7B400504434 /* DemoApp.swift in Sources */,
145+
);
146+
runOnlyForDeploymentPostprocessing = 0;
147+
};
148+
/* End PBXSourcesBuildPhase section */
149+
150+
/* Begin XCBuildConfiguration section */
151+
7D49902F2600C7B500504434 /* Debug */ = {
152+
isa = XCBuildConfiguration;
153+
buildSettings = {
154+
ALWAYS_SEARCH_USER_PATHS = NO;
155+
CLANG_ANALYZER_NONNULL = YES;
156+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
157+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
158+
CLANG_CXX_LIBRARY = "libc++";
159+
CLANG_ENABLE_MODULES = YES;
160+
CLANG_ENABLE_OBJC_ARC = YES;
161+
CLANG_ENABLE_OBJC_WEAK = YES;
162+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
163+
CLANG_WARN_BOOL_CONVERSION = YES;
164+
CLANG_WARN_COMMA = YES;
165+
CLANG_WARN_CONSTANT_CONVERSION = YES;
166+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
167+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
168+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
169+
CLANG_WARN_EMPTY_BODY = YES;
170+
CLANG_WARN_ENUM_CONVERSION = YES;
171+
CLANG_WARN_INFINITE_RECURSION = YES;
172+
CLANG_WARN_INT_CONVERSION = YES;
173+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
174+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
175+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
176+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
177+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
178+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
179+
CLANG_WARN_STRICT_PROTOTYPES = YES;
180+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
181+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
182+
CLANG_WARN_UNREACHABLE_CODE = YES;
183+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
184+
COPY_PHASE_STRIP = NO;
185+
DEBUG_INFORMATION_FORMAT = dwarf;
186+
ENABLE_STRICT_OBJC_MSGSEND = YES;
187+
ENABLE_TESTABILITY = YES;
188+
GCC_C_LANGUAGE_STANDARD = gnu11;
189+
GCC_DYNAMIC_NO_PIC = NO;
190+
GCC_NO_COMMON_BLOCKS = YES;
191+
GCC_OPTIMIZATION_LEVEL = 0;
192+
GCC_PREPROCESSOR_DEFINITIONS = (
193+
"DEBUG=1",
194+
"$(inherited)",
195+
);
196+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
197+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
198+
GCC_WARN_UNDECLARED_SELECTOR = YES;
199+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
200+
GCC_WARN_UNUSED_FUNCTION = YES;
201+
GCC_WARN_UNUSED_VARIABLE = YES;
202+
MACOSX_DEPLOYMENT_TARGET = 11.1;
203+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
204+
MTL_FAST_MATH = YES;
205+
ONLY_ACTIVE_ARCH = YES;
206+
SDKROOT = macosx;
207+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
208+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
209+
};
210+
name = Debug;
211+
};
212+
7D4990302600C7B500504434 /* Release */ = {
213+
isa = XCBuildConfiguration;
214+
buildSettings = {
215+
ALWAYS_SEARCH_USER_PATHS = NO;
216+
CLANG_ANALYZER_NONNULL = YES;
217+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
218+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
219+
CLANG_CXX_LIBRARY = "libc++";
220+
CLANG_ENABLE_MODULES = YES;
221+
CLANG_ENABLE_OBJC_ARC = YES;
222+
CLANG_ENABLE_OBJC_WEAK = YES;
223+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
224+
CLANG_WARN_BOOL_CONVERSION = YES;
225+
CLANG_WARN_COMMA = YES;
226+
CLANG_WARN_CONSTANT_CONVERSION = YES;
227+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
228+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
229+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
230+
CLANG_WARN_EMPTY_BODY = YES;
231+
CLANG_WARN_ENUM_CONVERSION = YES;
232+
CLANG_WARN_INFINITE_RECURSION = YES;
233+
CLANG_WARN_INT_CONVERSION = YES;
234+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
235+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
236+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
237+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
238+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
239+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
240+
CLANG_WARN_STRICT_PROTOTYPES = YES;
241+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
242+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
243+
CLANG_WARN_UNREACHABLE_CODE = YES;
244+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
245+
COPY_PHASE_STRIP = NO;
246+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
247+
ENABLE_NS_ASSERTIONS = NO;
248+
ENABLE_STRICT_OBJC_MSGSEND = YES;
249+
GCC_C_LANGUAGE_STANDARD = gnu11;
250+
GCC_NO_COMMON_BLOCKS = YES;
251+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
252+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
253+
GCC_WARN_UNDECLARED_SELECTOR = YES;
254+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
255+
GCC_WARN_UNUSED_FUNCTION = YES;
256+
GCC_WARN_UNUSED_VARIABLE = YES;
257+
MACOSX_DEPLOYMENT_TARGET = 11.1;
258+
MTL_ENABLE_DEBUG_INFO = NO;
259+
MTL_FAST_MATH = YES;
260+
SDKROOT = macosx;
261+
SWIFT_COMPILATION_MODE = wholemodule;
262+
SWIFT_OPTIMIZATION_LEVEL = "-O";
263+
};
264+
name = Release;
265+
};
266+
7D4990322600C7B500504434 /* Debug */ = {
267+
isa = XCBuildConfiguration;
268+
buildSettings = {
269+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
270+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
271+
CODE_SIGN_ENTITLEMENTS = Demo/Demo.entitlements;
272+
CODE_SIGN_STYLE = Automatic;
273+
COMBINE_HIDPI_IMAGES = YES;
274+
DEVELOPMENT_ASSET_PATHS = "\"Demo/Preview Content\"";
275+
DEVELOPMENT_TEAM = 968DSZ49MT;
276+
ENABLE_HARDENED_RUNTIME = YES;
277+
ENABLE_PREVIEWS = YES;
278+
INFOPLIST_FILE = Demo/Info.plist;
279+
LD_RUNPATH_SEARCH_PATHS = (
280+
"$(inherited)",
281+
"@executable_path/../Frameworks",
282+
);
283+
MACOSX_DEPLOYMENT_TARGET = 11.0;
284+
PRODUCT_BUNDLE_IDENTIFIER = demo.Demo;
285+
PRODUCT_NAME = "$(TARGET_NAME)";
286+
SWIFT_VERSION = 5.0;
287+
};
288+
name = Debug;
289+
};
290+
7D4990332600C7B500504434 /* Release */ = {
291+
isa = XCBuildConfiguration;
292+
buildSettings = {
293+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
294+
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
295+
CODE_SIGN_ENTITLEMENTS = Demo/Demo.entitlements;
296+
CODE_SIGN_STYLE = Automatic;
297+
COMBINE_HIDPI_IMAGES = YES;
298+
DEVELOPMENT_ASSET_PATHS = "\"Demo/Preview Content\"";
299+
DEVELOPMENT_TEAM = 968DSZ49MT;
300+
ENABLE_HARDENED_RUNTIME = YES;
301+
ENABLE_PREVIEWS = YES;
302+
INFOPLIST_FILE = Demo/Info.plist;
303+
LD_RUNPATH_SEARCH_PATHS = (
304+
"$(inherited)",
305+
"@executable_path/../Frameworks",
306+
);
307+
MACOSX_DEPLOYMENT_TARGET = 11.0;
308+
PRODUCT_BUNDLE_IDENTIFIER = demo.Demo;
309+
PRODUCT_NAME = "$(TARGET_NAME)";
310+
SWIFT_VERSION = 5.0;
311+
};
312+
name = Release;
313+
};
314+
/* End XCBuildConfiguration section */
315+
316+
/* Begin XCConfigurationList section */
317+
7D49901C2600C7B400504434 /* Build configuration list for PBXProject "Demo" */ = {
318+
isa = XCConfigurationList;
319+
buildConfigurations = (
320+
7D49902F2600C7B500504434 /* Debug */,
321+
7D4990302600C7B500504434 /* Release */,
322+
);
323+
defaultConfigurationIsVisible = 0;
324+
defaultConfigurationName = Release;
325+
};
326+
7D4990312600C7B500504434 /* Build configuration list for PBXNativeTarget "Demo" */ = {
327+
isa = XCConfigurationList;
328+
buildConfigurations = (
329+
7D4990322600C7B500504434 /* Debug */,
330+
7D4990332600C7B500504434 /* Release */,
331+
);
332+
defaultConfigurationIsVisible = 0;
333+
defaultConfigurationName = Release;
334+
};
335+
/* End XCConfigurationList section */
336+
};
337+
rootObject = 7D4990192600C7B400504434 /* Project object */;
338+
}

example/animation/demo10/Demo/Demo.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.
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>
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+
}

0 commit comments

Comments
 (0)