├── DanchuParticle.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── xoul.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── xoul.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── DanchuParticle ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── ic_danchu_gray.imageset │ │ ├── Contents.json │ │ ├── ic_danchu_gray@2x.png │ │ └── ic_danchu_gray@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift └── README.md /DanchuParticle.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 03BAB30C228E82A5009E8D9D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BAB30B228E82A5009E8D9D /* AppDelegate.swift */; }; 11 | 03BAB30E228E82A5009E8D9D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03BAB30D228E82A5009E8D9D /* ViewController.swift */; }; 12 | 03BAB311228E82A5009E8D9D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03BAB30F228E82A5009E8D9D /* Main.storyboard */; }; 13 | 03BAB313228E82A7009E8D9D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03BAB312228E82A7009E8D9D /* Assets.xcassets */; }; 14 | 03BAB316228E82A7009E8D9D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03BAB314228E82A7009E8D9D /* LaunchScreen.storyboard */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 03BAB308228E82A5009E8D9D /* DanchuParticle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DanchuParticle.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 03BAB30B228E82A5009E8D9D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 20 | 03BAB30D228E82A5009E8D9D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 21 | 03BAB310228E82A5009E8D9D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 22 | 03BAB312228E82A7009E8D9D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 23 | 03BAB315228E82A7009E8D9D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 24 | 03BAB317228E82A7009E8D9D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 03BAB305228E82A5009E8D9D /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 03BAB2FF228E82A5009E8D9D = { 39 | isa = PBXGroup; 40 | children = ( 41 | 03BAB30A228E82A5009E8D9D /* DanchuParticle */, 42 | 03BAB309228E82A5009E8D9D /* Products */, 43 | ); 44 | sourceTree = ""; 45 | }; 46 | 03BAB309228E82A5009E8D9D /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 03BAB308228E82A5009E8D9D /* DanchuParticle.app */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 03BAB30A228E82A5009E8D9D /* DanchuParticle */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 03BAB30B228E82A5009E8D9D /* AppDelegate.swift */, 58 | 03BAB30D228E82A5009E8D9D /* ViewController.swift */, 59 | 03BAB30F228E82A5009E8D9D /* Main.storyboard */, 60 | 03BAB312228E82A7009E8D9D /* Assets.xcassets */, 61 | 03BAB314228E82A7009E8D9D /* LaunchScreen.storyboard */, 62 | 03BAB317228E82A7009E8D9D /* Info.plist */, 63 | ); 64 | path = DanchuParticle; 65 | sourceTree = ""; 66 | }; 67 | /* End PBXGroup section */ 68 | 69 | /* Begin PBXNativeTarget section */ 70 | 03BAB307228E82A5009E8D9D /* DanchuParticle */ = { 71 | isa = PBXNativeTarget; 72 | buildConfigurationList = 03BAB31A228E82A7009E8D9D /* Build configuration list for PBXNativeTarget "DanchuParticle" */; 73 | buildPhases = ( 74 | 03BAB304228E82A5009E8D9D /* Sources */, 75 | 03BAB305228E82A5009E8D9D /* Frameworks */, 76 | 03BAB306228E82A5009E8D9D /* Resources */, 77 | ); 78 | buildRules = ( 79 | ); 80 | dependencies = ( 81 | ); 82 | name = DanchuParticle; 83 | productName = DanchuParticle; 84 | productReference = 03BAB308228E82A5009E8D9D /* DanchuParticle.app */; 85 | productType = "com.apple.product-type.application"; 86 | }; 87 | /* End PBXNativeTarget section */ 88 | 89 | /* Begin PBXProject section */ 90 | 03BAB300228E82A5009E8D9D /* Project object */ = { 91 | isa = PBXProject; 92 | attributes = { 93 | LastSwiftUpdateCheck = 1020; 94 | LastUpgradeCheck = 1020; 95 | ORGANIZATIONNAME = "Suyeol Jeon"; 96 | TargetAttributes = { 97 | 03BAB307228E82A5009E8D9D = { 98 | CreatedOnToolsVersion = 10.2.1; 99 | }; 100 | }; 101 | }; 102 | buildConfigurationList = 03BAB303228E82A5009E8D9D /* Build configuration list for PBXProject "DanchuParticle" */; 103 | compatibilityVersion = "Xcode 9.3"; 104 | developmentRegion = en; 105 | hasScannedForEncodings = 0; 106 | knownRegions = ( 107 | en, 108 | Base, 109 | ); 110 | mainGroup = 03BAB2FF228E82A5009E8D9D; 111 | productRefGroup = 03BAB309228E82A5009E8D9D /* Products */; 112 | projectDirPath = ""; 113 | projectRoot = ""; 114 | targets = ( 115 | 03BAB307228E82A5009E8D9D /* DanchuParticle */, 116 | ); 117 | }; 118 | /* End PBXProject section */ 119 | 120 | /* Begin PBXResourcesBuildPhase section */ 121 | 03BAB306228E82A5009E8D9D /* Resources */ = { 122 | isa = PBXResourcesBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | 03BAB316228E82A7009E8D9D /* LaunchScreen.storyboard in Resources */, 126 | 03BAB313228E82A7009E8D9D /* Assets.xcassets in Resources */, 127 | 03BAB311228E82A5009E8D9D /* Main.storyboard in Resources */, 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | /* End PBXResourcesBuildPhase section */ 132 | 133 | /* Begin PBXSourcesBuildPhase section */ 134 | 03BAB304228E82A5009E8D9D /* Sources */ = { 135 | isa = PBXSourcesBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | 03BAB30E228E82A5009E8D9D /* ViewController.swift in Sources */, 139 | 03BAB30C228E82A5009E8D9D /* AppDelegate.swift in Sources */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXSourcesBuildPhase section */ 144 | 145 | /* Begin PBXVariantGroup section */ 146 | 03BAB30F228E82A5009E8D9D /* Main.storyboard */ = { 147 | isa = PBXVariantGroup; 148 | children = ( 149 | 03BAB310228E82A5009E8D9D /* Base */, 150 | ); 151 | name = Main.storyboard; 152 | sourceTree = ""; 153 | }; 154 | 03BAB314228E82A7009E8D9D /* LaunchScreen.storyboard */ = { 155 | isa = PBXVariantGroup; 156 | children = ( 157 | 03BAB315228E82A7009E8D9D /* Base */, 158 | ); 159 | name = LaunchScreen.storyboard; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXVariantGroup section */ 163 | 164 | /* Begin XCBuildConfiguration section */ 165 | 03BAB318228E82A7009E8D9D /* Debug */ = { 166 | isa = XCBuildConfiguration; 167 | buildSettings = { 168 | ALWAYS_SEARCH_USER_PATHS = NO; 169 | CLANG_ANALYZER_NONNULL = YES; 170 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 171 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 172 | CLANG_CXX_LIBRARY = "libc++"; 173 | CLANG_ENABLE_MODULES = YES; 174 | CLANG_ENABLE_OBJC_ARC = YES; 175 | CLANG_ENABLE_OBJC_WEAK = YES; 176 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 177 | CLANG_WARN_BOOL_CONVERSION = YES; 178 | CLANG_WARN_COMMA = YES; 179 | CLANG_WARN_CONSTANT_CONVERSION = YES; 180 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 181 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 182 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 183 | CLANG_WARN_EMPTY_BODY = YES; 184 | CLANG_WARN_ENUM_CONVERSION = YES; 185 | CLANG_WARN_INFINITE_RECURSION = YES; 186 | CLANG_WARN_INT_CONVERSION = YES; 187 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 189 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 191 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 192 | CLANG_WARN_STRICT_PROTOTYPES = YES; 193 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 194 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | CODE_SIGN_IDENTITY = "iPhone Developer"; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu11; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 217 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 218 | MTL_FAST_MATH = YES; 219 | ONLY_ACTIVE_ARCH = YES; 220 | SDKROOT = iphoneos; 221 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 222 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 223 | }; 224 | name = Debug; 225 | }; 226 | 03BAB319228E82A7009E8D9D /* Release */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | ALWAYS_SEARCH_USER_PATHS = NO; 230 | CLANG_ANALYZER_NONNULL = YES; 231 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 233 | CLANG_CXX_LIBRARY = "libc++"; 234 | CLANG_ENABLE_MODULES = YES; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | CLANG_ENABLE_OBJC_WEAK = YES; 237 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_COMMA = YES; 240 | CLANG_WARN_CONSTANT_CONVERSION = YES; 241 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 242 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 243 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 244 | CLANG_WARN_EMPTY_BODY = YES; 245 | CLANG_WARN_ENUM_CONVERSION = YES; 246 | CLANG_WARN_INFINITE_RECURSION = YES; 247 | CLANG_WARN_INT_CONVERSION = YES; 248 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 249 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 250 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 251 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 252 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 253 | CLANG_WARN_STRICT_PROTOTYPES = YES; 254 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 255 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 256 | CLANG_WARN_UNREACHABLE_CODE = YES; 257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 258 | CODE_SIGN_IDENTITY = "iPhone Developer"; 259 | COPY_PHASE_STRIP = NO; 260 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 261 | ENABLE_NS_ASSERTIONS = NO; 262 | ENABLE_STRICT_OBJC_MSGSEND = YES; 263 | GCC_C_LANGUAGE_STANDARD = gnu11; 264 | GCC_NO_COMMON_BLOCKS = YES; 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 267 | GCC_WARN_UNDECLARED_SELECTOR = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 269 | GCC_WARN_UNUSED_FUNCTION = YES; 270 | GCC_WARN_UNUSED_VARIABLE = YES; 271 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 272 | MTL_ENABLE_DEBUG_INFO = NO; 273 | MTL_FAST_MATH = YES; 274 | SDKROOT = iphoneos; 275 | SWIFT_COMPILATION_MODE = wholemodule; 276 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 277 | VALIDATE_PRODUCT = YES; 278 | }; 279 | name = Release; 280 | }; 281 | 03BAB31B228E82A7009E8D9D /* Debug */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | CODE_SIGN_STYLE = Automatic; 286 | DEVELOPMENT_TEAM = N2C267LBVY; 287 | INFOPLIST_FILE = DanchuParticle/Info.plist; 288 | LD_RUNPATH_SEARCH_PATHS = ( 289 | "$(inherited)", 290 | "@executable_path/Frameworks", 291 | ); 292 | PRODUCT_BUNDLE_IDENTIFIER = com.styleshare.DanchuParticle; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_VERSION = 5.0; 295 | TARGETED_DEVICE_FAMILY = "1,2"; 296 | }; 297 | name = Debug; 298 | }; 299 | 03BAB31C228E82A7009E8D9D /* Release */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | CODE_SIGN_STYLE = Automatic; 304 | DEVELOPMENT_TEAM = N2C267LBVY; 305 | INFOPLIST_FILE = DanchuParticle/Info.plist; 306 | LD_RUNPATH_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | "@executable_path/Frameworks", 309 | ); 310 | PRODUCT_BUNDLE_IDENTIFIER = com.styleshare.DanchuParticle; 311 | PRODUCT_NAME = "$(TARGET_NAME)"; 312 | SWIFT_VERSION = 5.0; 313 | TARGETED_DEVICE_FAMILY = "1,2"; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 03BAB303228E82A5009E8D9D /* Build configuration list for PBXProject "DanchuParticle" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 03BAB318228E82A7009E8D9D /* Debug */, 324 | 03BAB319228E82A7009E8D9D /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 03BAB31A228E82A7009E8D9D /* Build configuration list for PBXNativeTarget "DanchuParticle" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 03BAB31B228E82A7009E8D9D /* Debug */, 333 | 03BAB31C228E82A7009E8D9D /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = 03BAB300228E82A5009E8D9D /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /DanchuParticle.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DanchuParticle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DanchuParticle.xcodeproj/project.xcworkspace/xcuserdata/xoul.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StyleShare/DanchuParticle/9822ce51e7b79b2de726d55e392def2ce008c282/DanchuParticle.xcodeproj/project.xcworkspace/xcuserdata/xoul.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DanchuParticle.xcodeproj/xcuserdata/xoul.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DanchuParticle.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DanchuParticle/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DanchuParticle 4 | // 5 | // Created by Suyeol Jeon on 17/05/2019. 6 | // Copyright © 2019 Suyeol Jeon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /DanchuParticle/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 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 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /DanchuParticle/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DanchuParticle/Assets.xcassets/ic_danchu_gray.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ic_danchu_gray@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ic_danchu_gray@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DanchuParticle/Assets.xcassets/ic_danchu_gray.imageset/ic_danchu_gray@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StyleShare/DanchuParticle/9822ce51e7b79b2de726d55e392def2ce008c282/DanchuParticle/Assets.xcassets/ic_danchu_gray.imageset/ic_danchu_gray@2x.png -------------------------------------------------------------------------------- /DanchuParticle/Assets.xcassets/ic_danchu_gray.imageset/ic_danchu_gray@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StyleShare/DanchuParticle/9822ce51e7b79b2de726d55e392def2ce008c282/DanchuParticle/Assets.xcassets/ic_danchu_gray.imageset/ic_danchu_gray@3x.png -------------------------------------------------------------------------------- /DanchuParticle/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DanchuParticle/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DanchuParticle/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DanchuParticle/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DanchuParticle 4 | // 5 | // Created by Suyeol Jeon on 17/05/2019. 6 | // Copyright © 2019 Suyeol Jeon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private final class Particle: UIImageView { 12 | var acceleration: CGPoint = .zero 13 | var velocity: CGPoint = .zero 14 | var angle: CGFloat = 0 { 15 | didSet { 16 | self.transform = CGAffineTransform(rotationAngle: self.angle) 17 | } 18 | } 19 | } 20 | 21 | final class ViewController: UIViewController { 22 | private var particles = Set() 23 | private let gravity: CGFloat = 1 24 | private let friction: CGFloat = 0.8 25 | 26 | private var timer: Timer? 27 | 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | 31 | let displayLink = CADisplayLink(target: self, selector: #selector(frame)) 32 | displayLink.add(to: .current, forMode: .default) 33 | } 34 | 35 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 36 | super.touchesBegan(touches, with: event) 37 | self.play() 38 | self.timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] _ in 39 | self?.play() 40 | } 41 | } 42 | 43 | override func touchesEnded(_ touches: Set, with event: UIEvent?) { 44 | super.touchesEnded(touches, with: event) 45 | self.timer?.invalidate() 46 | } 47 | 48 | private func play() { 49 | UIImpactFeedbackGenerator(style: .light).impactOccurred() 50 | 51 | let count = Int.random(in: 5...10) 52 | for _ in 0.. self.view.frame.height { 87 | self.particles.remove(view) 88 | view.removeFromSuperview() 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DanchuParticle 2 | 3 | A demo application for a danchu particle effect. This is a prototype to demonstrate the effect, which means that it has no performance optimization at all. 4 | 5 | ![danchu-particle mov](https://user-images.githubusercontent.com/931655/57913365-6c299400-78c7-11e9-9691-c2908bda2fc1.gif) 6 | 7 | ## How it works 8 | 9 | It is implemented with the very basic knowledges of physics: acceleration, velocity, gravity and friction. 10 | 11 | 1. Each time the user taps the screen, it generates a random number of views with a random acceleration. 12 | 2. On every tick, the friction affects the acceleration. 13 | 3. On every tick, the acceleration and the gravity affects the velocity. 14 | 4. On every tick, the velocity affects the frame origin. 15 | 16 | ## Author 17 | 18 | Suyeol Jeon (https://github.com/devxoul) 19 | --------------------------------------------------------------------------------