Commit 69c751236fe8d6793a62718ee59e48b97a23e57c
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud
Conflicts: LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
| @@ -123,6 +123,17 @@ | @@ -123,6 +123,17 @@ | ||
| 123 | D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */; }; | 123 | D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */; }; |
| 124 | D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CFE1E6EAE2E0027CD92 /* ZXServerUrl.m */; }; | 124 | D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CFE1E6EAE2E0027CD92 /* ZXServerUrl.m */; }; |
| 125 | D2029D161E6EB00D0027CD92 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029D151E6EB00D0027CD92 /* AppDelegate.m */; }; | 125 | D2029D161E6EB00D0027CD92 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029D151E6EB00D0027CD92 /* AppDelegate.m */; }; |
| 126 | + D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C451E76857100E3A8FC /* LVCAnimationManager.m */; }; | ||
| 127 | + D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */; }; | ||
| 128 | + D2575C671E76A25400E3A8FC /* LVCInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C661E76A25400E3A8FC /* LVCInteractionController.m */; }; | ||
| 129 | + D2575C6B1E76A45400E3A8FC /* LVCGiftManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */; }; | ||
| 130 | + D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */; }; | ||
| 131 | + D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */ = {isa = PBXBuildFile; fileRef = D2575C701E76A4F300E3A8FC /* NHCarViews.xib */; }; | ||
| 132 | + D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */ = {isa = PBXBuildFile; fileRef = D2575C721E76A4F300E3A8FC /* NHFighterView.nib */; }; | ||
| 133 | + D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2575C731E76A4F300E3A8FC /* NHGiftAnimtionSDK.a */; }; | ||
| 134 | + D2575C7E1E76A4F300E3A8FC /* NHPlaneViews.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C771E76A4F300E3A8FC /* NHPlaneViews.m */; }; | ||
| 135 | + D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */ = {isa = PBXBuildFile; fileRef = D2575C781E76A4F300E3A8FC /* NHPlaneViews.xib */; }; | ||
| 136 | + D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D2575C791E76A4F300E3A8FC /* resource.bundle */; }; | ||
| 126 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */; }; | 137 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */; }; |
| 127 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; }; | 138 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; }; |
| 128 | D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; | 139 | D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; |
| @@ -407,6 +418,27 @@ | @@ -407,6 +418,27 @@ | ||
| 407 | D2029CFF1E6EAE2E0027CD92 /* UtilKits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UtilKits.h; sourceTree = "<group>"; }; | 418 | D2029CFF1E6EAE2E0027CD92 /* UtilKits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UtilKits.h; sourceTree = "<group>"; }; |
| 408 | D2029D121E6EAF8D0027CD92 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; | 419 | D2029D121E6EAF8D0027CD92 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; |
| 409 | D2029D151E6EB00D0027CD92 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; | 420 | D2029D151E6EB00D0027CD92 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; |
| 421 | + D2575C441E76857100E3A8FC /* LVCAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCAnimationManager.h; sourceTree = "<group>"; }; | ||
| 422 | + D2575C451E76857100E3A8FC /* LVCAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCAnimationManager.m; sourceTree = "<group>"; }; | ||
| 423 | + D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Bubbling.m"; sourceTree = "<group>"; }; | ||
| 424 | + D2575C491E7685DE00E3A8FC /* UIView+Bubbling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Bubbling.h"; sourceTree = "<group>"; }; | ||
| 425 | + D2575C651E76A25400E3A8FC /* LVCInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCInteractionController.h; sourceTree = "<group>"; }; | ||
| 426 | + D2575C661E76A25400E3A8FC /* LVCInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCInteractionController.m; sourceTree = "<group>"; }; | ||
| 427 | + D2575C691E76A45400E3A8FC /* LVCGiftManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCGiftManager.h; sourceTree = "<group>"; }; | ||
| 428 | + D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCGiftManager.m; sourceTree = "<group>"; }; | ||
| 429 | + D2575C6D1E76A4F300E3A8FC /* NHCarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHCarView.h; sourceTree = "<group>"; }; | ||
| 430 | + D2575C6E1E76A4F300E3A8FC /* NHCarViews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHCarViews.h; sourceTree = "<group>"; }; | ||
| 431 | + D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NHCarViews.m; sourceTree = "<group>"; }; | ||
| 432 | + D2575C701E76A4F300E3A8FC /* NHCarViews.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NHCarViews.xib; sourceTree = "<group>"; }; | ||
| 433 | + D2575C711E76A4F300E3A8FC /* NHFighterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHFighterView.h; sourceTree = "<group>"; }; | ||
| 434 | + D2575C721E76A4F300E3A8FC /* NHFighterView.nib */ = {isa = PBXFileReference; lastKnownFileType = file; path = NHFighterView.nib; sourceTree = "<group>"; }; | ||
| 435 | + D2575C731E76A4F300E3A8FC /* NHGiftAnimtionSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = NHGiftAnimtionSDK.a; sourceTree = "<group>"; }; | ||
| 436 | + D2575C741E76A4F300E3A8FC /* NHHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHHeader.h; sourceTree = "<group>"; }; | ||
| 437 | + D2575C751E76A4F300E3A8FC /* NHPlaneView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHPlaneView.h; sourceTree = "<group>"; }; | ||
| 438 | + D2575C761E76A4F300E3A8FC /* NHPlaneViews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHPlaneViews.h; sourceTree = "<group>"; }; | ||
| 439 | + D2575C771E76A4F300E3A8FC /* NHPlaneViews.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NHPlaneViews.m; sourceTree = "<group>"; }; | ||
| 440 | + D2575C781E76A4F300E3A8FC /* NHPlaneViews.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NHPlaneViews.xib; sourceTree = "<group>"; }; | ||
| 441 | + D2575C791E76A4F300E3A8FC /* resource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = resource.bundle; sourceTree = "<group>"; }; | ||
| 410 | D2888D921E6EB8B4003A77C8 /* LVCTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTabBar.h; sourceTree = "<group>"; }; | 442 | D2888D921E6EB8B4003A77C8 /* LVCTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTabBar.h; sourceTree = "<group>"; }; |
| 411 | D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTabBar.m; sourceTree = "<group>"; }; | 443 | D2888D931E6EB8B4003A77C8 /* LVCTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTabBar.m; sourceTree = "<group>"; }; |
| 412 | D2888D9A1E6EBF1B003A77C8 /* LVCLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveViewController.h; sourceTree = "<group>"; }; | 444 | D2888D9A1E6EBF1B003A77C8 /* LVCLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveViewController.h; sourceTree = "<group>"; }; |
| @@ -424,6 +456,7 @@ | @@ -424,6 +456,7 @@ | ||
| 424 | isa = PBXFrameworksBuildPhase; | 456 | isa = PBXFrameworksBuildPhase; |
| 425 | buildActionMask = 2147483647; | 457 | buildActionMask = 2147483647; |
| 426 | files = ( | 458 | files = ( |
| 459 | + D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */, | ||
| 427 | 812E50531E7699DC004F5FCD /* CNLivePlayerSDK.framework in Frameworks */, | 460 | 812E50531E7699DC004F5FCD /* CNLivePlayerSDK.framework in Frameworks */, |
| 428 | 812E50551E7699E9004F5FCD /* CNLiveMsgTools.framework in Frameworks */, | 461 | 812E50551E7699E9004F5FCD /* CNLiveMsgTools.framework in Frameworks */, |
| 429 | ); | 462 | ); |
| @@ -903,6 +936,7 @@ | @@ -903,6 +936,7 @@ | ||
| 903 | D2888DA71E6EC014003A77C8 /* homeSections */, | 936 | D2888DA71E6EC014003A77C8 /* homeSections */, |
| 904 | D2888D951E6EBAA7003A77C8 /* LiveSections */, | 937 | D2888D951E6EBAA7003A77C8 /* LiveSections */, |
| 905 | D2888DAB1E6EC014003A77C8 /* mySections */, | 938 | D2888DAB1E6EC014003A77C8 /* mySections */, |
| 939 | + D2575C431E76846900E3A8FC /* InteractionSections */, | ||
| 906 | D2029C751E6EADE10027CD92 /* ZXSections(例子) */, | 940 | D2029C751E6EADE10027CD92 /* ZXSections(例子) */, |
| 907 | ); | 941 | ); |
| 908 | path = Sections; | 942 | path = Sections; |
| @@ -1109,6 +1143,58 @@ | @@ -1109,6 +1143,58 @@ | ||
| 1109 | path = AppDelegate; | 1143 | path = AppDelegate; |
| 1110 | sourceTree = "<group>"; | 1144 | sourceTree = "<group>"; |
| 1111 | }; | 1145 | }; |
| 1146 | + D2575C431E76846900E3A8FC /* InteractionSections */ = { | ||
| 1147 | + isa = PBXGroup; | ||
| 1148 | + children = ( | ||
| 1149 | + D2575C651E76A25400E3A8FC /* LVCInteractionController.h */, | ||
| 1150 | + D2575C661E76A25400E3A8FC /* LVCInteractionController.m */, | ||
| 1151 | + D2575C681E76A42B00E3A8FC /* Gift */, | ||
| 1152 | + D2575C471E7685C500E3A8FC /* heartAnimation */, | ||
| 1153 | + D2575C441E76857100E3A8FC /* LVCAnimationManager.h */, | ||
| 1154 | + D2575C451E76857100E3A8FC /* LVCAnimationManager.m */, | ||
| 1155 | + ); | ||
| 1156 | + path = InteractionSections; | ||
| 1157 | + sourceTree = "<group>"; | ||
| 1158 | + }; | ||
| 1159 | + D2575C471E7685C500E3A8FC /* heartAnimation */ = { | ||
| 1160 | + isa = PBXGroup; | ||
| 1161 | + children = ( | ||
| 1162 | + D2575C491E7685DE00E3A8FC /* UIView+Bubbling.h */, | ||
| 1163 | + D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */, | ||
| 1164 | + ); | ||
| 1165 | + path = heartAnimation; | ||
| 1166 | + sourceTree = "<group>"; | ||
| 1167 | + }; | ||
| 1168 | + D2575C681E76A42B00E3A8FC /* Gift */ = { | ||
| 1169 | + isa = PBXGroup; | ||
| 1170 | + children = ( | ||
| 1171 | + D2575C691E76A45400E3A8FC /* LVCGiftManager.h */, | ||
| 1172 | + D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */, | ||
| 1173 | + D2575C6C1E76A4F300E3A8FC /* GiftResource */, | ||
| 1174 | + ); | ||
| 1175 | + path = Gift; | ||
| 1176 | + sourceTree = "<group>"; | ||
| 1177 | + }; | ||
| 1178 | + D2575C6C1E76A4F300E3A8FC /* GiftResource */ = { | ||
| 1179 | + isa = PBXGroup; | ||
| 1180 | + children = ( | ||
| 1181 | + D2575C6D1E76A4F300E3A8FC /* NHCarView.h */, | ||
| 1182 | + D2575C6E1E76A4F300E3A8FC /* NHCarViews.h */, | ||
| 1183 | + D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */, | ||
| 1184 | + D2575C701E76A4F300E3A8FC /* NHCarViews.xib */, | ||
| 1185 | + D2575C711E76A4F300E3A8FC /* NHFighterView.h */, | ||
| 1186 | + D2575C721E76A4F300E3A8FC /* NHFighterView.nib */, | ||
| 1187 | + D2575C731E76A4F300E3A8FC /* NHGiftAnimtionSDK.a */, | ||
| 1188 | + D2575C741E76A4F300E3A8FC /* NHHeader.h */, | ||
| 1189 | + D2575C751E76A4F300E3A8FC /* NHPlaneView.h */, | ||
| 1190 | + D2575C761E76A4F300E3A8FC /* NHPlaneViews.h */, | ||
| 1191 | + D2575C771E76A4F300E3A8FC /* NHPlaneViews.m */, | ||
| 1192 | + D2575C781E76A4F300E3A8FC /* NHPlaneViews.xib */, | ||
| 1193 | + D2575C791E76A4F300E3A8FC /* resource.bundle */, | ||
| 1194 | + ); | ||
| 1195 | + path = GiftResource; | ||
| 1196 | + sourceTree = "<group>"; | ||
| 1197 | + }; | ||
| 1112 | D2888D911E6EB897003A77C8 /* View */ = { | 1198 | D2888D911E6EB897003A77C8 /* View */ = { |
| 1113 | isa = PBXGroup; | 1199 | isa = PBXGroup; |
| 1114 | children = ( | 1200 | children = ( |
| @@ -1331,10 +1417,14 @@ | @@ -1331,10 +1417,14 @@ | ||
| 1331 | buildActionMask = 2147483647; | 1417 | buildActionMask = 2147483647; |
| 1332 | files = ( | 1418 | files = ( |
| 1333 | D2029C971E6EADE10027CD92 /* Info.plist in Resources */, | 1419 | D2029C971E6EADE10027CD92 /* Info.plist in Resources */, |
| 1420 | + D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */, | ||
| 1421 | + D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */, | ||
| 1334 | D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */, | 1422 | D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */, |
| 1423 | + D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */, | ||
| 1335 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */, | 1424 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */, |
| 1336 | D2029B911E6EAAA50027CD92 /* Assets.xcassets in Resources */, | 1425 | D2029B911E6EAAA50027CD92 /* Assets.xcassets in Resources */, |
| 1337 | D2029CB01E6EADE10027CD92 /* MJRefresh.bundle in Resources */, | 1426 | D2029CB01E6EADE10027CD92 /* MJRefresh.bundle in Resources */, |
| 1427 | + D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */, | ||
| 1338 | 812E50541E7699DC004F5FCD /* KSYGPUResource.bundle in Resources */, | 1428 | 812E50541E7699DC004F5FCD /* KSYGPUResource.bundle in Resources */, |
| 1339 | D2029B8F1E6EAAA50027CD92 /* Main.storyboard in Resources */, | 1429 | D2029B8F1E6EAAA50027CD92 /* Main.storyboard in Resources */, |
| 1340 | ); | 1430 | ); |
| @@ -1383,6 +1473,7 @@ | @@ -1383,6 +1473,7 @@ | ||
| 1383 | D2029C8D1E6EADE10027CD92 /* AFAutoPurgingImageCache.m in Sources */, | 1473 | D2029C8D1E6EADE10027CD92 /* AFAutoPurgingImageCache.m in Sources */, |
| 1384 | D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */, | 1474 | D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */, |
| 1385 | D2029CA41E6EADE10027CD92 /* MJRefreshComponent.m in Sources */, | 1475 | D2029CA41E6EADE10027CD92 /* MJRefreshComponent.m in Sources */, |
| 1476 | + D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */, | ||
| 1386 | D2029CBC1E6EADE10027CD92 /* SDWebImageDownloaderOperation.m in Sources */, | 1477 | D2029CBC1E6EADE10027CD92 /* SDWebImageDownloaderOperation.m in Sources */, |
| 1387 | D2029CA51E6EADE10027CD92 /* MJRefreshFooter.m in Sources */, | 1478 | D2029CA51E6EADE10027CD92 /* MJRefreshFooter.m in Sources */, |
| 1388 | 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */, | 1479 | 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */, |
| @@ -1399,6 +1490,7 @@ | @@ -1399,6 +1490,7 @@ | ||
| 1399 | D2029C9B1E6EADE10027CD92 /* MJPropertyKey.m in Sources */, | 1490 | D2029C9B1E6EADE10027CD92 /* MJPropertyKey.m in Sources */, |
| 1400 | D2029CBF1E6EADE10027CD92 /* UIButton+WebCache.m in Sources */, | 1491 | D2029CBF1E6EADE10027CD92 /* UIButton+WebCache.m in Sources */, |
| 1401 | 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */, | 1492 | 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */, |
| 1493 | + D2575C7E1E76A4F300E3A8FC /* NHPlaneViews.m in Sources */, | ||
| 1402 | D2029CC51E6EADE10027CD92 /* UIView+WebCacheOperation.m in Sources */, | 1494 | D2029CC51E6EADE10027CD92 /* UIView+WebCacheOperation.m in Sources */, |
| 1403 | D2029CAB1E6EADE10027CD92 /* MJRefreshBackNormalFooter.m in Sources */, | 1495 | D2029CAB1E6EADE10027CD92 /* MJRefreshBackNormalFooter.m in Sources */, |
| 1404 | D2029C8F1E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m in Sources */, | 1496 | D2029C8F1E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m in Sources */, |
| @@ -1407,6 +1499,7 @@ | @@ -1407,6 +1499,7 @@ | ||
| 1407 | D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, | 1499 | D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, |
| 1408 | D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, | 1500 | D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, |
| 1409 | D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, | 1501 | D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, |
| 1502 | + D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, | ||
| 1410 | D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, | 1503 | D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, |
| 1411 | D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */, | 1504 | D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */, |
| 1412 | D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */, | 1505 | D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */, |
| @@ -1417,6 +1510,7 @@ | @@ -1417,6 +1510,7 @@ | ||
| 1417 | D2029CB61E6EADE10027CD92 /* MKAnnotationView+WebCache.m in Sources */, | 1510 | D2029CB61E6EADE10027CD92 /* MKAnnotationView+WebCache.m in Sources */, |
| 1418 | 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */, | 1511 | 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */, |
| 1419 | D2029C981E6EADE10027CD92 /* MJExtensionConst.m in Sources */, | 1512 | D2029C981E6EADE10027CD92 /* MJExtensionConst.m in Sources */, |
| 1513 | + D2575C671E76A25400E3A8FC /* LVCInteractionController.m in Sources */, | ||
| 1420 | D2029CAE1E6EADE10027CD92 /* MJRefreshNormalHeader.m in Sources */, | 1514 | D2029CAE1E6EADE10027CD92 /* MJRefreshNormalHeader.m in Sources */, |
| 1421 | D2029C901E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m in Sources */, | 1515 | D2029C901E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m in Sources */, |
| 1422 | D2029CC61E6EADE10027CD92 /* SSKeychain.m in Sources */, | 1516 | D2029CC61E6EADE10027CD92 /* SSKeychain.m in Sources */, |
| @@ -1424,6 +1518,7 @@ | @@ -1424,6 +1518,7 @@ | ||
| 1424 | D2029C921E6EADE10027CD92 /* UIImageView+AFNetworking.m in Sources */, | 1518 | D2029C921E6EADE10027CD92 /* UIImageView+AFNetworking.m in Sources */, |
| 1425 | D2029C9E1E6EADE10027CD92 /* NSObject+MJCoding.m in Sources */, | 1519 | D2029C9E1E6EADE10027CD92 /* NSObject+MJCoding.m in Sources */, |
| 1426 | D2029C991E6EADE10027CD92 /* MJFoundation.m in Sources */, | 1520 | D2029C991E6EADE10027CD92 /* MJFoundation.m in Sources */, |
| 1521 | + D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */, | ||
| 1427 | D2029C8A1E6EADE10027CD92 /* AFURLRequestSerialization.m in Sources */, | 1522 | D2029C8A1E6EADE10027CD92 /* AFURLRequestSerialization.m in Sources */, |
| 1428 | D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, | 1523 | D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, |
| 1429 | D2029C871E6EADE10027CD92 /* AFHTTPSessionManager.m in Sources */, | 1524 | D2029C871E6EADE10027CD92 /* AFHTTPSessionManager.m in Sources */, |
| @@ -1456,6 +1551,7 @@ | @@ -1456,6 +1551,7 @@ | ||
| 1456 | D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */, | 1551 | D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */, |
| 1457 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */, | 1552 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */, |
| 1458 | D2029C951E6EADE10027CD92 /* UIWebView+AFNetworking.m in Sources */, | 1553 | D2029C951E6EADE10027CD92 /* UIWebView+AFNetworking.m in Sources */, |
| 1554 | + D2575C6B1E76A45400E3A8FC /* LVCGiftManager.m in Sources */, | ||
| 1459 | D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */, | 1555 | D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */, |
| 1460 | D2029CB41E6EADE10027CD92 /* UIView+MJExtension.m in Sources */, | 1556 | D2029CB41E6EADE10027CD92 /* UIView+MJExtension.m in Sources */, |
| 1461 | D2029CA91E6EADE10027CD92 /* MJRefreshAutoStateFooter.m in Sources */, | 1557 | D2029CA91E6EADE10027CD92 /* MJRefreshAutoStateFooter.m in Sources */, |
| @@ -1626,6 +1722,10 @@ | @@ -1626,6 +1722,10 @@ | ||
| 1626 | INFOPLIST_FILE = LiveVideoCloud/Info.plist; | 1722 | INFOPLIST_FILE = LiveVideoCloud/Info.plist; |
| 1627 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; | 1723 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; |
| 1628 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | 1724 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
| 1725 | + LIBRARY_SEARCH_PATHS = ( | ||
| 1726 | + "$(inherited)", | ||
| 1727 | + "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", | ||
| 1728 | + ); | ||
| 1629 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; | 1729 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; |
| 1630 | PRODUCT_NAME = "$(TARGET_NAME)"; | 1730 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 1631 | }; | 1731 | }; |
| @@ -1644,6 +1744,10 @@ | @@ -1644,6 +1744,10 @@ | ||
| 1644 | INFOPLIST_FILE = LiveVideoCloud/Info.plist; | 1744 | INFOPLIST_FILE = LiveVideoCloud/Info.plist; |
| 1645 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; | 1745 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; |
| 1646 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | 1746 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
| 1747 | + LIBRARY_SEARCH_PATHS = ( | ||
| 1748 | + "$(inherited)", | ||
| 1749 | + "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", | ||
| 1750 | + ); | ||
| 1647 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; | 1751 | PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; |
| 1648 | PRODUCT_NAME = "$(TARGET_NAME)"; | 1752 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 1649 | }; | 1753 | }; |
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_bluepig.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
26.1 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_bluepig2.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
24.2 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_greenpig.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
26.9 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_greenpig2.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
24.5 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_pinkpig.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
24.3 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_pinkpig2.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
26.1 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_purplepig.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
26.3 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_purplepig2.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
24.4 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_yellowpig.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
26.2 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "filename" : "ic_menu_yellowpig2.png", | ||
| 6 | + "scale" : "1x" | ||
| 7 | + }, | ||
| 8 | + { | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "scale" : "3x" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "info" : { | ||
| 18 | + "version" : 1, | ||
| 19 | + "author" : "xcode" | ||
| 20 | + } | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
24.4 KB
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "love@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "love@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
1.9 KB
2.99 KB
11.6 KB
2.93 KB
2.68 KB
3.01 KB
2.89 KB
| 1 | +// | ||
| 2 | +// NHCarView.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface NHCarView : UIView | ||
| 12 | +/** | ||
| 13 | + * 需要几个控制点就设置几个: | ||
| 14 | + * 数组内的每个元素代码一个控制点和结束点 | ||
| 15 | + * 数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 16 | + */ | ||
| 17 | +@property (nullable, nonatomic, copy) NSArray *curveControlAndEndPoints; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 动画结束后动画层是否从当前视图上移除,默认 NO | ||
| 21 | + */ | ||
| 22 | +@property (nonatomic, assign) BOOL removedOnCompletion; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * 放大倍数:从(from)scale 到(to)scale 默认0.7 - 2.0 | ||
| 26 | + */ | ||
| 27 | + | ||
| 28 | +@property (nullable, strong) id scaleFromValue; | ||
| 29 | +@property (nullable, strong) id scaleToValue; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 动画时间,有默认值 | ||
| 33 | + */ | ||
| 34 | +@property (nonatomic, assign) CGFloat positionDuration; | ||
| 35 | + | ||
| 36 | +/** | ||
| 37 | + * 动画scale时间,有默认值 | ||
| 38 | + */ | ||
| 39 | +@property (nonatomic, assign) CGFloat scaleDuration; | ||
| 40 | + | ||
| 41 | +/** | ||
| 42 | + * move速度,有默认值 | ||
| 43 | + */ | ||
| 44 | +@property (nonatomic, assign) CGFloat positionSpeed; | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * scale速度,有默认值 | ||
| 48 | + */ | ||
| 49 | +@property (nonatomic, assign) CGFloat scaleSpeed; | ||
| 50 | + | ||
| 51 | +/** | ||
| 52 | + * 开始scale时间 | ||
| 53 | + */ | ||
| 54 | +@property (nonatomic, assign) CGFloat beginScaleTime; | ||
| 55 | + | ||
| 56 | +/** | ||
| 57 | + * 加载动画视图 | ||
| 58 | + * | ||
| 59 | + * @param point 动画视图的大小 | ||
| 60 | + * | ||
| 61 | + * @return 返回你需要的动画视图 | ||
| 62 | + */ | ||
| 63 | ++ (nullable instancetype)loadCarViewWithPoint:(CGPoint)point; | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +/** | ||
| 67 | + * 设置动画的运行轨迹 | ||
| 68 | + * 注:调此方法前,如需要设置多于两个控制点的动画,请先设置好curve_control_point_*及curve_end_point_*位置 | ||
| 69 | + 其它属性也是一样,在调此方法前设置好 | ||
| 70 | + * @param movePoints 开始的位置(出发点) | ||
| 71 | + * @param endPoint 最终动画所在停留的位置 | ||
| 72 | + */ | ||
| 73 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint; | ||
| 74 | + | ||
| 75 | + | ||
| 76 | +@end |
| 1 | +// | ||
| 2 | +// NHCarView.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface NHCarViews : UIView | ||
| 12 | +/** | ||
| 13 | + * 需要几个控制点就设置几个: | ||
| 14 | + * 数组内的每个元素代码一个控制点和结束点 | ||
| 15 | + * 数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 16 | + */ | ||
| 17 | +@property (nullable, nonatomic, copy) NSArray *curveControlAndEndPoints; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 动画结束后动画层是否从当前视图上移除,默认 NO | ||
| 21 | + */ | ||
| 22 | +@property (nonatomic, assign) BOOL removedOnCompletion; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * 放大倍数:从(from)scale 到(to)scale 默认0.7 - 2.0 | ||
| 26 | + */ | ||
| 27 | + | ||
| 28 | +@property (nullable, strong) id scaleFromValue; | ||
| 29 | +@property (nullable, strong) id scaleToValue; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 动画时间,有默认值 | ||
| 33 | + */ | ||
| 34 | +@property (nonatomic, assign) CGFloat positionDuration; | ||
| 35 | + | ||
| 36 | +/** | ||
| 37 | + * 动画scale时间,有默认值 | ||
| 38 | + */ | ||
| 39 | +@property (nonatomic, assign) CGFloat scaleDuration; | ||
| 40 | + | ||
| 41 | +/** | ||
| 42 | + * move速度,有默认值 | ||
| 43 | + */ | ||
| 44 | +@property (nonatomic, assign) CGFloat positionSpeed; | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * scale速度,有默认值 | ||
| 48 | + */ | ||
| 49 | +@property (nonatomic, assign) CGFloat scaleSpeed; | ||
| 50 | + | ||
| 51 | +/** | ||
| 52 | + * 开始scale时间 | ||
| 53 | + */ | ||
| 54 | +@property (nonatomic, assign) CGFloat beginScaleTime; | ||
| 55 | + | ||
| 56 | +/** | ||
| 57 | + * 加载动画视图 | ||
| 58 | + * | ||
| 59 | + * @param point 动画视图的大小 | ||
| 60 | + * | ||
| 61 | + * @return 返回你需要的动画视图 | ||
| 62 | + */ | ||
| 63 | ++ (nullable instancetype)loadCarViewWithPoint:(CGPoint)point; | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +/** | ||
| 67 | + * 设置动画的运行轨迹 | ||
| 68 | + * 注:调此方法前,如需要设置多于两个控制点的动画,请先设置好curve_control_point_*及curve_end_point_*位置 | ||
| 69 | + 其它属性也是一样,在调此方法前设置好 | ||
| 70 | + * @param movePoints 开始的位置(出发点) | ||
| 71 | + * @param endPoint 最终动画所在停留的位置 | ||
| 72 | + */ | ||
| 73 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint; | ||
| 74 | + | ||
| 75 | + | ||
| 76 | +@end |
| 1 | +// | ||
| 2 | +// NHCarView.m | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "NHCarViews.h" | ||
| 10 | +#import "NHHeader.h" | ||
| 11 | + | ||
| 12 | +@interface NHCarViews ()<CAAnimationDelegate> | ||
| 13 | + | ||
| 14 | +@property (weak, nonatomic) IBOutlet UIImageView *afterWheel; | ||
| 15 | +@property (weak, nonatomic) IBOutlet UIImageView *beforeWheel; | ||
| 16 | +@property (weak, nonatomic) IBOutlet UIImageView *carBackImage; | ||
| 17 | +@property (weak, nonatomic) IBOutlet UIImageView *light; | ||
| 18 | +@property (nonatomic, copy) NSMutableArray *animations; | ||
| 19 | + | ||
| 20 | +@end | ||
| 21 | + | ||
| 22 | +@implementation NHCarViews | ||
| 23 | + | ||
| 24 | +- (NSMutableArray *)animations{ | ||
| 25 | + | ||
| 26 | + if (_animations == nil) { | ||
| 27 | + _animations = [[NSMutableArray alloc] init]; | ||
| 28 | + } | ||
| 29 | + return _animations; | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | ++ (instancetype)loadCarViewWithPoint:(CGPoint)point{ | ||
| 33 | + NHCarViews *car = [[NSBundle mainBundle]loadNibNamed:@"NHCarViews" owner:self options:nil].lastObject; | ||
| 34 | + car.frame = CGRectMake(point.x, point.y, 166, 70); | ||
| 35 | + [car setPoints]; | ||
| 36 | + | ||
| 37 | + [car setPlaneScrewImages:nil]; | ||
| 38 | + return car; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | + | ||
| 42 | +- (instancetype)loadCarViewWithNib:(CGPoint)point{ | ||
| 43 | + NHCarViews *car = [[NSBundle mainBundle]loadNibNamed:@"NHCarViews" owner:self options:nil].lastObject; | ||
| 44 | + car.frame = CGRectMake(point.x, point.y, 166, 70); | ||
| 45 | + [car setPoints]; | ||
| 46 | + [car setPlaneScrewImages:nil]; | ||
| 47 | + return car; | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | + | ||
| 51 | +//- (instancetype)initWithFrame:(CGRect)frame{ | ||
| 52 | +// | ||
| 53 | +// if (self = [super initWithFrame:frame]) { | ||
| 54 | +// [self addSubview:[self loadCarViewWithNib:frame.origin]]; | ||
| 55 | +// } | ||
| 56 | +// return self; | ||
| 57 | +//} | ||
| 58 | + | ||
| 59 | + | ||
| 60 | +//- (void)layoutSubviews{ | ||
| 61 | +// [super layoutSubviews]; | ||
| 62 | +// self.carBackImage.frame = self.bounds; | ||
| 63 | +// CGSize newSize = self.carBackImage.frame.size; | ||
| 64 | +// _afterWheel.frame = CGRectMake(2, newSize.height *0.276, newSize.width * 0.0662, newSize.height * 0.314); | ||
| 65 | +// _beforeWheel.frame = CGRectMake(newSize.width * 0.4337, newSize.height *0.514, newSize.width * 0.132, newSize.height * 0.43); | ||
| 66 | +// _light.frame = CGRectMake(newSize.width * 0.584, newSize.height *0.072, newSize.width * 0.283, newSize.height * 0.714); | ||
| 67 | +//} | ||
| 68 | + | ||
| 69 | + | ||
| 70 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint{ | ||
| 71 | + | ||
| 72 | + CAKeyframeAnimation *position = [CAKeyframeAnimation animationWithKeyPath:@"position"]; | ||
| 73 | + CGMutablePathRef path = CGPathCreateMutable(); | ||
| 74 | + CGPathMoveToPoint(path, NULL, movePoints.x, movePoints.y); | ||
| 75 | + | ||
| 76 | + [self.curveControlAndEndPoints enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 77 | + CGRect rect = CGRectFromString(obj); | ||
| 78 | + CGPathAddQuadCurveToPoint(path, NULL, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); | ||
| 79 | + }]; | ||
| 80 | + | ||
| 81 | + CGPathAddQuadCurveToPoint(path, NULL, endPoint.x, endPoint.y, endPoint.x, endPoint.y); | ||
| 82 | + position.path = path; | ||
| 83 | + position.duration = _positionDuration; | ||
| 84 | + position.speed = _positionSpeed; | ||
| 85 | + position.removedOnCompletion = _removedOnCompletion; | ||
| 86 | + position.fillMode = kCAFillModeForwards; | ||
| 87 | + | ||
| 88 | + CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | ||
| 89 | + scaleAnimation.duration = _scaleDuration; | ||
| 90 | + scaleAnimation.beginTime = _beginScaleTime; | ||
| 91 | + scaleAnimation.fromValue = _scaleFromValue; | ||
| 92 | + scaleAnimation.toValue = _scaleToValue; | ||
| 93 | + scaleAnimation.removedOnCompletion = _removedOnCompletion; | ||
| 94 | + scaleAnimation.fillMode = kCAFillModeForwards; | ||
| 95 | + | ||
| 96 | + CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; | ||
| 97 | + animationGroup.duration = 7.f; | ||
| 98 | + animationGroup.removedOnCompletion = _removedOnCompletion; | ||
| 99 | + animationGroup.fillMode = kCAFillModeForwards; | ||
| 100 | + animationGroup.delegate = self; | ||
| 101 | + animationGroup.animations = @[position,scaleAnimation]; | ||
| 102 | + | ||
| 103 | + if (self.animations.count == 0) { | ||
| 104 | + NSLog(@"第一次动画%ld",self.animations.count); | ||
| 105 | + [self.animations addObject:animationGroup]; | ||
| 106 | + [self.layer addAnimation:animationGroup forKey:@"carView"]; | ||
| 107 | + }else{ | ||
| 108 | + [self.animations addObject:animationGroup]; | ||
| 109 | + NSLog(@"添加动画"); | ||
| 110 | + } | ||
| 111 | +} | ||
| 112 | + | ||
| 113 | + | ||
| 114 | +- (void)setPlaneScrewImages:(NSArray *)imageArray{ | ||
| 115 | + | ||
| 116 | + NSMutableArray* after = [NSMutableArray array]; | ||
| 117 | + for(int i = 1;i<4;i++){ | ||
| 118 | + [after addObject: [UIImage imageNamed:[NSString stringWithFormat:SUB_RESOURCE,@"porche-f",i]]]; | ||
| 119 | + } | ||
| 120 | + _afterWheel.animationImages = after; | ||
| 121 | + _afterWheel.animationDuration = 0.05; | ||
| 122 | + _afterWheel.animationRepeatCount = 0; | ||
| 123 | + [_afterWheel startAnimating]; | ||
| 124 | + | ||
| 125 | + NSMutableArray* before = [NSMutableArray array]; | ||
| 126 | + for(int i = 1;i<4;i++){ | ||
| 127 | + [before addObject: [UIImage imageNamed:[NSString stringWithFormat:SUB_RESOURCE,@"porche-b",i]]]; | ||
| 128 | + } | ||
| 129 | + _beforeWheel.animationImages = before; | ||
| 130 | + _beforeWheel.animationDuration = 0.05; | ||
| 131 | + _beforeWheel.animationRepeatCount = 0; | ||
| 132 | + [_beforeWheel startAnimating]; | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | + | ||
| 136 | +-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ | ||
| 137 | + | ||
| 138 | + [self.layer removeAllAnimations]; | ||
| 139 | + [self removeFromSuperview]; | ||
| 140 | + | ||
| 141 | + NSLog(@"删除动画"); | ||
| 142 | +// [self.animations removeObjectAtIndex:0]; | ||
| 143 | + | ||
| 144 | + if (self.animations.count > 0) { | ||
| 145 | +// [self.layer addAnimation:self.animations[0] forKey:@"carView"]; | ||
| 146 | + }else{ | ||
| 147 | + | ||
| 148 | + | ||
| 149 | + } | ||
| 150 | +} | ||
| 151 | + | ||
| 152 | + | ||
| 153 | +- (void)setPoints{ | ||
| 154 | + _scaleDuration = 1.2; | ||
| 155 | + _positionDuration = 4.0; | ||
| 156 | + _positionSpeed = 0.7; | ||
| 157 | + _beginScaleTime = 0.f; | ||
| 158 | + _scaleToValue = [NSNumber numberWithFloat:2.0]; | ||
| 159 | + _scaleFromValue = [NSNumber numberWithFloat:0.7]; | ||
| 160 | + | ||
| 161 | + NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | ||
| 162 | + CGFloat width = [UIScreen mainScreen].bounds.size.width / 2; | ||
| 163 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 164 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 165 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 166 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 167 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 168 | + self.curveControlAndEndPoints = pointArrs; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +- (void)setBeginScaleTime:(CGFloat)beginScaleTime{ | ||
| 172 | + _beginScaleTime = beginScaleTime; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +- (void)setPositionSpeed:(CGFloat)positionSpeed{ | ||
| 176 | + _positionSpeed = positionSpeed; | ||
| 177 | +} | ||
| 178 | + | ||
| 179 | +- (void)setPositionDuration:(CGFloat)positionDuration{ | ||
| 180 | + _positionDuration = positionDuration; | ||
| 181 | +} | ||
| 182 | + | ||
| 183 | +- (void)setScaleSpeed:(CGFloat)scaleSpeed{ | ||
| 184 | + _scaleSpeed = scaleSpeed; | ||
| 185 | +} | ||
| 186 | + | ||
| 187 | +- (void)setScaleDuration:(CGFloat)scaleDuration{ | ||
| 188 | + _scaleDuration = scaleDuration; | ||
| 189 | +} | ||
| 190 | + | ||
| 191 | + | ||
| 192 | + | ||
| 193 | +@end |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | ||
| 3 | + <device id="retina4_7" orientation="portrait"> | ||
| 4 | + <adaptation id="fullscreen"/> | ||
| 5 | + </device> | ||
| 6 | + <dependencies> | ||
| 7 | + <deployment identifier="iOS"/> | ||
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> | ||
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| 10 | + </dependencies> | ||
| 11 | + <objects> | ||
| 12 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
| 13 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
| 14 | + <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="NHCarViews"> | ||
| 15 | + <rect key="frame" x="0.0" y="0.0" width="166" height="70"/> | ||
| 16 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 17 | + <subviews> | ||
| 18 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/porche.png" translatesAutoresizingMaskIntoConstraints="NO" id="fn9-Qh-bvD"> | ||
| 19 | + <rect key="frame" x="0.0" y="0.0" width="166" height="70"/> | ||
| 20 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 21 | + </imageView> | ||
| 22 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/porche-light.png" translatesAutoresizingMaskIntoConstraints="NO" id="e4P-7s-Kwb"> | ||
| 23 | + <rect key="frame" x="97" y="12" width="47" height="50"/> | ||
| 24 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 25 | + </imageView> | ||
| 26 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/porche-f1.png" translatesAutoresizingMaskIntoConstraints="NO" id="DFb-YJ-Flu"> | ||
| 27 | + <rect key="frame" x="72" y="36" width="22" height="31"/> | ||
| 28 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 29 | + </imageView> | ||
| 30 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/porche-b1.png" translatesAutoresizingMaskIntoConstraints="NO" id="Tjk-fg-HJF"> | ||
| 31 | + <rect key="frame" x="2" y="19" width="11" height="22"/> | ||
| 32 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 33 | + </imageView> | ||
| 34 | + </subviews> | ||
| 35 | + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 36 | + <nil key="simulatedStatusBarMetrics"/> | ||
| 37 | + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
| 38 | + <connections> | ||
| 39 | + <outlet property="afterWheel" destination="Tjk-fg-HJF" id="GYr-u0-6jQ"/> | ||
| 40 | + <outlet property="beforeWheel" destination="DFb-YJ-Flu" id="qD2-GX-yj5"/> | ||
| 41 | + <outlet property="carBackImage" destination="fn9-Qh-bvD" id="mUl-u6-QF1"/> | ||
| 42 | + <outlet property="light" destination="e4P-7s-Kwb" id="btQ-hn-wn4"/> | ||
| 43 | + </connections> | ||
| 44 | + <point key="canvasLocation" x="122" y="244"/> | ||
| 45 | + </view> | ||
| 46 | + </objects> | ||
| 47 | + <resources> | ||
| 48 | + <image name="resource.bundle/porche-b1.png" width="500" height="211"/> | ||
| 49 | + <image name="resource.bundle/porche-f1.png" width="500" height="211"/> | ||
| 50 | + <image name="resource.bundle/porche-light.png" width="500" height="211"/> | ||
| 51 | + <image name="resource.bundle/porche.png" width="500" height="211"/> | ||
| 52 | + </resources> | ||
| 53 | +</document> |
| 1 | +// | ||
| 2 | +// NHFighterView.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface NHFighterView : UIView | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 需要几个控制点就设置几个: | ||
| 15 | + * 数组内的每个元素代码一个控制点和结束点 | ||
| 16 | + * 数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 17 | + */ | ||
| 18 | +@property (nullable, nonatomic, copy) NSArray *curveControlAndEndPoints; | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 动画结束后动画层是否从当前视图上移除,默认 NO | ||
| 23 | + */ | ||
| 24 | +@property (nonatomic, assign) BOOL removedOnCompletion; | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * 从(from)scale 到(to)scale 默认0.7 - 2.0 | ||
| 28 | + */ | ||
| 29 | +@property (nullable, strong) id scaleFromValue; | ||
| 30 | +@property (nullable, strong) id scaleToValue; | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +/** | ||
| 34 | + * 以下粒子效果的参数,都有默认值 | ||
| 35 | + */ | ||
| 36 | +//粒子发射源的尺寸大 | ||
| 37 | +@property (nonatomic, assign) CGSize grainSize; | ||
| 38 | + | ||
| 39 | +//发射位置 | ||
| 40 | +@property (nonatomic, assign) CGPoint grainPosition; | ||
| 41 | + | ||
| 42 | +//粒子生命周期 | ||
| 43 | +@property (nonatomic, assign)CGFloat grainLifetime; | ||
| 44 | + | ||
| 45 | +//粒子产生速度 | ||
| 46 | +@property (nonatomic, assign) CGFloat grainVelocity; | ||
| 47 | + | ||
| 48 | +//粒子产生速度范围 | ||
| 49 | +@property (nonatomic, assign) CGFloat grainVelocityRange; | ||
| 50 | + | ||
| 51 | +//粒子速度 | ||
| 52 | +@property (nonatomic, assign) CGFloat grainSpeed; | ||
| 53 | + | ||
| 54 | +//粒子速度乘数因子 | ||
| 55 | +@property (nonatomic, assign) float grainBirthRate; | ||
| 56 | + | ||
| 57 | +//粒子图片 | ||
| 58 | +@property (nullable ,nonatomic, strong) UIImage *grainImage; | ||
| 59 | + | ||
| 60 | +/** | ||
| 61 | + * 加载动画视图 | ||
| 62 | + * | ||
| 63 | + * @param point 动画视图的大小 | ||
| 64 | + * | ||
| 65 | + * @return 返回你需要的动画视图 | ||
| 66 | + */ | ||
| 67 | ++ (nullable instancetype)loadFighterViewWithPoint:(CGPoint)point; | ||
| 68 | + | ||
| 69 | + | ||
| 70 | +/** | ||
| 71 | + * 设置动画的运行轨迹 | ||
| 72 | + * 注:调此方法前,如需要设置多于两个控制点的动画,请先设置好curve_control_point_*及curve_end_point_*位置 | ||
| 73 | + 其它属性也是一样,在调此方法前设置好 | ||
| 74 | + * @param movePoints 开始的位置(出发点) | ||
| 75 | + * @param endPoint 最终动画所在停留的位置 | ||
| 76 | + */ | ||
| 77 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint; | ||
| 78 | + | ||
| 79 | + | ||
| 80 | +@end |
| 1 | +// | ||
| 2 | +// NHHeader.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef NHHeader_h | ||
| 10 | +#define NHHeader_h | ||
| 11 | + | ||
| 12 | +#define RESOURCE @"resource.bundle/%@" | ||
| 13 | + | ||
| 14 | +#define SUB_RESOURCE @"resource.bundle/%@%d" | ||
| 15 | + | ||
| 16 | +#define NHBounds [UIScreen mainScreen].bounds.size | ||
| 17 | + | ||
| 18 | +#import "NHCarView.h" | ||
| 19 | +#import "NHFighterView.h" | ||
| 20 | +#import "NHPlaneView.h" | ||
| 21 | + | ||
| 22 | +#endif /* NHHeader_h */ |
| 1 | +// | ||
| 2 | +// NHPlaneView.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface NHPlaneView : UIView | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 需要几个控制点就设置几个: | ||
| 16 | + * 数组内的每个元素代码一个控制点和结束点 | ||
| 17 | + * 数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 18 | + */ | ||
| 19 | +@property (nullable, nonatomic, copy) NSArray *curveControlAndEndPoints; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 动画结束后动画层是否从当前视图上移除,默认 NO | ||
| 23 | + */ | ||
| 24 | +@property (nonatomic, assign) BOOL removedOnCompletion; | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * 从(from)scale 到(to)scale 默认0.7 - 2.0 | ||
| 28 | + */ | ||
| 29 | + | ||
| 30 | +@property (nullable, strong) id scaleFromValue; | ||
| 31 | +@property (nullable, strong) id scaleToValue; | ||
| 32 | + | ||
| 33 | + | ||
| 34 | +/** | ||
| 35 | + * 加载动画视图 | ||
| 36 | + * | ||
| 37 | + * @param point 动画视图的大小 | ||
| 38 | + * | ||
| 39 | + * @return 返回你需要的动画视图 | ||
| 40 | + */ | ||
| 41 | ++ (nullable instancetype)loadPlaneViewWithPoint:(CGPoint)point; | ||
| 42 | + | ||
| 43 | + | ||
| 44 | +/** | ||
| 45 | + * 设置动画的运行轨迹 | ||
| 46 | + * 注:调此方法前,如需要设置多于两个控制点的动画,请先设置好curve_control_point_*及curve_end_point_*位置 | ||
| 47 | + 其它属性也是一样,在调此方法前设置好 | ||
| 48 | + * @param movePoints 开始的位置(出发点) | ||
| 49 | + * @param endPoint 最终动画所在停留的位置 | ||
| 50 | + */ | ||
| 51 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint; | ||
| 52 | + | ||
| 53 | +@end |
| 1 | +// | ||
| 2 | +// NHPlaneView.h | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface NHPlaneViews : UIView | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 需要几个控制点就设置几个: | ||
| 16 | + * 数组内的每个元素代码一个控制点和结束点 | ||
| 17 | + * 数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 18 | + */ | ||
| 19 | +@property (nullable, nonatomic, copy) NSArray *curveControlAndEndPoints; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 动画结束后动画层是否从当前视图上移除,默认 NO | ||
| 23 | + */ | ||
| 24 | +@property (nonatomic, assign) BOOL removedOnCompletion; | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * 从(from)scale 到(to)scale 默认0.7 - 2.0 | ||
| 28 | + */ | ||
| 29 | + | ||
| 30 | +@property (nullable, strong) id scaleFromValue; | ||
| 31 | +@property (nullable, strong) id scaleToValue; | ||
| 32 | + | ||
| 33 | + | ||
| 34 | +/** | ||
| 35 | + * 加载动画视图 | ||
| 36 | + * | ||
| 37 | + * @param point 动画视图的大小 | ||
| 38 | + * | ||
| 39 | + * @return 返回你需要的动画视图 | ||
| 40 | + */ | ||
| 41 | ++ (nullable instancetype)loadPlaneViewWithPoint:(CGPoint)point; | ||
| 42 | + | ||
| 43 | + | ||
| 44 | +/** | ||
| 45 | + * 设置动画的运行轨迹 | ||
| 46 | + * 注:调此方法前,如需要设置多于两个控制点的动画,请先设置好curve_control_point_*及curve_end_point_*位置 | ||
| 47 | + 其它属性也是一样,在调此方法前设置好 | ||
| 48 | + * @param movePoints 开始的位置(出发点) | ||
| 49 | + * @param endPoint 最终动画所在停留的位置 | ||
| 50 | + */ | ||
| 51 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint; | ||
| 52 | + | ||
| 53 | +@end |
| 1 | +// | ||
| 2 | +// NHPlaneView.m | ||
| 3 | +// NHGiftAnimation | ||
| 4 | +// | ||
| 5 | +// Created by simope on 16/7/8. | ||
| 6 | +// Copyright © 2016年 NegHao.W. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "NHPlaneViews.h" | ||
| 10 | +#import "NHHeader.h" | ||
| 11 | + | ||
| 12 | +@interface NHPlaneViews () <CAAnimationDelegate> | ||
| 13 | +@property (nonatomic, strong) UIImageView *planeWing; | ||
| 14 | +@property (weak, nonatomic) IBOutlet UIImageView *planeScrew; | ||
| 15 | + | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +@implementation NHPlaneViews | ||
| 19 | + | ||
| 20 | ++ (instancetype)loadPlaneViewWithPoint:(CGPoint)point{ | ||
| 21 | + NHPlaneViews *plane = [[NSBundle mainBundle]loadNibNamed:@"NHPlaneViews" owner:self options:nil].lastObject; | ||
| 22 | + plane.frame = CGRectMake(point.x, point.y, 232, 92); | ||
| 23 | + [plane setPoints]; | ||
| 24 | + [plane setPlaneScrewImages:nil]; | ||
| 25 | + return plane; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | + | ||
| 29 | +- (void)addAnimationsMoveToPoint:(CGPoint)movePoints endPoint:(CGPoint)endPoint{ | ||
| 30 | + | ||
| 31 | + CAKeyframeAnimation *position = [CAKeyframeAnimation animationWithKeyPath:@"position"]; | ||
| 32 | + CGMutablePathRef path = CGPathCreateMutable(); | ||
| 33 | + CGPathMoveToPoint(path, NULL, movePoints.x, movePoints.y); | ||
| 34 | + | ||
| 35 | + [self.curveControlAndEndPoints enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 36 | + CGRect rect = CGRectFromString(obj); | ||
| 37 | + CGPathAddQuadCurveToPoint(path, NULL, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); | ||
| 38 | + }]; | ||
| 39 | + | ||
| 40 | + CGPathAddQuadCurveToPoint(path, NULL, endPoint.x, endPoint.y, endPoint.x, endPoint.y); | ||
| 41 | + position.path = path; | ||
| 42 | + position.duration = 4.f; | ||
| 43 | + position.speed = 0.6; | ||
| 44 | + position.removedOnCompletion = NO; | ||
| 45 | + position.fillMode = kCAFillModeForwards; | ||
| 46 | + position.calculationMode = kCAAnimationCubicPaced; | ||
| 47 | + | ||
| 48 | + CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | ||
| 49 | + scaleAnimation.fromValue = [NSNumber numberWithFloat:0.5]; | ||
| 50 | + scaleAnimation.toValue = [NSNumber numberWithFloat:1.5]; | ||
| 51 | + scaleAnimation.duration = 1.0; | ||
| 52 | + scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; | ||
| 53 | + scaleAnimation.removedOnCompletion = NO; | ||
| 54 | + scaleAnimation.fillMode = kCAFillModeForwards; | ||
| 55 | + | ||
| 56 | + CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; | ||
| 57 | + animationGroup.duration = 7.f; | ||
| 58 | + animationGroup.delegate = self; | ||
| 59 | + animationGroup.autoreverses = NO; | ||
| 60 | + animationGroup.repeatCount = 0; | ||
| 61 | + animationGroup.removedOnCompletion = NO; | ||
| 62 | + animationGroup.fillMode = kCAFillModeForwards; | ||
| 63 | + animationGroup.animations = @[scaleAnimation,position]; | ||
| 64 | + [self.layer addAnimation:animationGroup forKey:@"planeViews"]; | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | + | ||
| 68 | +- (void)setPlaneScrewImages:(NSArray *)imageArray{ | ||
| 69 | + NSMutableArray* images = [NSMutableArray array]; | ||
| 70 | + for(int i = 1;i<4;i++){ | ||
| 71 | + [images addObject: [UIImage imageNamed:[NSString stringWithFormat:SUB_RESOURCE,@"plane-screw-4-",i]]]; | ||
| 72 | + } | ||
| 73 | + _planeScrew.animationImages = images; | ||
| 74 | + _planeScrew.animationDuration = 0.05; | ||
| 75 | + _planeScrew.animationRepeatCount = 0; | ||
| 76 | + [_planeScrew startAnimating]; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | + | ||
| 80 | +-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ | ||
| 81 | + [self.layer removeAllAnimations]; | ||
| 82 | + [self removeFromSuperview]; | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | + | ||
| 86 | +- (void)addAnimations{ | ||
| 87 | + | ||
| 88 | + UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:RESOURCE,@"plane-flower-2"]]]; | ||
| 89 | + NSInteger range = _planeScrew.bounds.size.width + 80; | ||
| 90 | + NSInteger startX = round(random() %range); | ||
| 91 | + NSInteger endX = round(random() % range); | ||
| 92 | + | ||
| 93 | + double scele = 1 / round(random() % 100) + 1.0; | ||
| 94 | +// double speed = 1 / round(random() % 100) + 1.0; | ||
| 95 | + //_plane.bounds.size.width / 2 +70, CGRectGetMaxY(_plane.frame)+50 | ||
| 96 | + imageView.frame = CGRectMake( startX, CGRectGetMaxY(_planeScrew.frame)-30, scele * 60, scele * 60); | ||
| 97 | + [self addSubview:imageView]; | ||
| 98 | + | ||
| 99 | + | ||
| 100 | + [UIView beginAnimations:@"flake" context:(__bridge void*)(imageView)]; | ||
| 101 | + | ||
| 102 | + [UIView setAnimationDuration:3]; | ||
| 103 | + [UIView setAnimationRepeatCount:8]; | ||
| 104 | + imageView.frame = CGRectMake(endX, NHBounds.height - 20, scele * 70, scele * 70); | ||
| 105 | + | ||
| 106 | + [UIView commitAnimations]; | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +- (void)setPoints{ | ||
| 110 | + _scaleToValue = [NSNumber numberWithFloat:2.0]; | ||
| 111 | + _scaleFromValue = [NSNumber numberWithFloat:0.7]; | ||
| 112 | + | ||
| 113 | + NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | ||
| 114 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | ||
| 115 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | ||
| 116 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | ||
| 117 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | ||
| 118 | + self.curveControlAndEndPoints = pointArrs; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | + | ||
| 122 | +@end |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | ||
| 3 | + <device id="retina4_7" orientation="portrait"> | ||
| 4 | + <adaptation id="fullscreen"/> | ||
| 5 | + </device> | ||
| 6 | + <dependencies> | ||
| 7 | + <deployment identifier="iOS"/> | ||
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> | ||
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| 10 | + </dependencies> | ||
| 11 | + <objects> | ||
| 12 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
| 13 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
| 14 | + <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="NHPlaneViews"> | ||
| 15 | + <rect key="frame" x="0.0" y="0.0" width="232" height="92"/> | ||
| 16 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 17 | + <subviews> | ||
| 18 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/plane-tail.png" translatesAutoresizingMaskIntoConstraints="NO" id="0rq-6x-Ili"> | ||
| 19 | + <rect key="frame" x="58" y="0.0" width="174" height="84"/> | ||
| 20 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 21 | + </imageView> | ||
| 22 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/plane-head.png" translatesAutoresizingMaskIntoConstraints="NO" id="gbO-HI-cx6"> | ||
| 23 | + <rect key="frame" x="14" y="36" width="70" height="31"/> | ||
| 24 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 25 | + </imageView> | ||
| 26 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="resource.bundle/plane-screw-1-1.png" translatesAutoresizingMaskIntoConstraints="NO" id="gH3-uq-rx4"> | ||
| 27 | + <rect key="frame" x="6" y="17" width="39" height="75"/> | ||
| 28 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
| 29 | + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 30 | + </imageView> | ||
| 31 | + </subviews> | ||
| 32 | + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 33 | + <nil key="simulatedStatusBarMetrics"/> | ||
| 34 | + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
| 35 | + <connections> | ||
| 36 | + <outlet property="planeScrew" destination="gH3-uq-rx4" id="yUv-gJ-0qg"/> | ||
| 37 | + </connections> | ||
| 38 | + </view> | ||
| 39 | + </objects> | ||
| 40 | + <resources> | ||
| 41 | + <image name="resource.bundle/plane-head.png" width="500" height="211"/> | ||
| 42 | + <image name="resource.bundle/plane-screw-1-1.png" width="500" height="211"/> | ||
| 43 | + <image name="resource.bundle/plane-tail.png" width="500" height="211"/> | ||
| 44 | + </resources> | ||
| 45 | +</document> |
30.6 KB
35.3 KB
104 KB
195 KB
294 KB
345 KB
322 KB
192 KB
25.6 KB
30.3 KB
35.6 KB
30.9 KB
35.6 KB
30.6 KB
36.2 KB
30.1 KB
35.4 KB
3.84 KB
5.15 KB
9.12 KB
2.29 KB
3.11 KB
6.32 KB
120 KB
140 KB
10.9 KB
1.75 KB
72.7 KB
12.8 KB
3.91 KB
8.34 KB
1.1 KB
2.03 KB
94.5 KB
6.33 KB
9.61 KB
2.27 KB
2.65 KB
190 Bytes
2.54 KB
3.99 KB
57.4 KB
125 KB
7.68 KB
234 KB
1.5 KB
1.88 KB
1.44 KB
1.52 KB
1.53 KB
2.06 KB
2.17 KB
1.92 KB
1.94 KB
2.04 KB
2.54 KB
2.02 KB
2.11 KB
2.02 KB
2.04 KB
2 KB
1.64 KB
1.96 KB
26.3 KB
855 Bytes
1.75 KB
6.07 KB
6.21 KB
6.07 KB
5.98 KB
11.1 KB
11 KB
11.3 KB
11.3 KB
64.5 KB
196 KB
1.85 KB
7.4 KB
22.5 KB
32 KB
44.8 KB
46.2 KB
36.1 KB
31.9 KB
44.1 KB
36.4 KB
35.9 KB
34.1 KB
30.4 KB
25.5 KB
82.6 KB
113 KB
129 KB
150 KB
171 KB
234 KB
249 KB
294 KB
297 KB
303 KB
254 KB
255 KB
259 KB
280 KB
306 KB
327 KB
328 KB
330 KB
314 KB
300 KB
297 KB
271 KB
219 KB
113 KB
91.6 KB
140 KB
140 KB
7.04 KB
2.14 KB
14 KB
12.3 KB
14 KB
11.3 KB
13.7 KB
13.7 KB
40.2 KB
26.5 KB
14.7 KB
15 KB
14.9 KB
13 KB
13.2 KB
13.2 KB
10.6 KB
10.8 KB
10.7 KB
248 KB
6.44 KB
6.39 KB
6.33 KB
6.5 KB
13.5 KB
13.1 KB
13.3 KB
13.7 KB
64.5 KB
149 KB
648 KB
5.83 KB
1.47 KB
11.8 KB
11.8 KB
11.6 KB
11.5 KB
11.3 KB
11.2 KB
20.9 KB
11.2 KB
7.76 KB
5.68 KB
3.84 KB
20.1 KB
21.9 KB
19.3 KB
18.1 KB
22.1 KB
18.7 KB
17 KB
15.5 KB
81.1 KB
1.12 KB
3.08 KB
1.22 KB
3.31 KB
1.5 KB
1.8 KB
1.82 KB
34.5 KB
183 KB
| 1 | +// | ||
| 2 | +// LVCGiftManager.h | ||
| 3 | +// LiveVideoCloud | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/13. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +typedef NS_ENUM(NSInteger, GiftType) {//礼物类型 | ||
| 12 | + GiftTypePorsch = 1,//跑车 | ||
| 13 | + GiftTypeFighter ,//歼灭机 | ||
| 14 | + GiftTypePlane ,//客机 | ||
| 15 | +}; | ||
| 16 | + | ||
| 17 | +@interface LVCGiftManager : NSObject | ||
| 18 | + | ||
| 19 | ++ (void)giftType:(GiftType)giftType toView:(UIView *_Nonnull)toView; | ||
| 20 | + | ||
| 21 | +@end | ||
| 22 | + |
| 1 | +// | ||
| 2 | +// LVCGiftManager.m | ||
| 3 | +// LiveVideoCloud | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/13. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "LVCGiftManager.h" | ||
| 10 | +#import "NHCarViews.h" | ||
| 11 | +#import "NHFighterView.h" | ||
| 12 | +#import "NHPlaneViews.h" | ||
| 13 | + | ||
| 14 | +@implementation LVCGiftManager | ||
| 15 | + | ||
| 16 | ++ (void)giftType:(GiftType)giftType toView:(UIView *_Nonnull)toView | ||
| 17 | +{ | ||
| 18 | + | ||
| 19 | + switch (giftType) { | ||
| 20 | + case GiftTypePorsch: | ||
| 21 | + { | ||
| 22 | + NHCarViews *car = [NHCarViews loadCarViewWithPoint:CGPointZero]; | ||
| 23 | + //数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | ||
| 24 | + //方法如下:数组内的每个元素代码一个控制点和结束点 | ||
| 25 | + NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | ||
| 26 | + CGFloat width = [UIScreen mainScreen].bounds.size.width / 2; | ||
| 27 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 28 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 29 | + car.curveControlAndEndPoints = pointArrs; | ||
| 30 | + [car addAnimationsMoveToPoint:CGPointMake(0, 100) endPoint:CGPointMake(toView.bounds.size.width +166, 500)]; | ||
| 31 | + [toView addSubview:car]; | ||
| 32 | + } | ||
| 33 | + break; | ||
| 34 | + case GiftTypeFighter: | ||
| 35 | + { | ||
| 36 | + NHFighterView *fighter = [NHFighterView loadFighterViewWithPoint:CGPointMake(10, 100)]; | ||
| 37 | + [fighter addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 60) endPoint:CGPointMake( -500, 600)]; | ||
| 38 | + [toView addSubview:fighter]; | ||
| 39 | + } | ||
| 40 | + break; | ||
| 41 | + case GiftTypePlane: | ||
| 42 | + { | ||
| 43 | + NHPlaneViews *plane = [NHPlaneViews loadPlaneViewWithPoint:CGPointMake(SCREEN_WIDTH + 232, 0)]; | ||
| 44 | + [plane addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 100) endPoint:CGPointMake(-500, 410)]; | ||
| 45 | + [toView addSubview:plane]; | ||
| 46 | + } | ||
| 47 | + break; | ||
| 48 | + | ||
| 49 | + default: | ||
| 50 | + break; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | +@end |
| 1 | +// | ||
| 2 | +// LVCAnimationManager.h | ||
| 3 | +// LiveVideoCloud | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/13. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | +#import <UIKit/UIKit.h> | ||
| 11 | +@interface LVCAnimationManager : NSObject | ||
| 12 | + | ||
| 13 | ++ (__nonnull instancetype)shareManager; | ||
| 14 | + | ||
| 15 | +//- (void)bubblingWithImage:(NSString *_Nonnull)image centerPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView; | ||
| 16 | +// | ||
| 17 | +//- (void)bubblingWithImages:(NSArray< NSString *> *_Nonnull)images centerPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + 单次出现飘心效果 | ||
| 21 | + | ||
| 22 | + @param centerPoint 心中心点 | ||
| 23 | + @param toView 目标视图 | ||
| 24 | + */ | ||
| 25 | +- (void)bubblingWithCenterPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + 重复出现飘心效果 | ||
| 29 | + | ||
| 30 | + @param centerPoint 心中心点 | ||
| 31 | + @param toView 目标视图 | ||
| 32 | + @param speed 每s执行的次数 | ||
| 33 | + */ | ||
| 34 | +- (void)bubblingWithCenterPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView speed:(CGFloat)speed; | ||
| 35 | +@end |
| 1 | +// | ||
| 2 | +// LVCAnimationManager.m | ||
| 3 | +// LiveVideoCloud | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/13. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "LVCAnimationManager.h" | ||
| 10 | +#import "UIView+Bubbling.h" | ||
| 11 | + | ||
| 12 | +@interface LVCAnimationManager () | ||
| 13 | + | ||
| 14 | +@property (nonatomic ,strong) NSArray * _Nullable images; | ||
| 15 | +@property (nonatomic ,strong) CADisplayLink * _Nullable link; | ||
| 16 | +@property (nonatomic ,strong) UIView * _Nullable toView; | ||
| 17 | +@property (nonatomic ,assign) CGPoint centerPoint; | ||
| 18 | + | ||
| 19 | +@end | ||
| 20 | + | ||
| 21 | +@implementation LVCAnimationManager | ||
| 22 | + | ||
| 23 | +static NSString * loveImageName = @"love"; | ||
| 24 | + | ||
| 25 | +#pragma mark - SINGLETON 单例 | ||
| 26 | +static LVCAnimationManager * __singleton__; | ||
| 27 | + | ||
| 28 | ++ (__nonnull instancetype)shareManager | ||
| 29 | +{ | ||
| 30 | + static dispatch_once_t once_t; | ||
| 31 | + dispatch_once(&once_t, ^{ | ||
| 32 | + __singleton__ = [[[self class] alloc] init]; | ||
| 33 | + __singleton__.images = @[@"ic_menu_bluepig", | ||
| 34 | + @"ic_menu_bluepig2", | ||
| 35 | + @"ic_menu_greenpig", | ||
| 36 | + @"ic_menu_greenpig2", | ||
| 37 | + @"ic_menu_pinkpig", | ||
| 38 | + @"ic_menu_pinkpig2", | ||
| 39 | + @"ic_menu_purplepig", | ||
| 40 | + @"ic_menu_purplepig2", | ||
| 41 | + @"ic_menu_yellowpig", | ||
| 42 | + @"ic_menu_yellowpig2"]; | ||
| 43 | + }); | ||
| 44 | + return __singleton__; | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +/** | ||
| 48 | + 单次出现飘心效果 | ||
| 49 | + | ||
| 50 | + @param centerPoint 心中心点 | ||
| 51 | + @param toView 目标视图 | ||
| 52 | + */ | ||
| 53 | +- (void)bubblingWithCenterPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView | ||
| 54 | +{ | ||
| 55 | + [toView bubblingWithImage:[UIImage imageNamed:loveImageName] center:centerPoint]; | ||
| 56 | + [toView bubblingWithImages:__singleton__.images center:centerPoint]; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +/** | ||
| 60 | + 重复出现飘心效果 | ||
| 61 | + | ||
| 62 | + @param centerPoint 心中心点 | ||
| 63 | + @param toView 目标视图 | ||
| 64 | + @param speed 每s执行的次数 | ||
| 65 | + */ | ||
| 66 | +- (void)bubblingWithCenterPoint:(CGPoint)centerPoint toView:(UIView *_Nonnull)toView speed:(CGFloat)speed | ||
| 67 | +{ | ||
| 68 | + CGFloat defSpeed = 2; | ||
| 69 | + if (speed != 0) { | ||
| 70 | + defSpeed = speed; | ||
| 71 | + } | ||
| 72 | + self.toView = toView; | ||
| 73 | + self.centerPoint = centerPoint; | ||
| 74 | + self.link = [CADisplayLink displayLinkWithTarget:self selector:@selector(repeatAni)]; | ||
| 75 | + [self.link setPreferredFramesPerSecond:defSpeed]; | ||
| 76 | + [self.link addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +- (void)repeatAni | ||
| 80 | +{ | ||
| 81 | + [self.toView bubblingWithImage:[UIImage imageNamed:loveImageName] center:self.centerPoint]; | ||
| 82 | + [self.toView bubblingWithImages:__singleton__.images center:self.centerPoint]; | ||
| 83 | +} | ||
| 84 | +@end |
| 1 | +// | ||
| 2 | +// LVCInteractionController.m | ||
| 3 | +// LiveVideoCloud | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/13. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "LVCInteractionController.h" | ||
| 10 | +#import "LVCGiftManager.h" | ||
| 11 | + | ||
| 12 | +@interface LVCInteractionController () | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation LVCInteractionController | ||
| 17 | + | ||
| 18 | +- (void)viewDidLoad { | ||
| 19 | + [super viewDidLoad]; | ||
| 20 | + // Do any additional setup after loading the view. | ||
| 21 | + | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event | ||
| 25 | +{ | ||
| 26 | + [LVCGiftManager giftType:GiftTypeFighter toView:self.view]; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +- (void)didReceiveMemoryWarning { | ||
| 30 | + [super didReceiveMemoryWarning]; | ||
| 31 | + // Dispose of any resources that can be recreated. | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +/* | ||
| 35 | +#pragma mark - Navigation | ||
| 36 | + | ||
| 37 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 38 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
| 39 | + // Get the new view controller using [segue destinationViewController]. | ||
| 40 | + // Pass the selected object to the new view controller. | ||
| 41 | +} | ||
| 42 | +*/ | ||
| 43 | + | ||
| 44 | +@end |
| 1 | +// | ||
| 2 | +// UIView+Bubbling.h | ||
| 3 | +// ThumbUpDemo | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/10. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface UIView (Bubbling)<CAAnimationDelegate> | ||
| 12 | + | ||
| 13 | +- (void)bubblingWithImage:(UIImage *_Nonnull)image center:(CGPoint)center; | ||
| 14 | + | ||
| 15 | +- (void)bubblingWithImages:(NSArray <NSString *>*_Nonnull)images center:(CGPoint)center; | ||
| 16 | +@end |
| 1 | +// | ||
| 2 | +// UIView+Bubbling.m | ||
| 3 | +// ThumbUpDemo | ||
| 4 | +// | ||
| 5 | +// Created by 张旭 on 2017/3/10. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "UIView+Bubbling.h" | ||
| 10 | + | ||
| 11 | +#define LAYER_ANIMATION_NAME @"layerName" | ||
| 12 | + | ||
| 13 | +// 十六进制颜色值 使用:HEX_COLOR(0xf8f8f8) | ||
| 14 | +#define HEX_COLOR_ALPHA(_HEX_,a) [UIColor colorWithRed:((float)((_HEX_ & 0xFF0000) >> 16))/255.0 green:((float)((_HEX_ & 0xFF00) >> 8))/255.0 blue:((float)(_HEX_ & 0xFF))/255.0 alpha:a] | ||
| 15 | + | ||
| 16 | +#define HEX_COLOR(_HEX_) HEX_COLOR_ALPHA(_HEX_, 1.0) | ||
| 17 | + | ||
| 18 | +#define heartWidth 28.0f | ||
| 19 | +static CGPoint aimCenter; | ||
| 20 | +static CGFloat aimHeight = 0.f; | ||
| 21 | + | ||
| 22 | +@implementation UIView (Bubbling) | ||
| 23 | + | ||
| 24 | +- (void)bubblingWithImage:(UIImage *_Nonnull)image center:(CGPoint)center{ | ||
| 25 | + UIColor *randomColor = [self randomColor]; | ||
| 26 | + [self exportImage:image withColor:randomColor center:center]; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +- (void)bubblingWithImages:(NSArray <NSString *>*_Nonnull)images center:(CGPoint)center{ | ||
| 30 | + if (!images)return; | ||
| 31 | + long index = rand() % images.count; | ||
| 32 | + UIImage *image = [UIImage imageNamed:images[index]]; | ||
| 33 | + [self exportImage:image withColor:nil center:center]; | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +//static CGFloat PI = M_PI; | ||
| 37 | +//-(void)animateInView:(UIView *)view{ | ||
| 38 | +// NSTimeInterval totalAnimationDuration = 6; | ||
| 39 | +// CGFloat heartSize = CGRectGetWidth(self.bounds); | ||
| 40 | +// CGFloat heartCenterX = self.center.x; | ||
| 41 | +// CGFloat viewHeight = CGRectGetHeight(view.bounds); | ||
| 42 | +// | ||
| 43 | +// //Pre-Animation setup | ||
| 44 | +// self.transform = CGAffineTransformMakeScale(0, 0); | ||
| 45 | +// self.alpha = 0; | ||
| 46 | +// | ||
| 47 | +// //Bloom | ||
| 48 | +// [UIView animateWithDuration:1 delay:0.0 usingSpringWithDamping:0.6 initialSpringVelocity:0.8 options:UIViewAnimationOptionCurveEaseOut animations:^{ | ||
| 49 | +// self.transform = CGAffineTransformIdentity; | ||
| 50 | +// self.alpha = 0.9; | ||
| 51 | +// } completion:NULL]; | ||
| 52 | +// //随机值0、1 | ||
| 53 | +// NSInteger i = arc4random_uniform(2); | ||
| 54 | +// NSInteger rotationDirection = 1- (2*i);// -1 OR 1 | ||
| 55 | +// //随机值0~9 | ||
| 56 | +// NSInteger rotationFraction = arc4random_uniform(10); | ||
| 57 | +// | ||
| 58 | +// [UIView animateWithDuration:totalAnimationDuration animations:^{ | ||
| 59 | +// self.transform = CGAffineTransformMakeRotation(rotationDirection * PI/(16 + rotationFraction*0.2)); | ||
| 60 | +// } completion:NULL]; | ||
| 61 | +// | ||
| 62 | +// UIBezierPath *heartTravelPath = [UIBezierPath bezierPath]; | ||
| 63 | +// [heartTravelPath moveToPoint:self.center]; | ||
| 64 | +// | ||
| 65 | +// //random end point | ||
| 66 | +// CGPoint endPoint = CGPointMake(heartCenterX + (rotationDirection) * arc4random_uniform(2*heartSize), viewHeight/6.0 + arc4random_uniform(viewHeight/4.0)); | ||
| 67 | +// | ||
| 68 | +// //random Control Points | ||
| 69 | +// NSInteger j = arc4random_uniform(2); | ||
| 70 | +// NSInteger travelDirection = 1- (2*j);// -1 OR 1 | ||
| 71 | +// | ||
| 72 | +// //randomize x and y for control points | ||
| 73 | +// CGFloat xDelta = (heartSize/2.0 + arc4random_uniform(2*heartSize)) * travelDirection; | ||
| 74 | +// CGFloat yDelta = MAX(endPoint.y ,MAX(arc4random_uniform(8*heartSize), heartSize)); | ||
| 75 | +// CGPoint controlPoint1 = CGPointMake(heartCenterX + xDelta, viewHeight - yDelta); | ||
| 76 | +// CGPoint controlPoint2 = CGPointMake(heartCenterX - 2*xDelta, yDelta); | ||
| 77 | +// | ||
| 78 | +// [heartTravelPath addCurveToPoint:endPoint controlPoint1:controlPoint1 controlPoint2:controlPoint2]; | ||
| 79 | +// | ||
| 80 | +// CAKeyframeAnimation *keyFrameAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; | ||
| 81 | +// keyFrameAnimation.path = heartTravelPath.CGPath; | ||
| 82 | +// keyFrameAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; | ||
| 83 | +// keyFrameAnimation.duration = totalAnimationDuration + endPoint.y/viewHeight; | ||
| 84 | +// [self.layer addAnimation:keyFrameAnimation forKey:@"positionOnPath"]; | ||
| 85 | +// | ||
| 86 | +// //Alpha & remove from superview | ||
| 87 | +// [UIView animateWithDuration:totalAnimationDuration animations:^{ | ||
| 88 | +// self.alpha = 0.0; | ||
| 89 | +// } completion:^(BOOL finished) { | ||
| 90 | +// [self removeFromSuperview]; | ||
| 91 | +// }]; | ||
| 92 | +// | ||
| 93 | +//} | ||
| 94 | + | ||
| 95 | +- (void)startAnimationHeartLayer:(CALayer *)heartLayer | ||
| 96 | +{ | ||
| 97 | + CGFloat duration = 2.f + arc4random_uniform(10) * 0.1; | ||
| 98 | + | ||
| 99 | + //位置动画 | ||
| 100 | + CABasicAnimation *posAnimation = | ||
| 101 | + [CABasicAnimation animationWithKeyPath:@"position"]; | ||
| 102 | + // -30 30 | ||
| 103 | + CGFloat destination_x = heartLayer.position.x + arc4random_uniform(60) - 30 ; | ||
| 104 | + | ||
| 105 | + CGFloat destinaion_y = | ||
| 106 | + heartLayer.position.y / 2; | ||
| 107 | + CGPoint destination = CGPointMake(destination_x, destinaion_y); | ||
| 108 | + [posAnimation setToValue:[NSValue valueWithCGPoint:destination]]; | ||
| 109 | + [posAnimation setTimingFunction: | ||
| 110 | + [CAMediaTimingFunction functionWithControlPoints:0.6f :0.7f :0.6 :0.7]]; | ||
| 111 | + | ||
| 112 | +// NSInteger i = arc4random_uniform(2); | ||
| 113 | +// NSInteger rotationDirection = 1- (2*i);// -1 OR 1 | ||
| 114 | +// | ||
| 115 | +// UIBezierPath *heartTravelPath = [UIBezierPath bezierPath]; | ||
| 116 | +// [heartTravelPath moveToPoint:aimCenter]; | ||
| 117 | +// | ||
| 118 | +// //random end point | ||
| 119 | +// CGPoint endPoint = CGPointMake(aimCenter.x + (rotationDirection) * arc4random_uniform(2*heartWidth), aimCenter.y/2 + arc4random_uniform(aimHeight/4.0)); | ||
| 120 | +// | ||
| 121 | +// //random Control Points | ||
| 122 | +// NSInteger j = arc4random_uniform(2); | ||
| 123 | +// NSInteger travelDirection = 1- (2*j);// -1 OR 1 | ||
| 124 | +// | ||
| 125 | +// //randomize x and y for control points | ||
| 126 | +// CGFloat xDelta = (heartWidth/2.0 + arc4random_uniform(2*heartWidth)) * travelDirection; | ||
| 127 | +// CGFloat yDelta = MAX(endPoint.y ,MAX(arc4random_uniform(8*heartWidth), heartWidth)); | ||
| 128 | +// CGPoint controlPoint1 = CGPointMake(aimCenter.x + xDelta, aimHeight - yDelta); | ||
| 129 | +// CGPoint controlPoint2 = CGPointMake(aimCenter.x - 2*xDelta, yDelta); | ||
| 130 | +// | ||
| 131 | +// [heartTravelPath addCurveToPoint:endPoint controlPoint1:controlPoint1 controlPoint2:controlPoint2]; | ||
| 132 | +// | ||
| 133 | +// CAKeyframeAnimation *keyFrameAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; | ||
| 134 | +// keyFrameAnimation.path = heartTravelPath.CGPath; | ||
| 135 | +// keyFrameAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; | ||
| 136 | +// keyFrameAnimation.duration = duration + endPoint.y/aimHeight; | ||
| 137 | +// [heartLayer addAnimation:keyFrameAnimation forKey:@"positionOnPath"]; | ||
| 138 | + | ||
| 139 | + //透明度动画 | ||
| 140 | + CAKeyframeAnimation *alphaAnimation = | ||
| 141 | + [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; | ||
| 142 | + alphaAnimation.values = @[@1.0,@1.0,@0.0]; | ||
| 143 | + alphaAnimation.keyTimes = @[@0.0,@0.90,@1.0]; | ||
| 144 | + | ||
| 145 | + //旋转动画 | ||
| 146 | + CABasicAnimation *angleAnimation = | ||
| 147 | + [CABasicAnimation animationWithKeyPath:@"transform"]; | ||
| 148 | + [angleAnimation setFromValue: | ||
| 149 | + [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)]]; | ||
| 150 | + CATransform3D destTrans = | ||
| 151 | + CATransform3DMakeRotation(M_PI/4, 0, 0, (arc4random() % 2000) /1000.0f -1); | ||
| 152 | + destTrans = CATransform3DScale(destTrans, 1.5f, 1.5f, 1.5f); | ||
| 153 | + [angleAnimation setToValue:[NSValue valueWithCATransform3D:destTrans]]; | ||
| 154 | + angleAnimation.beginTime = 0.2; | ||
| 155 | + | ||
| 156 | + //缩放 | ||
| 157 | + CABasicAnimation *scaleAnimation = | ||
| 158 | + [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | ||
| 159 | + [scaleAnimation setFromValue:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1f, 0.1f, 1.0f)]]; | ||
| 160 | + CATransform3D scaleTrans = CATransform3DMakeScale(1.0f, 1.0f, 1.0f); | ||
| 161 | + [scaleAnimation setToValue:[NSValue valueWithCATransform3D:scaleTrans]]; | ||
| 162 | + scaleAnimation.duration = 0.2; | ||
| 163 | + | ||
| 164 | + CAAnimationGroup *groupAnimation = [CAAnimationGroup animation]; | ||
| 165 | + [groupAnimation setAnimations:@[posAnimation,alphaAnimation,angleAnimation]]; | ||
| 166 | + [groupAnimation setDuration:duration]; | ||
| 167 | + [groupAnimation setRemovedOnCompletion:YES]; | ||
| 168 | + | ||
| 169 | + groupAnimation.delegate = self; | ||
| 170 | + [groupAnimation setValue:heartLayer | ||
| 171 | + forKey:LAYER_ANIMATION_NAME]; | ||
| 172 | + | ||
| 173 | + [heartLayer addAnimation:groupAnimation forKey:nil]; | ||
| 174 | +} | ||
| 175 | + | ||
| 176 | +-(void)exportImage:(UIImage *)image withColor:(UIColor *)color center:(CGPoint)center{ | ||
| 177 | + if (!image)return; | ||
| 178 | + aimCenter = center; | ||
| 179 | + CGFloat width = heartWidth; | ||
| 180 | + CGFloat height = width * image.size.height / image.size.width; | ||
| 181 | + aimHeight = height; | ||
| 182 | + CGRect frame = | ||
| 183 | + CGRectMake(center.x - width/2 - 15, | ||
| 184 | + center.y-height/2 - 38, | ||
| 185 | + width, | ||
| 186 | + height); | ||
| 187 | + | ||
| 188 | + CALayer *heartLayer = [CALayer layer]; | ||
| 189 | + heartLayer.opacity = 0.0f; | ||
| 190 | + heartLayer.frame = frame; | ||
| 191 | + | ||
| 192 | + if (color) | ||
| 193 | + { | ||
| 194 | + CALayer *maskLayer = [CALayer layer]; | ||
| 195 | + maskLayer.frame = CGRectMake(0, 0, width, height); | ||
| 196 | + maskLayer.contents = (__bridge id)image.CGImage; | ||
| 197 | + maskLayer.contentsGravity = kCAGravityResizeAspect; | ||
| 198 | + heartLayer.opacity = 0.0f; | ||
| 199 | + heartLayer.mask = maskLayer; | ||
| 200 | + heartLayer.backgroundColor = color.CGColor; | ||
| 201 | + } | ||
| 202 | + else | ||
| 203 | + { | ||
| 204 | + heartLayer.contents = (__bridge id)image.CGImage; | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + [self.layer insertSublayer:heartLayer | ||
| 208 | + above:self.layer]; | ||
| 209 | + | ||
| 210 | + //动画 | ||
| 211 | + [self startAnimationHeartLayer:heartLayer]; | ||
| 212 | +} | ||
| 213 | + | ||
| 214 | +- (UIColor *)randomColor{ | ||
| 215 | + NSArray *colors = | ||
| 216 | + @[ HEX_COLOR(0xFC6782), HEX_COLOR(0xFFEE58), HEX_COLOR(0x94EFDF), | ||
| 217 | + HEX_COLOR(0x50E3C2), HEX_COLOR(0xB2D7FF), HEX_COLOR(0xFDDA02), | ||
| 218 | + HEX_COLOR(0xBAD311), HEX_COLOR(0x58E7F9), HEX_COLOR(0xFF5252), | ||
| 219 | + HEX_COLOR(0xAE91FC), HEX_COLOR(0xBCF87F), HEX_COLOR(0x29B6F6), | ||
| 220 | + HEX_COLOR(0xF5A623), HEX_COLOR(0xFB3CB2), HEX_COLOR(0xFFA68A)]; | ||
| 221 | + | ||
| 222 | + int index = rand() % colors.count; | ||
| 223 | + UIColor *color = colors[index]; | ||
| 224 | + | ||
| 225 | + return color; | ||
| 226 | +} | ||
| 227 | +@end |
| @@ -8,28 +8,41 @@ | @@ -8,28 +8,41 @@ | ||
| 8 | 8 | ||
| 9 | #import "HomeViewController.h" | 9 | #import "HomeViewController.h" |
| 10 | #import "LVCLivePlayerController.h" | 10 | #import "LVCLivePlayerController.h" |
| 11 | +#import "LVCInteractionController.h" | ||
| 11 | 12 | ||
| 12 | @interface HomeViewController () | 13 | @interface HomeViewController () |
| 13 | 14 | ||
| 15 | +@property (nonatomic ,strong) UIButton * _Nullable interactionBtn; | ||
| 14 | 16 | ||
| 15 | @end | 17 | @end |
| 16 | 18 | ||
| 17 | @implementation HomeViewController | 19 | @implementation HomeViewController |
| 18 | 20 | ||
| 21 | +- (void)viewWillAppear:(BOOL)animated | ||
| 22 | +{ | ||
| 23 | + [super viewWillAppear:animated]; | ||
| 24 | + [[UIApplication sharedApplication].keyWindow addSubview:self.interactionBtn]; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)viewWillDisappear:(BOOL)animated | ||
| 28 | +{ | ||
| 29 | + [super viewWillDisappear:animated]; | ||
| 30 | + [self.interactionBtn removeFromSuperview]; | ||
| 31 | +} | ||
| 32 | + | ||
| 19 | - (void)viewDidLoad { | 33 | - (void)viewDidLoad { |
| 20 | [super viewDidLoad]; | 34 | [super viewDidLoad]; |
| 21 | // Do any additional setup after loading the view. | 35 | // Do any additional setup after loading the view. |
| 22 | self.view.backgroundColor = [UIColor redColor]; | 36 | self.view.backgroundColor = [UIColor redColor]; |
| 23 | self.navigationItem.title = @"首页"; | 37 | self.navigationItem.title = @"首页"; |
| 24 | 38 | ||
| 25 | - | ||
| 26 | UIButton *liveBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | 39 | UIButton *liveBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 27 | liveBtn.frame = CGRectMake(0, 100, self.view.width, 40); | 40 | liveBtn.frame = CGRectMake(0, 100, self.view.width, 40); |
| 28 | [liveBtn setTitle:@"电视台直播" forState:UIControlStateNormal]; | 41 | [liveBtn setTitle:@"电视台直播" forState:UIControlStateNormal]; |
| 29 | [liveBtn addTarget:self action:@selector(liveAction) forControlEvents:UIControlEventTouchUpInside]; | 42 | [liveBtn addTarget:self action:@selector(liveAction) forControlEvents:UIControlEventTouchUpInside]; |
| 30 | [self.view addSubview:liveBtn]; | 43 | [self.view addSubview:liveBtn]; |
| 31 | 44 | ||
| 32 | - | 45 | + [[UIApplication sharedApplication].keyWindow addSubview:self.interactionBtn]; |
| 33 | } | 46 | } |
| 34 | 47 | ||
| 35 | - (void)liveAction | 48 | - (void)liveAction |
| @@ -39,6 +52,28 @@ | @@ -39,6 +52,28 @@ | ||
| 39 | [self.navigationController pushViewController:liveVC animated:YES]; | 52 | [self.navigationController pushViewController:liveVC animated:YES]; |
| 40 | } | 53 | } |
| 41 | 54 | ||
| 55 | +- (void)interactionAction | ||
| 56 | +{ | ||
| 57 | + LVCInteractionController *intVC = [[LVCInteractionController alloc] init]; | ||
| 58 | + self.navigationController.navigationBar.hidden = YES; | ||
| 59 | + [self.navigationController pushViewController:intVC animated:YES]; | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | + | ||
| 63 | +- (UIButton *)interactionBtn | ||
| 64 | +{ | ||
| 65 | + if (!_interactionBtn) | ||
| 66 | + { | ||
| 67 | + UIButton *interactionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 68 | + interactionBtn.frame = CGRectMake(200, 400, 50, 30); | ||
| 69 | + [interactionBtn setTitle:@"互动" forState:UIControlStateNormal]; | ||
| 70 | + [interactionBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | ||
| 71 | + [interactionBtn addTarget:self action:@selector(interactionAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 72 | + _interactionBtn = interactionBtn; | ||
| 73 | + } | ||
| 74 | + return _interactionBtn; | ||
| 75 | +} | ||
| 76 | + | ||
| 42 | - (void)didReceiveMemoryWarning { | 77 | - (void)didReceiveMemoryWarning { |
| 43 | [super didReceiveMemoryWarning]; | 78 | [super didReceiveMemoryWarning]; |
| 44 | // Dispose of any resources that can be recreated. | 79 | // Dispose of any resources that can be recreated. |
| @@ -22,3 +22,6 @@ UIKIT_EXTERN CGFloat const kTitleFont; | @@ -22,3 +22,6 @@ UIKIT_EXTERN CGFloat const kTitleFont; | ||
| 22 | 22 | ||
| 23 | /** 内容字体字号 */ | 23 | /** 内容字体字号 */ |
| 24 | UIKIT_EXTERN CGFloat const kContentFont; | 24 | UIKIT_EXTERN CGFloat const kContentFont; |
| 25 | + | ||
| 26 | +/** 详细内容字体字号 */ | ||
| 27 | +UIKIT_EXTERN CGFloat const kDetailContentFont; |
| @@ -19,4 +19,7 @@ CGFloat const kTimeoutInterval = 10.0; | @@ -19,4 +19,7 @@ CGFloat const kTimeoutInterval = 10.0; | ||
| 19 | CGFloat const kTitleFont = 16.0; | 19 | CGFloat const kTitleFont = 16.0; |
| 20 | 20 | ||
| 21 | /** 内容字体字号 */ | 21 | /** 内容字体字号 */ |
| 22 | -CGFloat const kContentFont; | 22 | +CGFloat const kContentFont = 14.0; |
| 23 | + | ||
| 24 | +/** 详细内容字体字号 */ | ||
| 25 | +CGFloat const kDetailContentFont = 12.0; |