├── 6个六斋.xcodeproj ├── project.pbxproj └── xcuserdata │ └── ji_yufeng.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── 6个六斋 ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── 6ge6text.imageset │ │ ├── Contents.json │ │ └── fb286d16509a4564924ce3c8935ba0f6.PNG │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── touzi-1.jpg │ │ ├── touzi-2.jpg │ │ ├── touzi-3.jpg │ │ ├── touzi-4.jpg │ │ ├── touzi-5.jpg │ │ ├── touzi-6.jpg │ │ ├── touzi-7.jpg │ │ ├── touzi-8.jpg │ │ └── touzi.jpg │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── Default-812h@3x.jpeg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本 2-1.jpg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本 2-2.jpg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本 2.jpg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本-1.jpg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本-2.jpg │ │ ├── u=495286300,3198387558&fm=27&gp=0的副本-3.jpg │ │ └── u=495286300,3198387558&fm=27&gp=0的副本.jpg │ ├── apple.imageset │ │ ├── Contents.json │ │ └── apple.jpeg │ ├── back.imageset │ │ ├── Contents.json │ │ └── back-1.png │ ├── bi.imageset │ │ ├── Contents.json │ │ └── yao.png │ ├── five.imageset │ │ ├── Contents.json │ │ └── five.jpg │ ├── four.imageset │ │ ├── Contents.json │ │ └── four.jpg │ ├── one.imageset │ │ ├── Contents.json │ │ └── one.jpg │ ├── puke.imageset │ │ ├── Contents.json │ │ └── puke.jpeg │ ├── six.imageset │ │ ├── Contents.json │ │ └── six.jpg │ ├── suo.imageset │ │ ├── Contents.json │ │ └── suo 2.png │ ├── text1.imageset │ │ ├── Contents.json │ │ └── text1.PNG │ ├── text2.imageset │ │ ├── Contents.json │ │ └── text2.PNG │ ├── text3.imageset │ │ ├── Contents.json │ │ └── text3.PNG │ ├── three.imageset │ │ ├── Contents.json │ │ └── three.jpg │ ├── two.imageset │ │ ├── Contents.json │ │ └── two.jpg │ ├── tz.imageset │ │ ├── Contents.json │ │ └── tz.jpeg │ ├── yao.imageset │ │ ├── Contents.json │ │ └── yao.png │ ├── yaoyiyao.imageset │ │ ├── Contents.json │ │ └── yaoyiyao.png │ └── yuan.imageset │ │ ├── Contents.json │ │ └── yuan.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── BeeHomeViewController.h ├── BeeHomeViewController.m ├── Info.plist ├── PrefixHeader.pch ├── View │ ├── BeeDiceView.h │ └── BeeDiceView.m ├── dushen.mp3 ├── main.m ├── yaoshaizi.mp3 ├── zuobisound.m4a ├── 单骰摇晃 │ └── Controller │ │ ├── BeeOneDiceViewController.h │ │ ├── BeeOneDiceViewController.m │ │ ├── BeeOneExplainViewController.h │ │ └── BeeOneExplainViewController.m ├── 大话骰 │ ├── Controller │ │ ├── BeeBragViewController.h │ │ ├── BeeBragViewController.m │ │ ├── BeeFiveExplainViewController.h │ │ └── BeeFiveExplainViewController.m │ └── View │ │ ├── BeeBragContentView.h │ │ └── BeeBragContentView.m ├── 手势 │ ├── UIView+WhenTappedBlocks.h │ └── UIView+WhenTappedBlocks.m └── 比大小 │ ├── Controller │ ├── BeeThreeDiceViewController.h │ ├── BeeThreeDiceViewController.m │ ├── BeeThreeExplainViewController.h │ └── BeeThreeExplainViewController.m │ └── View │ ├── BeeThreeDiceContentView.h │ └── BeeThreeDiceContentView.m ├── 6个六斋Tests ├── Info.plist └── ____Tests.m ├── 6个六斋UITests ├── Info.plist └── ____UITests.m ├── Podfile ├── README.md └── demoPic.gif /6个六斋.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5A229825DEE009E152B80279 /* libPods-6个六斋.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 163C2EFAEFB0463A84507466 /* libPods-6个六斋.a */; }; 11 | 5C26D5252029881C001F266C /* BeeOneDiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C26D5242029881C001F266C /* BeeOneDiceViewController.m */; }; 12 | 5C26D52C2029962E001F266C /* BeeThreeDiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C26D52B2029962E001F266C /* BeeThreeDiceViewController.m */; }; 13 | 5C26D52F2029A759001F266C /* BeeThreeDiceContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C26D52E2029A759001F266C /* BeeThreeDiceContentView.m */; }; 14 | 5C679A48202ADA5D00700310 /* yaoshaizi.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5C679A47202ADA5C00700310 /* yaoshaizi.mp3 */; }; 15 | 5C679A4A202ADA6C00700310 /* zuobisound.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 5C679A49202ADA6B00700310 /* zuobisound.m4a */; }; 16 | 5C679A4F202ADD8400700310 /* dushen.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5C679A4E202ADD8400700310 /* dushen.mp3 */; }; 17 | 5C7A06D92019BBE8009DF151 /* BeeDiceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C7A06D82019BBE8009DF151 /* BeeDiceView.m */; }; 18 | 5C7A06DF2019CAC4009DF151 /* UIView+WhenTappedBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C7A06DD2019CAC4009DF151 /* UIView+WhenTappedBlocks.m */; }; 19 | 5C83D1832021AC3F009F4C2B /* BeeBragViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C83D1822021AC3F009F4C2B /* BeeBragViewController.m */; }; 20 | 5C83D1862021AFD4009F4C2B /* BeeBragContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C83D1852021AFD4009F4C2B /* BeeBragContentView.m */; }; 21 | 5C969D6020187E46004BBEB8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C969D5F20187E46004BBEB8 /* AppDelegate.m */; }; 22 | 5C969D6620187E46004BBEB8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C969D6420187E46004BBEB8 /* Main.storyboard */; }; 23 | 5C969D6820187E46004BBEB8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C969D6720187E46004BBEB8 /* Assets.xcassets */; }; 24 | 5C969D6B20187E46004BBEB8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C969D6920187E46004BBEB8 /* LaunchScreen.storyboard */; }; 25 | 5C969D6E20187E46004BBEB8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C969D6D20187E46004BBEB8 /* main.m */; }; 26 | 5C969D7820187E47004BBEB8 /* ____Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C969D7720187E47004BBEB8 /* ____Tests.m */; }; 27 | 5C969D8320187E47004BBEB8 /* ____UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C969D8220187E47004BBEB8 /* ____UITests.m */; }; 28 | 5C969D9320188087004BBEB8 /* BeeHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C969D9220188087004BBEB8 /* BeeHomeViewController.m */; }; 29 | 5CBC1532202BDF54007E5751 /* BeeOneExplainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC1531202BDF54007E5751 /* BeeOneExplainViewController.m */; }; 30 | 5CBC1535202BE9C8007E5751 /* BeeFiveExplainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC1534202BE9C8007E5751 /* BeeFiveExplainViewController.m */; }; 31 | 5CBC1538202BEC49007E5751 /* BeeThreeExplainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC1537202BEC49007E5751 /* BeeThreeExplainViewController.m */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | 5C969D7420187E47004BBEB8 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 5C969D5320187E46004BBEB8 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 5C969D5A20187E46004BBEB8; 40 | remoteInfo = "6个六斋"; 41 | }; 42 | 5C969D7F20187E47004BBEB8 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 5C969D5320187E46004BBEB8 /* Project object */; 45 | proxyType = 1; 46 | remoteGlobalIDString = 5C969D5A20187E46004BBEB8; 47 | remoteInfo = "6个六斋"; 48 | }; 49 | /* End PBXContainerItemProxy section */ 50 | 51 | /* Begin PBXFileReference section */ 52 | 163C2EFAEFB0463A84507466 /* libPods-6个六斋.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-6个六斋.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 3EC413F5379EDF00274AAB0C /* Pods-6个六斋.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-6个六斋.release.xcconfig"; path = "Pods/Target Support Files/Pods-6个六斋/Pods-6个六斋.release.xcconfig"; sourceTree = ""; }; 54 | 5C26D5232029881C001F266C /* BeeOneDiceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeOneDiceViewController.h; sourceTree = ""; }; 55 | 5C26D5242029881C001F266C /* BeeOneDiceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeOneDiceViewController.m; sourceTree = ""; }; 56 | 5C26D52A2029962E001F266C /* BeeThreeDiceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeThreeDiceViewController.h; sourceTree = ""; }; 57 | 5C26D52B2029962E001F266C /* BeeThreeDiceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeThreeDiceViewController.m; sourceTree = ""; }; 58 | 5C26D52D2029A759001F266C /* BeeThreeDiceContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeThreeDiceContentView.h; sourceTree = ""; }; 59 | 5C26D52E2029A759001F266C /* BeeThreeDiceContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeThreeDiceContentView.m; sourceTree = ""; }; 60 | 5C679A47202ADA5C00700310 /* yaoshaizi.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = yaoshaizi.mp3; sourceTree = ""; }; 61 | 5C679A49202ADA6B00700310 /* zuobisound.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = zuobisound.m4a; sourceTree = ""; }; 62 | 5C679A4E202ADD8400700310 /* dushen.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = dushen.mp3; sourceTree = ""; }; 63 | 5C7A06D72019BBE7009DF151 /* BeeDiceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeeDiceView.h; sourceTree = ""; }; 64 | 5C7A06D82019BBE8009DF151 /* BeeDiceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeeDiceView.m; sourceTree = ""; }; 65 | 5C7A06DD2019CAC4009DF151 /* UIView+WhenTappedBlocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+WhenTappedBlocks.m"; sourceTree = ""; }; 66 | 5C7A06DE2019CAC4009DF151 /* UIView+WhenTappedBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+WhenTappedBlocks.h"; sourceTree = ""; }; 67 | 5C83D1812021AC3F009F4C2B /* BeeBragViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeBragViewController.h; sourceTree = ""; }; 68 | 5C83D1822021AC3F009F4C2B /* BeeBragViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeBragViewController.m; sourceTree = ""; }; 69 | 5C83D1842021AFD4009F4C2B /* BeeBragContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeBragContentView.h; sourceTree = ""; }; 70 | 5C83D1852021AFD4009F4C2B /* BeeBragContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeBragContentView.m; sourceTree = ""; }; 71 | 5C969D5B20187E46004BBEB8 /* 6个六斋.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "6个六斋.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | 5C969D5E20187E46004BBEB8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 73 | 5C969D5F20187E46004BBEB8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 74 | 5C969D6520187E46004BBEB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 75 | 5C969D6720187E46004BBEB8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 76 | 5C969D6A20187E46004BBEB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 77 | 5C969D6C20187E46004BBEB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 78 | 5C969D6D20187E46004BBEB8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 79 | 5C969D7320187E47004BBEB8 /* 6个六斋Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "6个六斋Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 5C969D7720187E47004BBEB8 /* ____Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "____Tests.m"; sourceTree = ""; }; 81 | 5C969D7920187E47004BBEB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 82 | 5C969D7E20187E47004BBEB8 /* 6个六斋UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "6个六斋UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | 5C969D8220187E47004BBEB8 /* ____UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "____UITests.m"; sourceTree = ""; }; 84 | 5C969D8420187E47004BBEB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85 | 5C969D9020187EE3004BBEB8 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 86 | 5C969D9120188087004BBEB8 /* BeeHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeHomeViewController.h; sourceTree = ""; }; 87 | 5C969D9220188087004BBEB8 /* BeeHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeHomeViewController.m; sourceTree = ""; }; 88 | 5CBC1530202BDF54007E5751 /* BeeOneExplainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeOneExplainViewController.h; sourceTree = ""; }; 89 | 5CBC1531202BDF54007E5751 /* BeeOneExplainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeOneExplainViewController.m; sourceTree = ""; }; 90 | 5CBC1533202BE9C8007E5751 /* BeeFiveExplainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeFiveExplainViewController.h; sourceTree = ""; }; 91 | 5CBC1534202BE9C8007E5751 /* BeeFiveExplainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeFiveExplainViewController.m; sourceTree = ""; }; 92 | 5CBC1536202BEC49007E5751 /* BeeThreeExplainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeeThreeExplainViewController.h; sourceTree = ""; }; 93 | 5CBC1537202BEC49007E5751 /* BeeThreeExplainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeeThreeExplainViewController.m; sourceTree = ""; }; 94 | C1DA1C0EE0683B20996660EF /* Pods-6个六斋.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-6个六斋.debug.xcconfig"; path = "Pods/Target Support Files/Pods-6个六斋/Pods-6个六斋.debug.xcconfig"; sourceTree = ""; }; 95 | /* End PBXFileReference section */ 96 | 97 | /* Begin PBXFrameworksBuildPhase section */ 98 | 5C969D5820187E46004BBEB8 /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | 5A229825DEE009E152B80279 /* libPods-6个六斋.a in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | 5C969D7020187E47004BBEB8 /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | 5C969D7B20187E47004BBEB8 /* Frameworks */ = { 114 | isa = PBXFrameworksBuildPhase; 115 | buildActionMask = 2147483647; 116 | files = ( 117 | ); 118 | runOnlyForDeploymentPostprocessing = 0; 119 | }; 120 | /* End PBXFrameworksBuildPhase section */ 121 | 122 | /* Begin PBXGroup section */ 123 | 5C26D51F2029875B001F266C /* 单骰摇晃 */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 5C26D5222029876A001F266C /* Model */, 127 | 5C26D52120298768001F266C /* View */, 128 | 5C26D52020298765001F266C /* Controller */, 129 | ); 130 | path = "单骰摇晃"; 131 | sourceTree = ""; 132 | }; 133 | 5C26D52020298765001F266C /* Controller */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 5C26D5232029881C001F266C /* BeeOneDiceViewController.h */, 137 | 5C26D5242029881C001F266C /* BeeOneDiceViewController.m */, 138 | 5CBC1530202BDF54007E5751 /* BeeOneExplainViewController.h */, 139 | 5CBC1531202BDF54007E5751 /* BeeOneExplainViewController.m */, 140 | ); 141 | path = Controller; 142 | sourceTree = ""; 143 | }; 144 | 5C26D52120298768001F266C /* View */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | ); 148 | path = View; 149 | sourceTree = ""; 150 | }; 151 | 5C26D5222029876A001F266C /* Model */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | ); 155 | path = Model; 156 | sourceTree = ""; 157 | }; 158 | 5C26D5262029915B001F266C /* 比大小 */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 5C26D52920299167001F266C /* Model */, 162 | 5C26D52820299165001F266C /* View */, 163 | 5C26D52720299163001F266C /* Controller */, 164 | ); 165 | path = "比大小"; 166 | sourceTree = ""; 167 | }; 168 | 5C26D52720299163001F266C /* Controller */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 5C26D52A2029962E001F266C /* BeeThreeDiceViewController.h */, 172 | 5C26D52B2029962E001F266C /* BeeThreeDiceViewController.m */, 173 | 5CBC1536202BEC49007E5751 /* BeeThreeExplainViewController.h */, 174 | 5CBC1537202BEC49007E5751 /* BeeThreeExplainViewController.m */, 175 | ); 176 | path = Controller; 177 | sourceTree = ""; 178 | }; 179 | 5C26D52820299165001F266C /* View */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 5C26D52D2029A759001F266C /* BeeThreeDiceContentView.h */, 183 | 5C26D52E2029A759001F266C /* BeeThreeDiceContentView.m */, 184 | ); 185 | path = View; 186 | sourceTree = ""; 187 | }; 188 | 5C26D52920299167001F266C /* Model */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | ); 192 | path = Model; 193 | sourceTree = ""; 194 | }; 195 | 5C7A06DC2019CAC4009DF151 /* 手势 */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 5C7A06DD2019CAC4009DF151 /* UIView+WhenTappedBlocks.m */, 199 | 5C7A06DE2019CAC4009DF151 /* UIView+WhenTappedBlocks.h */, 200 | ); 201 | path = "手势"; 202 | sourceTree = ""; 203 | }; 204 | 5C83D17D2021ABEF009F4C2B /* 大话骰 */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 5C83D1802021AC1B009F4C2B /* Model */, 208 | 5C83D17F2021AC18009F4C2B /* View */, 209 | 5C83D17E2021AC13009F4C2B /* Controller */, 210 | ); 211 | path = "大话骰"; 212 | sourceTree = ""; 213 | }; 214 | 5C83D17E2021AC13009F4C2B /* Controller */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 5C83D1812021AC3F009F4C2B /* BeeBragViewController.h */, 218 | 5C83D1822021AC3F009F4C2B /* BeeBragViewController.m */, 219 | 5CBC1533202BE9C8007E5751 /* BeeFiveExplainViewController.h */, 220 | 5CBC1534202BE9C8007E5751 /* BeeFiveExplainViewController.m */, 221 | ); 222 | path = Controller; 223 | sourceTree = ""; 224 | }; 225 | 5C83D17F2021AC18009F4C2B /* View */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 5C83D1842021AFD4009F4C2B /* BeeBragContentView.h */, 229 | 5C83D1852021AFD4009F4C2B /* BeeBragContentView.m */, 230 | ); 231 | path = View; 232 | sourceTree = ""; 233 | }; 234 | 5C83D1802021AC1B009F4C2B /* Model */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | ); 238 | path = Model; 239 | sourceTree = ""; 240 | }; 241 | 5C969D5220187E46004BBEB8 = { 242 | isa = PBXGroup; 243 | children = ( 244 | 5C969D5D20187E46004BBEB8 /* 6个六斋 */, 245 | 5C969D7620187E47004BBEB8 /* 6个六斋Tests */, 246 | 5C969D8120187E47004BBEB8 /* 6个六斋UITests */, 247 | 5C969D5C20187E46004BBEB8 /* Products */, 248 | DB88238EB0A8C5496339B8FD /* Pods */, 249 | B2ABA2F27B40BE71E40CF012 /* Frameworks */, 250 | ); 251 | sourceTree = ""; 252 | }; 253 | 5C969D5C20187E46004BBEB8 /* Products */ = { 254 | isa = PBXGroup; 255 | children = ( 256 | 5C969D5B20187E46004BBEB8 /* 6个六斋.app */, 257 | 5C969D7320187E47004BBEB8 /* 6个六斋Tests.xctest */, 258 | 5C969D7E20187E47004BBEB8 /* 6个六斋UITests.xctest */, 259 | ); 260 | name = Products; 261 | sourceTree = ""; 262 | }; 263 | 5C969D5D20187E46004BBEB8 /* 6个六斋 */ = { 264 | isa = PBXGroup; 265 | children = ( 266 | 5C679A49202ADA6B00700310 /* zuobisound.m4a */, 267 | 5C679A47202ADA5C00700310 /* yaoshaizi.mp3 */, 268 | 5C679A4E202ADD8400700310 /* dushen.mp3 */, 269 | 5C26D5262029915B001F266C /* 比大小 */, 270 | 5C26D51F2029875B001F266C /* 单骰摇晃 */, 271 | 5C83D17D2021ABEF009F4C2B /* 大话骰 */, 272 | 5C7A06DC2019CAC4009DF151 /* 手势 */, 273 | 5C969D942018815D004BBEB8 /* View */, 274 | 5C969D5E20187E46004BBEB8 /* AppDelegate.h */, 275 | 5C969D5F20187E46004BBEB8 /* AppDelegate.m */, 276 | 5C969D9120188087004BBEB8 /* BeeHomeViewController.h */, 277 | 5C969D9220188087004BBEB8 /* BeeHomeViewController.m */, 278 | 5C969D6420187E46004BBEB8 /* Main.storyboard */, 279 | 5C969D6720187E46004BBEB8 /* Assets.xcassets */, 280 | 5C969D6920187E46004BBEB8 /* LaunchScreen.storyboard */, 281 | 5C969D6C20187E46004BBEB8 /* Info.plist */, 282 | 5C969D6D20187E46004BBEB8 /* main.m */, 283 | 5C969D9020187EE3004BBEB8 /* PrefixHeader.pch */, 284 | ); 285 | path = "6个六斋"; 286 | sourceTree = ""; 287 | }; 288 | 5C969D7620187E47004BBEB8 /* 6个六斋Tests */ = { 289 | isa = PBXGroup; 290 | children = ( 291 | 5C969D7720187E47004BBEB8 /* ____Tests.m */, 292 | 5C969D7920187E47004BBEB8 /* Info.plist */, 293 | ); 294 | path = "6个六斋Tests"; 295 | sourceTree = ""; 296 | }; 297 | 5C969D8120187E47004BBEB8 /* 6个六斋UITests */ = { 298 | isa = PBXGroup; 299 | children = ( 300 | 5C969D8220187E47004BBEB8 /* ____UITests.m */, 301 | 5C969D8420187E47004BBEB8 /* Info.plist */, 302 | ); 303 | path = "6个六斋UITests"; 304 | sourceTree = ""; 305 | }; 306 | 5C969D942018815D004BBEB8 /* View */ = { 307 | isa = PBXGroup; 308 | children = ( 309 | 5C7A06D72019BBE7009DF151 /* BeeDiceView.h */, 310 | 5C7A06D82019BBE8009DF151 /* BeeDiceView.m */, 311 | ); 312 | path = View; 313 | sourceTree = ""; 314 | }; 315 | B2ABA2F27B40BE71E40CF012 /* Frameworks */ = { 316 | isa = PBXGroup; 317 | children = ( 318 | 163C2EFAEFB0463A84507466 /* libPods-6个六斋.a */, 319 | ); 320 | name = Frameworks; 321 | sourceTree = ""; 322 | }; 323 | DB88238EB0A8C5496339B8FD /* Pods */ = { 324 | isa = PBXGroup; 325 | children = ( 326 | C1DA1C0EE0683B20996660EF /* Pods-6个六斋.debug.xcconfig */, 327 | 3EC413F5379EDF00274AAB0C /* Pods-6个六斋.release.xcconfig */, 328 | ); 329 | name = Pods; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXGroup section */ 333 | 334 | /* Begin PBXNativeTarget section */ 335 | 5C969D5A20187E46004BBEB8 /* 6个六斋 */ = { 336 | isa = PBXNativeTarget; 337 | buildConfigurationList = 5C969D8720187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋" */; 338 | buildPhases = ( 339 | 1E7FC0A733227866F86DD634 /* [CP] Check Pods Manifest.lock */, 340 | 5C969D5720187E46004BBEB8 /* Sources */, 341 | 5C969D5820187E46004BBEB8 /* Frameworks */, 342 | 5C969D5920187E46004BBEB8 /* Resources */, 343 | 3500BC31352EC166117602E6 /* [CP] Embed Pods Frameworks */, 344 | 55CFFF9F8E5AD5A7ABD2E2BF /* [CP] Copy Pods Resources */, 345 | ); 346 | buildRules = ( 347 | ); 348 | dependencies = ( 349 | ); 350 | name = "6个六斋"; 351 | productName = "6个六斋"; 352 | productReference = 5C969D5B20187E46004BBEB8 /* 6个六斋.app */; 353 | productType = "com.apple.product-type.application"; 354 | }; 355 | 5C969D7220187E47004BBEB8 /* 6个六斋Tests */ = { 356 | isa = PBXNativeTarget; 357 | buildConfigurationList = 5C969D8A20187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋Tests" */; 358 | buildPhases = ( 359 | 5C969D6F20187E47004BBEB8 /* Sources */, 360 | 5C969D7020187E47004BBEB8 /* Frameworks */, 361 | 5C969D7120187E47004BBEB8 /* Resources */, 362 | ); 363 | buildRules = ( 364 | ); 365 | dependencies = ( 366 | 5C969D7520187E47004BBEB8 /* PBXTargetDependency */, 367 | ); 368 | name = "6个六斋Tests"; 369 | productName = "6个六斋Tests"; 370 | productReference = 5C969D7320187E47004BBEB8 /* 6个六斋Tests.xctest */; 371 | productType = "com.apple.product-type.bundle.unit-test"; 372 | }; 373 | 5C969D7D20187E47004BBEB8 /* 6个六斋UITests */ = { 374 | isa = PBXNativeTarget; 375 | buildConfigurationList = 5C969D8D20187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋UITests" */; 376 | buildPhases = ( 377 | 5C969D7A20187E47004BBEB8 /* Sources */, 378 | 5C969D7B20187E47004BBEB8 /* Frameworks */, 379 | 5C969D7C20187E47004BBEB8 /* Resources */, 380 | ); 381 | buildRules = ( 382 | ); 383 | dependencies = ( 384 | 5C969D8020187E47004BBEB8 /* PBXTargetDependency */, 385 | ); 386 | name = "6个六斋UITests"; 387 | productName = "6个六斋UITests"; 388 | productReference = 5C969D7E20187E47004BBEB8 /* 6个六斋UITests.xctest */; 389 | productType = "com.apple.product-type.bundle.ui-testing"; 390 | }; 391 | /* End PBXNativeTarget section */ 392 | 393 | /* Begin PBXProject section */ 394 | 5C969D5320187E46004BBEB8 /* Project object */ = { 395 | isa = PBXProject; 396 | attributes = { 397 | LastUpgradeCheck = 0920; 398 | ORGANIZATIONNAME = GD_Bee; 399 | TargetAttributes = { 400 | 5C969D5A20187E46004BBEB8 = { 401 | CreatedOnToolsVersion = 9.2; 402 | ProvisioningStyle = Automatic; 403 | SystemCapabilities = { 404 | com.apple.BackgroundModes = { 405 | enabled = 1; 406 | }; 407 | }; 408 | }; 409 | 5C969D7220187E47004BBEB8 = { 410 | CreatedOnToolsVersion = 9.2; 411 | ProvisioningStyle = Automatic; 412 | TestTargetID = 5C969D5A20187E46004BBEB8; 413 | }; 414 | 5C969D7D20187E47004BBEB8 = { 415 | CreatedOnToolsVersion = 9.2; 416 | ProvisioningStyle = Automatic; 417 | TestTargetID = 5C969D5A20187E46004BBEB8; 418 | }; 419 | }; 420 | }; 421 | buildConfigurationList = 5C969D5620187E46004BBEB8 /* Build configuration list for PBXProject "6个六斋" */; 422 | compatibilityVersion = "Xcode 8.0"; 423 | developmentRegion = en; 424 | hasScannedForEncodings = 0; 425 | knownRegions = ( 426 | en, 427 | Base, 428 | ); 429 | mainGroup = 5C969D5220187E46004BBEB8; 430 | productRefGroup = 5C969D5C20187E46004BBEB8 /* Products */; 431 | projectDirPath = ""; 432 | projectRoot = ""; 433 | targets = ( 434 | 5C969D5A20187E46004BBEB8 /* 6个六斋 */, 435 | 5C969D7220187E47004BBEB8 /* 6个六斋Tests */, 436 | 5C969D7D20187E47004BBEB8 /* 6个六斋UITests */, 437 | ); 438 | }; 439 | /* End PBXProject section */ 440 | 441 | /* Begin PBXResourcesBuildPhase section */ 442 | 5C969D5920187E46004BBEB8 /* Resources */ = { 443 | isa = PBXResourcesBuildPhase; 444 | buildActionMask = 2147483647; 445 | files = ( 446 | 5C969D6B20187E46004BBEB8 /* LaunchScreen.storyboard in Resources */, 447 | 5C969D6820187E46004BBEB8 /* Assets.xcassets in Resources */, 448 | 5C679A48202ADA5D00700310 /* yaoshaizi.mp3 in Resources */, 449 | 5C969D6620187E46004BBEB8 /* Main.storyboard in Resources */, 450 | 5C679A4A202ADA6C00700310 /* zuobisound.m4a in Resources */, 451 | 5C679A4F202ADD8400700310 /* dushen.mp3 in Resources */, 452 | ); 453 | runOnlyForDeploymentPostprocessing = 0; 454 | }; 455 | 5C969D7120187E47004BBEB8 /* Resources */ = { 456 | isa = PBXResourcesBuildPhase; 457 | buildActionMask = 2147483647; 458 | files = ( 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | }; 462 | 5C969D7C20187E47004BBEB8 /* Resources */ = { 463 | isa = PBXResourcesBuildPhase; 464 | buildActionMask = 2147483647; 465 | files = ( 466 | ); 467 | runOnlyForDeploymentPostprocessing = 0; 468 | }; 469 | /* End PBXResourcesBuildPhase section */ 470 | 471 | /* Begin PBXShellScriptBuildPhase section */ 472 | 1E7FC0A733227866F86DD634 /* [CP] Check Pods Manifest.lock */ = { 473 | isa = PBXShellScriptBuildPhase; 474 | buildActionMask = 2147483647; 475 | files = ( 476 | ); 477 | inputPaths = ( 478 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 479 | "${PODS_ROOT}/Manifest.lock", 480 | ); 481 | name = "[CP] Check Pods Manifest.lock"; 482 | outputPaths = ( 483 | "$(DERIVED_FILE_DIR)/Pods-6个六斋-checkManifestLockResult.txt", 484 | ); 485 | runOnlyForDeploymentPostprocessing = 0; 486 | shellPath = /bin/sh; 487 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 488 | showEnvVarsInLog = 0; 489 | }; 490 | 3500BC31352EC166117602E6 /* [CP] Embed Pods Frameworks */ = { 491 | isa = PBXShellScriptBuildPhase; 492 | buildActionMask = 2147483647; 493 | files = ( 494 | ); 495 | inputPaths = ( 496 | ); 497 | name = "[CP] Embed Pods Frameworks"; 498 | outputPaths = ( 499 | ); 500 | runOnlyForDeploymentPostprocessing = 0; 501 | shellPath = /bin/sh; 502 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-6个六斋/Pods-6个六斋-frameworks.sh\"\n"; 503 | showEnvVarsInLog = 0; 504 | }; 505 | 55CFFF9F8E5AD5A7ABD2E2BF /* [CP] Copy Pods Resources */ = { 506 | isa = PBXShellScriptBuildPhase; 507 | buildActionMask = 2147483647; 508 | files = ( 509 | ); 510 | inputPaths = ( 511 | ); 512 | name = "[CP] Copy Pods Resources"; 513 | outputPaths = ( 514 | ); 515 | runOnlyForDeploymentPostprocessing = 0; 516 | shellPath = /bin/sh; 517 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-6个六斋/Pods-6个六斋-resources.sh\"\n"; 518 | showEnvVarsInLog = 0; 519 | }; 520 | /* End PBXShellScriptBuildPhase section */ 521 | 522 | /* Begin PBXSourcesBuildPhase section */ 523 | 5C969D5720187E46004BBEB8 /* Sources */ = { 524 | isa = PBXSourcesBuildPhase; 525 | buildActionMask = 2147483647; 526 | files = ( 527 | 5C7A06DF2019CAC4009DF151 /* UIView+WhenTappedBlocks.m in Sources */, 528 | 5C7A06D92019BBE8009DF151 /* BeeDiceView.m in Sources */, 529 | 5C969D6E20187E46004BBEB8 /* main.m in Sources */, 530 | 5CBC1535202BE9C8007E5751 /* BeeFiveExplainViewController.m in Sources */, 531 | 5C26D52F2029A759001F266C /* BeeThreeDiceContentView.m in Sources */, 532 | 5C969D9320188087004BBEB8 /* BeeHomeViewController.m in Sources */, 533 | 5C26D52C2029962E001F266C /* BeeThreeDiceViewController.m in Sources */, 534 | 5CBC1538202BEC49007E5751 /* BeeThreeExplainViewController.m in Sources */, 535 | 5C83D1862021AFD4009F4C2B /* BeeBragContentView.m in Sources */, 536 | 5C969D6020187E46004BBEB8 /* AppDelegate.m in Sources */, 537 | 5C83D1832021AC3F009F4C2B /* BeeBragViewController.m in Sources */, 538 | 5C26D5252029881C001F266C /* BeeOneDiceViewController.m in Sources */, 539 | 5CBC1532202BDF54007E5751 /* BeeOneExplainViewController.m in Sources */, 540 | ); 541 | runOnlyForDeploymentPostprocessing = 0; 542 | }; 543 | 5C969D6F20187E47004BBEB8 /* Sources */ = { 544 | isa = PBXSourcesBuildPhase; 545 | buildActionMask = 2147483647; 546 | files = ( 547 | 5C969D7820187E47004BBEB8 /* ____Tests.m in Sources */, 548 | ); 549 | runOnlyForDeploymentPostprocessing = 0; 550 | }; 551 | 5C969D7A20187E47004BBEB8 /* Sources */ = { 552 | isa = PBXSourcesBuildPhase; 553 | buildActionMask = 2147483647; 554 | files = ( 555 | 5C969D8320187E47004BBEB8 /* ____UITests.m in Sources */, 556 | ); 557 | runOnlyForDeploymentPostprocessing = 0; 558 | }; 559 | /* End PBXSourcesBuildPhase section */ 560 | 561 | /* Begin PBXTargetDependency section */ 562 | 5C969D7520187E47004BBEB8 /* PBXTargetDependency */ = { 563 | isa = PBXTargetDependency; 564 | target = 5C969D5A20187E46004BBEB8 /* 6个六斋 */; 565 | targetProxy = 5C969D7420187E47004BBEB8 /* PBXContainerItemProxy */; 566 | }; 567 | 5C969D8020187E47004BBEB8 /* PBXTargetDependency */ = { 568 | isa = PBXTargetDependency; 569 | target = 5C969D5A20187E46004BBEB8 /* 6个六斋 */; 570 | targetProxy = 5C969D7F20187E47004BBEB8 /* PBXContainerItemProxy */; 571 | }; 572 | /* End PBXTargetDependency section */ 573 | 574 | /* Begin PBXVariantGroup section */ 575 | 5C969D6420187E46004BBEB8 /* Main.storyboard */ = { 576 | isa = PBXVariantGroup; 577 | children = ( 578 | 5C969D6520187E46004BBEB8 /* Base */, 579 | ); 580 | name = Main.storyboard; 581 | sourceTree = ""; 582 | }; 583 | 5C969D6920187E46004BBEB8 /* LaunchScreen.storyboard */ = { 584 | isa = PBXVariantGroup; 585 | children = ( 586 | 5C969D6A20187E46004BBEB8 /* Base */, 587 | ); 588 | name = LaunchScreen.storyboard; 589 | sourceTree = ""; 590 | }; 591 | /* End PBXVariantGroup section */ 592 | 593 | /* Begin XCBuildConfiguration section */ 594 | 5C969D8520187E47004BBEB8 /* Debug */ = { 595 | isa = XCBuildConfiguration; 596 | buildSettings = { 597 | ALWAYS_SEARCH_USER_PATHS = NO; 598 | CLANG_ANALYZER_NONNULL = YES; 599 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 600 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 601 | CLANG_CXX_LIBRARY = "libc++"; 602 | CLANG_ENABLE_MODULES = YES; 603 | CLANG_ENABLE_OBJC_ARC = YES; 604 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 605 | CLANG_WARN_BOOL_CONVERSION = YES; 606 | CLANG_WARN_COMMA = YES; 607 | CLANG_WARN_CONSTANT_CONVERSION = YES; 608 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 609 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 610 | CLANG_WARN_EMPTY_BODY = YES; 611 | CLANG_WARN_ENUM_CONVERSION = YES; 612 | CLANG_WARN_INFINITE_RECURSION = YES; 613 | CLANG_WARN_INT_CONVERSION = YES; 614 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 615 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 616 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 617 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 618 | CLANG_WARN_STRICT_PROTOTYPES = YES; 619 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 620 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 621 | CLANG_WARN_UNREACHABLE_CODE = YES; 622 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 623 | CODE_SIGN_IDENTITY = "iPhone Developer"; 624 | COPY_PHASE_STRIP = NO; 625 | DEBUG_INFORMATION_FORMAT = dwarf; 626 | ENABLE_STRICT_OBJC_MSGSEND = YES; 627 | ENABLE_TESTABILITY = YES; 628 | GCC_C_LANGUAGE_STANDARD = gnu11; 629 | GCC_DYNAMIC_NO_PIC = NO; 630 | GCC_NO_COMMON_BLOCKS = YES; 631 | GCC_OPTIMIZATION_LEVEL = 0; 632 | GCC_PREPROCESSOR_DEFINITIONS = ( 633 | "DEBUG=1", 634 | "$(inherited)", 635 | ); 636 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 637 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 638 | GCC_WARN_UNDECLARED_SELECTOR = YES; 639 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 640 | GCC_WARN_UNUSED_FUNCTION = YES; 641 | GCC_WARN_UNUSED_VARIABLE = YES; 642 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 643 | MTL_ENABLE_DEBUG_INFO = YES; 644 | ONLY_ACTIVE_ARCH = YES; 645 | SDKROOT = iphoneos; 646 | }; 647 | name = Debug; 648 | }; 649 | 5C969D8620187E47004BBEB8 /* Release */ = { 650 | isa = XCBuildConfiguration; 651 | buildSettings = { 652 | ALWAYS_SEARCH_USER_PATHS = NO; 653 | CLANG_ANALYZER_NONNULL = YES; 654 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 655 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 656 | CLANG_CXX_LIBRARY = "libc++"; 657 | CLANG_ENABLE_MODULES = YES; 658 | CLANG_ENABLE_OBJC_ARC = YES; 659 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 660 | CLANG_WARN_BOOL_CONVERSION = YES; 661 | CLANG_WARN_COMMA = YES; 662 | CLANG_WARN_CONSTANT_CONVERSION = YES; 663 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 664 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 665 | CLANG_WARN_EMPTY_BODY = YES; 666 | CLANG_WARN_ENUM_CONVERSION = YES; 667 | CLANG_WARN_INFINITE_RECURSION = YES; 668 | CLANG_WARN_INT_CONVERSION = YES; 669 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 670 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 671 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 672 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 673 | CLANG_WARN_STRICT_PROTOTYPES = YES; 674 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 675 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 676 | CLANG_WARN_UNREACHABLE_CODE = YES; 677 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 678 | CODE_SIGN_IDENTITY = "iPhone Developer"; 679 | COPY_PHASE_STRIP = NO; 680 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 681 | ENABLE_NS_ASSERTIONS = NO; 682 | ENABLE_STRICT_OBJC_MSGSEND = YES; 683 | GCC_C_LANGUAGE_STANDARD = gnu11; 684 | GCC_NO_COMMON_BLOCKS = YES; 685 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 686 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 687 | GCC_WARN_UNDECLARED_SELECTOR = YES; 688 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 689 | GCC_WARN_UNUSED_FUNCTION = YES; 690 | GCC_WARN_UNUSED_VARIABLE = YES; 691 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 692 | MTL_ENABLE_DEBUG_INFO = NO; 693 | SDKROOT = iphoneos; 694 | VALIDATE_PRODUCT = YES; 695 | }; 696 | name = Release; 697 | }; 698 | 5C969D8820187E47004BBEB8 /* Debug */ = { 699 | isa = XCBuildConfiguration; 700 | baseConfigurationReference = C1DA1C0EE0683B20996660EF /* Pods-6个六斋.debug.xcconfig */; 701 | buildSettings = { 702 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 703 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 704 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 705 | CODE_SIGN_STYLE = Automatic; 706 | DEVELOPMENT_TEAM = Z7GR6ZAZKT; 707 | GCC_PREFIX_HEADER = "$(SRCROOT)/6个六斋/PrefixHeader.pch"; 708 | INFOPLIST_FILE = "6个六斋/Info.plist"; 709 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 710 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 711 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----"; 712 | PRODUCT_NAME = "$(TARGET_NAME)"; 713 | PROVISIONING_PROFILE_SPECIFIER = ""; 714 | TARGETED_DEVICE_FAMILY = "1,2"; 715 | }; 716 | name = Debug; 717 | }; 718 | 5C969D8920187E47004BBEB8 /* Release */ = { 719 | isa = XCBuildConfiguration; 720 | baseConfigurationReference = 3EC413F5379EDF00274AAB0C /* Pods-6个六斋.release.xcconfig */; 721 | buildSettings = { 722 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 723 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 724 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 725 | CODE_SIGN_STYLE = Automatic; 726 | DEVELOPMENT_TEAM = Z7GR6ZAZKT; 727 | GCC_PREFIX_HEADER = "$(SRCROOT)/6个六斋/PrefixHeader.pch"; 728 | INFOPLIST_FILE = "6个六斋/Info.plist"; 729 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 730 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 731 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----"; 732 | PRODUCT_NAME = "$(TARGET_NAME)"; 733 | PROVISIONING_PROFILE_SPECIFIER = ""; 734 | TARGETED_DEVICE_FAMILY = "1,2"; 735 | }; 736 | name = Release; 737 | }; 738 | 5C969D8B20187E47004BBEB8 /* Debug */ = { 739 | isa = XCBuildConfiguration; 740 | buildSettings = { 741 | BUNDLE_LOADER = "$(TEST_HOST)"; 742 | CODE_SIGN_STYLE = Automatic; 743 | INFOPLIST_FILE = "6个六斋Tests/Info.plist"; 744 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 745 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----Tests"; 746 | PRODUCT_NAME = "$(TARGET_NAME)"; 747 | TARGETED_DEVICE_FAMILY = "1,2"; 748 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/6个六斋.app/6个六斋"; 749 | }; 750 | name = Debug; 751 | }; 752 | 5C969D8C20187E47004BBEB8 /* Release */ = { 753 | isa = XCBuildConfiguration; 754 | buildSettings = { 755 | BUNDLE_LOADER = "$(TEST_HOST)"; 756 | CODE_SIGN_STYLE = Automatic; 757 | INFOPLIST_FILE = "6个六斋Tests/Info.plist"; 758 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 759 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----Tests"; 760 | PRODUCT_NAME = "$(TARGET_NAME)"; 761 | TARGETED_DEVICE_FAMILY = "1,2"; 762 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/6个六斋.app/6个六斋"; 763 | }; 764 | name = Release; 765 | }; 766 | 5C969D8E20187E47004BBEB8 /* Debug */ = { 767 | isa = XCBuildConfiguration; 768 | buildSettings = { 769 | CODE_SIGN_STYLE = Automatic; 770 | INFOPLIST_FILE = "6个六斋UITests/Info.plist"; 771 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 772 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----UITests"; 773 | PRODUCT_NAME = "$(TARGET_NAME)"; 774 | TARGETED_DEVICE_FAMILY = "1,2"; 775 | TEST_TARGET_NAME = "6个六斋"; 776 | }; 777 | name = Debug; 778 | }; 779 | 5C969D8F20187E47004BBEB8 /* Release */ = { 780 | isa = XCBuildConfiguration; 781 | buildSettings = { 782 | CODE_SIGN_STYLE = Automatic; 783 | INFOPLIST_FILE = "6个六斋UITests/Info.plist"; 784 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 785 | PRODUCT_BUNDLE_IDENTIFIER = "GD-Bee.----UITests"; 786 | PRODUCT_NAME = "$(TARGET_NAME)"; 787 | TARGETED_DEVICE_FAMILY = "1,2"; 788 | TEST_TARGET_NAME = "6个六斋"; 789 | }; 790 | name = Release; 791 | }; 792 | /* End XCBuildConfiguration section */ 793 | 794 | /* Begin XCConfigurationList section */ 795 | 5C969D5620187E46004BBEB8 /* Build configuration list for PBXProject "6个六斋" */ = { 796 | isa = XCConfigurationList; 797 | buildConfigurations = ( 798 | 5C969D8520187E47004BBEB8 /* Debug */, 799 | 5C969D8620187E47004BBEB8 /* Release */, 800 | ); 801 | defaultConfigurationIsVisible = 0; 802 | defaultConfigurationName = Release; 803 | }; 804 | 5C969D8720187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋" */ = { 805 | isa = XCConfigurationList; 806 | buildConfigurations = ( 807 | 5C969D8820187E47004BBEB8 /* Debug */, 808 | 5C969D8920187E47004BBEB8 /* Release */, 809 | ); 810 | defaultConfigurationIsVisible = 0; 811 | defaultConfigurationName = Release; 812 | }; 813 | 5C969D8A20187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋Tests" */ = { 814 | isa = XCConfigurationList; 815 | buildConfigurations = ( 816 | 5C969D8B20187E47004BBEB8 /* Debug */, 817 | 5C969D8C20187E47004BBEB8 /* Release */, 818 | ); 819 | defaultConfigurationIsVisible = 0; 820 | defaultConfigurationName = Release; 821 | }; 822 | 5C969D8D20187E47004BBEB8 /* Build configuration list for PBXNativeTarget "6个六斋UITests" */ = { 823 | isa = XCConfigurationList; 824 | buildConfigurations = ( 825 | 5C969D8E20187E47004BBEB8 /* Debug */, 826 | 5C969D8F20187E47004BBEB8 /* Release */, 827 | ); 828 | defaultConfigurationIsVisible = 0; 829 | defaultConfigurationName = Release; 830 | }; 831 | /* End XCConfigurationList section */ 832 | }; 833 | rootObject = 5C969D5320187E46004BBEB8 /* Project object */; 834 | } 835 | -------------------------------------------------------------------------------- /6个六斋.xcodeproj/xcuserdata/ji_yufeng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | 6个六斋.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /6个六斋/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /6个六斋/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "BeeHomeViewController.h" 11 | #import "BeeBragViewController.h" 12 | #import 13 | 14 | @interface AppDelegate () 15 | 16 | @property (nonatomic , strong) AVAudioPlayer *player; 17 | 18 | @end 19 | 20 | @implementation AppDelegate 21 | 22 | 23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 24 | // Override point for customization after application launch. 25 | 26 | if ([[USER_DEFAULT objectForKey:IFTHEFIRST] intValue] == 0) { 27 | [USER_DEFAULT setObject:[NSNumber numberWithInt:1] forKey:IFTHEFIRST]; 28 | [self playMusic]; 29 | } 30 | 31 | self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:[[BeeHomeViewController alloc]init]]; 32 | self.window.backgroundColor = [UIColor whiteColor]; 33 | 34 | [NSThread sleepForTimeInterval:2]; 35 | 36 | return YES; 37 | } 38 | 39 | - (void)playMusic 40 | { 41 | NSURL *url = [[NSBundle mainBundle] URLForResource:@"dushen" withExtension:@"mp3"]; 42 | self.player = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; 43 | self.player.delegate = self; 44 | [self.player play]; 45 | [self performSelector:@selector(stopPlayMusic) withObject:nil afterDelay:12]; 46 | } 47 | 48 | - (void)stopPlayMusic 49 | { 50 | [self.player stop]; 51 | } 52 | 53 | 54 | 55 | - (void)applicationWillResignActive:(UIApplication *)application { 56 | // 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. 57 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 58 | } 59 | 60 | 61 | - (void)applicationDidEnterBackground:(UIApplication *)application { 62 | // 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. 63 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 64 | } 65 | 66 | 67 | - (void)applicationWillEnterForeground:(UIApplication *)application { 68 | // 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. 69 | } 70 | 71 | 72 | - (void)applicationDidBecomeActive:(UIApplication *)application { 73 | // 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. 74 | } 75 | 76 | 77 | - (void)applicationWillTerminate:(UIApplication *)application { 78 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 79 | } 80 | 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/6ge6text.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "fb286d16509a4564924ce3c8935ba0f6.PNG", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/6ge6text.imageset/fb286d16509a4564924ce3c8935ba0f6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/6ge6text.imageset/fb286d16509a4564924ce3c8935ba0f6.PNG -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "touzi-8.jpg", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "touzi-6.jpg", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "touzi-7.jpg", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "touzi-5.jpg", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "touzi-4.jpg", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "touzi-3.jpg", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "touzi-2.jpg", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "touzi-1.jpg", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "touzi.jpg", 55 | "scale" : "1x" 56 | } 57 | ], 58 | "info" : { 59 | "version" : 1, 60 | "author" : "xcode" 61 | } 62 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-1.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-2.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-3.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-4.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-5.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-6.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-7.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi-8.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/AppIcon.appiconset/touzi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/AppIcon.appiconset/touzi.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "2436h", 7 | "filename" : "Default-812h@3x.jpeg", 8 | "minimum-system-version" : "11.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本.jpg", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本 2.jpg", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本 2-1.jpg", 34 | "extent" : "full-screen", 35 | "minimum-system-version" : "7.0", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本-1.jpg", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "iphone", 50 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本-2.jpg", 51 | "extent" : "full-screen", 52 | "scale" : "1x" 53 | }, 54 | { 55 | "orientation" : "portrait", 56 | "idiom" : "iphone", 57 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本 2-2.jpg", 58 | "extent" : "full-screen", 59 | "scale" : "2x" 60 | }, 61 | { 62 | "orientation" : "portrait", 63 | "idiom" : "iphone", 64 | "filename" : "u=495286300,3198387558&fm=27&gp=0的副本-3.jpg", 65 | "extent" : "full-screen", 66 | "subtype" : "retina4", 67 | "scale" : "2x" 68 | } 69 | ], 70 | "info" : { 71 | "version" : 1, 72 | "author" : "xcode" 73 | } 74 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/Default-812h@3x.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/Default-812h@3x.jpeg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2-1.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2-2.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本 2.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-1.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-2.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本-3.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/LaunchImage.launchimage/u=495286300,3198387558&fm=27&gp=0的副本.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/apple.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "apple.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/apple.imageset/apple.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/apple.imageset/apple.jpeg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "back-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/back.imageset/back-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/back.imageset/back-1.png -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/bi.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "yao.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/bi.imageset/yao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/bi.imageset/yao.png -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/five.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "five.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/five.imageset/five.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/five.imageset/five.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/four.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "four.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/four.imageset/four.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/four.imageset/four.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/one.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "one.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/one.imageset/one.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/one.imageset/one.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/puke.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "puke.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/puke.imageset/puke.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/puke.imageset/puke.jpeg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/six.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "six.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/six.imageset/six.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/six.imageset/six.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/suo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "suo 2.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/suo.imageset/suo 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/suo.imageset/suo 2.png -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "text1.PNG", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text1.imageset/text1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/text1.imageset/text1.PNG -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "text2.PNG", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text2.imageset/text2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/text2.imageset/text2.PNG -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "text3.PNG", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/text3.imageset/text3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/text3.imageset/text3.PNG -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/three.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "three.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/three.imageset/three.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/three.imageset/three.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/two.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "two.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/two.imageset/two.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/two.imageset/two.jpg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/tz.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tz.jpeg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/tz.imageset/tz.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/tz.imageset/tz.jpeg -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "yao.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yao.imageset/yao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/yao.imageset/yao.png -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yaoyiyao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "yaoyiyao.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yaoyiyao.imageset/yaoyiyao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/yaoyiyao.imageset/yaoyiyao.png -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yuan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "yuan.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /6个六斋/Assets.xcassets/yuan.imageset/yuan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/Assets.xcassets/yuan.imageset/yuan.png -------------------------------------------------------------------------------- /6个六斋/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 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /6个六斋/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 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /6个六斋/BeeHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeHomeViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeHomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/BeeHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeHomeViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeHomeViewController.h" 10 | #import "BeeBragViewController.h" 11 | #import "BeeOneDiceViewController.h" 12 | #import "BeeThreeDiceViewController.h" 13 | 14 | 15 | @interface BeeHomeViewController () 16 | 17 | @property (nonatomic,strong)UIImageView *titleImg; 18 | @property (nonatomic,strong)UIImageView *tzImg; 19 | @property (nonatomic,strong)UIImageView *textImg1; 20 | @property (nonatomic,strong)UIImageView *textImg2; 21 | @property (nonatomic,strong)UIImageView *textImg3; 22 | 23 | @end 24 | 25 | @implementation BeeHomeViewController 26 | 27 | - (UIImageView *)textImg1 28 | { 29 | if (!_textImg1) { 30 | _textImg1 = [[UIImageView alloc]init]; 31 | [_textImg1 setImage:[UIImage imageNamed:@"text1"]]; 32 | WS(weakSelf); 33 | [_textImg1 whenTapped:^{ 34 | BeeOneDiceViewController *vc = [[BeeOneDiceViewController alloc]init]; 35 | [weakSelf.navigationController pushViewController:vc animated:YES]; 36 | }]; 37 | } 38 | return _textImg1; 39 | } 40 | 41 | - (UIImageView *)textImg2 42 | { 43 | if (!_textImg2) { 44 | _textImg2 = [[UIImageView alloc]init]; 45 | [_textImg2 setImage:[UIImage imageNamed:@"text2"]]; 46 | WS(weakSelf); 47 | [_textImg2 whenTapped:^{ 48 | BeeThreeDiceViewController *vc = [[BeeThreeDiceViewController alloc]init]; 49 | [weakSelf.navigationController pushViewController:vc animated:YES]; 50 | }]; 51 | 52 | } 53 | return _textImg2; 54 | } 55 | 56 | - (UIImageView *)textImg3 57 | { 58 | if (!_textImg3) { 59 | _textImg3 = [[UIImageView alloc]init]; 60 | [_textImg3 setImage:[UIImage imageNamed:@"text3"]]; 61 | WS(weakSelf); 62 | [_textImg3 whenTapped:^{ 63 | BeeBragViewController *vc = [[BeeBragViewController alloc]init]; 64 | [weakSelf.navigationController pushViewController:vc animated:YES]; 65 | }]; 66 | } 67 | return _textImg3; 68 | } 69 | 70 | 71 | - (UIImageView *)tzImg 72 | { 73 | if (!_tzImg) { 74 | _tzImg = [[UIImageView alloc]init]; 75 | [_tzImg setImage:[UIImage imageNamed:@"tz"]]; 76 | } 77 | return _tzImg; 78 | } 79 | 80 | - (UIImageView *)titleImg 81 | { 82 | if (!_titleImg) { 83 | _titleImg = [[UIImageView alloc]init]; 84 | [_titleImg setImage:[UIImage imageNamed:@"6ge6text"]]; 85 | } 86 | return _titleImg; 87 | } 88 | 89 | - (void)viewWillAppear:(BOOL)animated 90 | { 91 | [super viewWillAppear:animated]; 92 | self.navigationController.navigationBarHidden = YES; 93 | } 94 | 95 | - (void)viewDidLoad { 96 | [super viewDidLoad]; 97 | // Do any additional setup after loading the view. 98 | 99 | 100 | self.view.backgroundColor = [UIColor whiteColor]; 101 | 102 | [self.view addSubview:self.titleImg]; 103 | [self.titleImg mas_makeConstraints:^(MASConstraintMaker *make) { 104 | make.centerX.mas_equalTo(0); 105 | make.top.mas_equalTo(BeeStatusHeight+10); 106 | make.height.mas_equalTo(38); 107 | make.width.mas_equalTo(180); 108 | }]; 109 | 110 | [self.view addSubview:self.tzImg]; 111 | [self.tzImg mas_makeConstraints:^(MASConstraintMaker *make) { 112 | make.right.mas_equalTo(-5); 113 | make.width.mas_equalTo(150); 114 | make.height.mas_equalTo(85); 115 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-5); 116 | }]; 117 | 118 | [self.view addSubview:self.textImg1]; 119 | [self.textImg1 mas_makeConstraints:^(MASConstraintMaker *make) { 120 | make.left.mas_equalTo(30); 121 | make.top.mas_equalTo(self.titleImg.mas_bottom).offset(50); 122 | make.height.mas_equalTo(60); 123 | make.width.mas_equalTo(135); 124 | }]; 125 | 126 | [self.view addSubview:self.textImg2]; 127 | [self.textImg2 mas_makeConstraints:^(MASConstraintMaker *make) { 128 | make.left.mas_equalTo(30); 129 | make.top.mas_equalTo(self.textImg1.mas_bottom).offset(10); 130 | make.height.mas_equalTo(60); 131 | make.width.mas_equalTo(250); 132 | }]; 133 | 134 | [self.view addSubview:self.textImg3]; 135 | [self.textImg3 mas_makeConstraints:^(MASConstraintMaker *make) { 136 | make.left.mas_equalTo(30); 137 | make.top.mas_equalTo(self.textImg2.mas_bottom).offset(10); 138 | make.height.mas_equalTo(60); 139 | make.width.mas_equalTo(231); 140 | }]; 141 | 142 | 143 | 144 | 145 | } 146 | 147 | 148 | 149 | 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /6个六斋/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | 六个六斋 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIBackgroundModes 26 | 27 | audio 28 | 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewEdgeAntialiasing 47 | 48 | UIViewGroupOpacity 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /6个六斋/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | 16 | #import 17 | #import 18 | #import "UIView+WhenTappedBlocks.h" 19 | 20 | #if __has_feature(objc_arc) 21 | #define WS(weakSelf) __weak __typeof(&*self)weakSelf = self; 22 | #else 23 | #define WS(weakSelf) __block __typeof(&*self)weakSelf = self; 24 | #endif 25 | 26 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height 27 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 28 | #define USER_DEFAULT [NSUserDefaults standardUserDefaults] 29 | #define BeeAppWindow [UIApplication sharedApplication].delegate.window 30 | #define BeeAppDelegate [AppDelegate shareAppDelegate] 31 | #define BeeNavigationHeight ([UIApplication sharedApplication].statusBarFrame.size.height+44) 32 | #define BeeStatusHeight [UIApplication sharedApplication].statusBarFrame.size.height 33 | #define BeeSafeAreaInsets(view) ({UIEdgeInsets insets; if(@available(iOS 11.0, *)) {insets = view.safeAreaInsets;} else {insets = UIEdgeInsetsZero;} insets;}) 34 | 35 | // 字体 36 | #define SYSTEMFONT(FONTSIZE) [UIFont systemFontOfSize:FONTSIZE] 37 | 38 | 39 | // key 40 | #define IFTHEFIRST @"IFTHEFIRST" 41 | #define OneOfShake @"OneOfShake" 42 | #define ThreeOfShake @"ThreeOfShake" 43 | #define FiveOfShake @"FiveOfShake" 44 | 45 | 46 | #ifdef DEBUG 47 | #define BeeNSLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] ) 48 | #else 49 | #define BeeNSLog(format, ...) 50 | #endif 51 | 52 | 53 | #endif /* PrefixHeader_pch */ 54 | -------------------------------------------------------------------------------- /6个六斋/View/BeeDiceView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeDiceView.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeDiceView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/View/BeeDiceView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeDiceView.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeDiceView.h" 10 | 11 | @interface BeeDiceView () 12 | 13 | @property (nonatomic,strong)UIView *view1; 14 | @property (nonatomic,strong)UIView *view2; 15 | @property (nonatomic,strong)UIView *view3; 16 | @property (nonatomic,strong)UIView *view4; 17 | @property (nonatomic,strong)UIView *view5; 18 | @property (nonatomic,strong)UIView *view6; 19 | 20 | @end 21 | 22 | @implementation BeeDiceView 23 | 24 | - (UIView *)view1 25 | { 26 | if (!_view1) { 27 | _view1 = [[UIView alloc]init]; 28 | // _view1.backgroundColor = [UIColor blackColor]; 29 | 30 | UIImageView *img = [[UIImageView alloc]init]; 31 | [img setImage:[UIImage imageNamed:@"one"]]; 32 | img.layer.allowsEdgeAntialiasing = true; 33 | [_view1 addSubview:img]; 34 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 35 | make.top.left.mas_equalTo(0.3); 36 | make.bottom.right.mas_equalTo(-0.3); 37 | }]; 38 | 39 | _view1.layer.borderWidth = 1; 40 | _view1.layer.borderColor = [UIColor lightGrayColor].CGColor; 41 | _view1.layer.cornerRadius = 3; 42 | 43 | } 44 | 45 | return _view1; 46 | 47 | } 48 | 49 | - (UIView *)view2 50 | { 51 | if (!_view2) { 52 | _view2 = [[UIView alloc]init]; 53 | // _view2.backgroundColor = [UIColor blackColor]; 54 | 55 | UIImageView *img = [[UIImageView alloc]init]; 56 | [img setImage:[UIImage imageNamed:@"two"]]; 57 | [_view2 addSubview:img]; 58 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 59 | make.top.left.mas_equalTo(0.3); 60 | make.bottom.right.mas_equalTo(-0.3); 61 | 62 | }]; 63 | 64 | _view2.layer.borderWidth = 1; 65 | _view2.layer.borderColor = [UIColor lightGrayColor].CGColor; 66 | _view2.layer.cornerRadius = 3; 67 | 68 | 69 | } 70 | return _view2; 71 | } 72 | 73 | - (UIView *)view3 74 | { 75 | if (!_view3) { 76 | _view3 = [[UIView alloc]init]; 77 | // _view3.backgroundColor = [UIColor blackColor]; 78 | 79 | UIImageView *img = [[UIImageView alloc]init]; 80 | [img setImage:[UIImage imageNamed:@"five"]]; 81 | [_view3 addSubview:img]; 82 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 83 | make.top.left.mas_equalTo(0.3); 84 | make.bottom.right.mas_equalTo(-0.3); 85 | }]; 86 | 87 | _view3.layer.borderWidth = 1; 88 | _view3.layer.borderColor = [UIColor lightGrayColor].CGColor; 89 | _view3.layer.cornerRadius = 3; 90 | 91 | 92 | } 93 | return _view3; 94 | } 95 | 96 | - (UIView *)view4 97 | { 98 | if (!_view4) { 99 | _view4 = [[UIView alloc]init]; 100 | // _view4.backgroundColor = [UIColor blackColor]; 101 | UIImageView *img = [[UIImageView alloc]init]; 102 | [img setImage:[UIImage imageNamed:@"four"]]; 103 | [_view4 addSubview:img]; 104 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 105 | make.top.left.mas_equalTo(0.3); 106 | make.bottom.right.mas_equalTo(-0.3); 107 | }]; 108 | 109 | _view4.layer.borderWidth = 1; 110 | _view4.layer.borderColor = [UIColor lightGrayColor].CGColor; 111 | _view4.layer.cornerRadius = 3; 112 | 113 | } 114 | return _view4; 115 | } 116 | 117 | - (UIView *)view5 118 | { 119 | if (!_view5) { 120 | _view5 = [[UIView alloc]init]; 121 | _view5.backgroundColor = [UIColor blackColor]; 122 | UIImageView *img = [[UIImageView alloc]init]; 123 | [img setImage:[UIImage imageNamed:@"three"]]; 124 | [_view5 addSubview:img]; 125 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 126 | make.top.left.mas_equalTo(0.3); 127 | make.bottom.right.mas_equalTo(-0.3); 128 | }]; 129 | 130 | _view5.layer.borderWidth = 1; 131 | _view5.layer.borderColor = [UIColor lightGrayColor].CGColor; 132 | _view5.layer.cornerRadius = 3; 133 | 134 | } 135 | return _view5; 136 | } 137 | 138 | - (UIView *)view6 139 | { 140 | if (!_view6) { 141 | _view6 = [[UIView alloc]init]; 142 | // _view6.backgroundColor = [UIColor blackColor]; 143 | UIImageView *img = [[UIImageView alloc]init]; 144 | [img setImage:[UIImage imageNamed:@"six"]]; 145 | [_view6 addSubview:img]; 146 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 147 | make.top.left.mas_equalTo(0.3); 148 | make.bottom.right.mas_equalTo(-0.3); 149 | }]; 150 | 151 | _view6.layer.borderWidth = 1; 152 | _view6.layer.borderColor = [UIColor lightGrayColor].CGColor; 153 | _view6.layer.cornerRadius = 3; 154 | 155 | } 156 | return _view6; 157 | } 158 | 159 | 160 | - (id)initWithFrame:(CGRect)frame 161 | { 162 | if (self = [super initWithFrame:frame]) { 163 | 164 | CATransform3D perspective = CATransform3DIdentity; 165 | perspective.m34 = -1.0/500.0; 166 | self.layer.sublayerTransform = perspective; 167 | 168 | CGFloat theWidth = 50; 169 | 170 | [self addSubview:self.view1]; 171 | [self.view1 mas_makeConstraints:^(MASConstraintMaker *make) { 172 | make.left.right.top.bottom.mas_equalTo(0); 173 | }]; 174 | 175 | [self addSubview:self.view2]; 176 | [self.view2 mas_makeConstraints:^(MASConstraintMaker *make) { 177 | make.left.right.top.bottom.mas_equalTo(0); 178 | }]; 179 | CATransform3D view2Trans = CATransform3DIdentity; 180 | view2Trans = CATransform3DRotate(view2Trans, M_PI_2, 0, 1, 0); 181 | view2Trans = CATransform3DTranslate(view2Trans, theWidth/2, 0, -theWidth/2); 182 | self.view2.layer.transform = view2Trans; 183 | 184 | [self addSubview:self.view3]; 185 | [self.view3 mas_makeConstraints:^(MASConstraintMaker *make) { 186 | make.left.right.top.bottom.mas_equalTo(0); 187 | }]; 188 | CATransform3D view3Trans = CATransform3DIdentity; 189 | view3Trans = CATransform3DRotate(view3Trans, M_PI_2, 0, 1, 0); 190 | view3Trans = CATransform3DTranslate(view3Trans, theWidth/2, 0, theWidth/2); 191 | self.view3.layer.transform = view3Trans; 192 | 193 | [self addSubview:self.view4]; 194 | [self.view4 mas_makeConstraints:^(MASConstraintMaker *make) { 195 | make.left.right.top.bottom.mas_equalTo(0); 196 | }]; 197 | CATransform3D view4Trans = CATransform3DIdentity; 198 | view4Trans = CATransform3DRotate(view4Trans, M_PI_2, 1, 0, 0); 199 | view4Trans = CATransform3DTranslate(view4Trans, 0, -theWidth/2, theWidth/2); 200 | self.view4.layer.transform = view4Trans; 201 | 202 | [self addSubview:self.view5]; 203 | [self.view5 mas_makeConstraints:^(MASConstraintMaker *make) { 204 | make.left.right.top.bottom.mas_equalTo(0); 205 | }]; 206 | CATransform3D view5Trans = CATransform3DIdentity; 207 | view5Trans = CATransform3DRotate(view5Trans, M_PI_2*3, 1, 0, 0); 208 | view5Trans = CATransform3DTranslate(view5Trans, 0, theWidth/2, theWidth/2); 209 | self.view5.layer.transform = view5Trans; 210 | 211 | [self addSubview:self.view6]; 212 | [self.view6 mas_makeConstraints:^(MASConstraintMaker *make) { 213 | make.left.right.top.bottom.mas_equalTo(0); 214 | }]; 215 | CATransform3D view6Trans = CATransform3DIdentity; 216 | view6Trans = CATransform3DRotate(view6Trans, M_PI, 0, 1, 0); 217 | view6Trans = CATransform3DTranslate(view6Trans, 0, 0, theWidth); 218 | self.view6.layer.transform = view6Trans; 219 | 220 | 221 | self.layer.allowsEdgeAntialiasing = YES; 222 | 223 | } 224 | return self; 225 | } 226 | 227 | 228 | 229 | @end 230 | -------------------------------------------------------------------------------- /6个六斋/dushen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/dushen.mp3 -------------------------------------------------------------------------------- /6个六斋/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/24. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /6个六斋/yaoshaizi.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/yaoshaizi.mp3 -------------------------------------------------------------------------------- /6个六斋/zuobisound.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/6个六斋/zuobisound.m4a -------------------------------------------------------------------------------- /6个六斋/单骰摇晃/Controller/BeeOneDiceViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeOneDiceViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeOneDiceViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/单骰摇晃/Controller/BeeOneDiceViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeOneDiceViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeOneDiceViewController.h" 10 | #import "BeeDiceView.h" 11 | #import 12 | #import "BeeOneExplainViewController.h" 13 | 14 | @interface BeeOneDiceViewController () 15 | 16 | @property (nonatomic,strong) BeeDiceView *diceView; 17 | @property (nonatomic,strong)NSTimer *timer; 18 | @property (nonatomic,strong)NSTimer *timer2; 19 | @property (nonatomic,assign)float theNum; 20 | @property (nonatomic,assign)float Num1; 21 | @property (nonatomic,assign)int thetag; 22 | @property (nonatomic,assign)int roundPoint; 23 | @property (nonatomic,assign)int onPoint; 24 | @property (nonatomic,strong)UIImageView *yaoImg; 25 | @property (nonatomic,strong)UIImageView *canShakeImg; 26 | @property (nonatomic,strong)UISwitch *shakeSwitch; 27 | @property (nonatomic , strong) AVAudioPlayer *player; 28 | 29 | @end 30 | 31 | @implementation BeeOneDiceViewController 32 | 33 | - (AVAudioPlayer *)player 34 | { 35 | if (!_player) { 36 | NSURL *url = [[NSBundle mainBundle] URLForResource:@"yaoshaizi" withExtension:@"mp3"]; 37 | _player = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; 38 | _player.delegate = self; 39 | } 40 | return _player; 41 | } 42 | 43 | - (UISwitch *)shakeSwitch 44 | { 45 | if (!_shakeSwitch) { 46 | _shakeSwitch = [[UISwitch alloc]init]; 47 | if ([[USER_DEFAULT objectForKey:OneOfShake]intValue] == 0) { 48 | [_shakeSwitch setOn:YES]; 49 | }else{ 50 | [_shakeSwitch setOn:NO]; 51 | } 52 | [_shakeSwitch addTarget:self action:@selector(switchAction) forControlEvents:UIControlEventValueChanged]; 53 | } 54 | return _shakeSwitch; 55 | } 56 | 57 | - (UIImageView *)canShakeImg 58 | { 59 | if (!_canShakeImg) { 60 | _canShakeImg = [[UIImageView alloc]init]; 61 | [_canShakeImg setImage:[UIImage imageNamed:@"yaoyiyao"]]; 62 | } 63 | return _canShakeImg; 64 | } 65 | 66 | - (UIImageView *)yaoImg 67 | { 68 | if (!_yaoImg) { 69 | _yaoImg = [[UIImageView alloc]init]; 70 | [_yaoImg setImage:[UIImage imageNamed:@"yao"]]; 71 | WS(weakSelf); 72 | [_yaoImg whenTapped:^{ 73 | [weakSelf shakingAction]; 74 | 75 | }]; 76 | } 77 | return _yaoImg; 78 | } 79 | 80 | - (BeeDiceView *)diceView 81 | { 82 | if (!_diceView) { 83 | _diceView = [[BeeDiceView alloc]init]; 84 | } 85 | return _diceView; 86 | } 87 | 88 | - (void)viewWillAppear:(BOOL)animated 89 | { 90 | [super viewWillAppear:animated]; 91 | self.navigationController.navigationBarHidden = NO; 92 | 93 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 94 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 95 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 96 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 97 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 98 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 99 | 100 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 101 | self.navigationItem.leftBarButtonItem = leftItem; 102 | 103 | UIButton *rightBtn = [[UIButton alloc]init]; 104 | rightBtn.frame = CGRectMake(0, 0, 70, 64); 105 | rightBtn.titleLabel.font = SYSTEMFONT(15); 106 | rightBtn.titleLabel.textAlignment = NSTextAlignmentRight; 107 | [rightBtn setTitleColor:[UIColor blackColor] forState:0]; 108 | [rightBtn setTitle:@"操作说明" forState:0]; 109 | [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; 110 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn]; 111 | self.navigationItem.rightBarButtonItem = rightItem; 112 | 113 | 114 | } 115 | 116 | - (void)leftButtonAction 117 | { 118 | [self.navigationController popViewControllerAnimated:YES]; 119 | } 120 | 121 | - (void)rightBtnAction 122 | { 123 | BeeOneExplainViewController *vc = [[BeeOneExplainViewController alloc]init]; 124 | [self.navigationController pushViewController:vc animated:YES]; 125 | } 126 | 127 | 128 | 129 | - (void)viewDidLoad { 130 | [super viewDidLoad]; 131 | // Do any additional setup after loading the view. 132 | 133 | self.title = @"单骰摇晃"; 134 | self.view.backgroundColor = [UIColor whiteColor]; 135 | 136 | [self.view addSubview:self.diceView]; 137 | [self.diceView mas_makeConstraints:^(MASConstraintMaker *make) { 138 | make.centerX.mas_equalTo(0); 139 | make.centerY.mas_equalTo(0); 140 | make.height.width.mas_equalTo(50); 141 | 142 | }]; 143 | 144 | [self.view addSubview:self.yaoImg]; 145 | [self.yaoImg mas_makeConstraints:^(MASConstraintMaker *make) { 146 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 147 | make.centerX.mas_equalTo(0); 148 | make.height.width.mas_equalTo(70); 149 | }]; 150 | 151 | [self.view addSubview:self.canShakeImg]; 152 | [self.canShakeImg mas_makeConstraints:^(MASConstraintMaker *make) { 153 | make.height.width.mas_equalTo(60); 154 | make.right.mas_equalTo(-15); 155 | make.top.mas_equalTo(BeeNavigationHeight + 10); 156 | }]; 157 | 158 | [self.view addSubview:self.shakeSwitch]; 159 | [self.shakeSwitch mas_makeConstraints:^(MASConstraintMaker *make) { 160 | make.top.mas_equalTo(self.canShakeImg.mas_bottom).offset(5); 161 | make.centerX.mas_equalTo(self.canShakeImg); 162 | }]; 163 | 164 | 165 | CATransform3D perspective1 = CATransform3DIdentity; 166 | perspective1.m34 = -1/500; 167 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4 + M_PI_2, 1, 0, 0); 168 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4, 0, 0, 1); 169 | perspective1 = CATransform3DTranslate(perspective1, 0, 0, 25); 170 | self.diceView.layer.sublayerTransform = perspective1; 171 | 172 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerAction) userInfo:nil repeats:YES]; 173 | [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode]; 174 | [self.timer setFireDate:[NSDate distantFuture]]; 175 | 176 | self.timer2 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer2Action) userInfo:nil repeats:YES]; 177 | [[NSRunLoop mainRunLoop] addTimer:self.timer2 forMode:NSDefaultRunLoopMode]; 178 | [self.timer2 setFireDate:[NSDate distantFuture]]; 179 | 180 | 181 | } 182 | 183 | - (void)shakingAction 184 | { 185 | if (self.thetag == 0) { 186 | [self.player stop]; 187 | [self.player play]; 188 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 189 | self.thetag = 1; 190 | self.Num1 = M_PI_4; // 控制之后timer2的时间动画长短 191 | [self.timer setFireDate:[NSDate distantFuture]]; 192 | [self.timer setFireDate:[NSDate distantPast]]; 193 | [self performSelector:@selector(toEndTheShaking) withObject:nil afterDelay:2]; 194 | } 195 | } 196 | 197 | - (void)timerAction 198 | { 199 | 200 | self.theNum += 0.35; 201 | 202 | CATransform3D perspective = CATransform3DIdentity; 203 | perspective.m34 = -1.0/500.0; 204 | 205 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 206 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 207 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 208 | 209 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 210 | self.diceView.layer.sublayerTransform = perspective; 211 | 212 | } 213 | 214 | - (void)toEndTheShaking 215 | { 216 | self.theNum = 0; 217 | [self.timer setFireDate:[NSDate distantFuture]]; 218 | [self.timer2 setFireDate:[NSDate distantPast]]; 219 | self.roundPoint = (arc4random() % 4); 220 | self.onPoint = (arc4random() % 6); 221 | } 222 | 223 | - (void)timer2Action 224 | { 225 | self.Num1 = self.Num1 - 0.025; 226 | if (self.Num1 > 0) { 227 | CATransform3D perspective = CATransform3DIdentity; 228 | perspective.m34 = -1.0/500.0; 229 | switch (self.onPoint) { 230 | case 0: 231 | { 232 | // 1 的情况 233 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 - self.Num1, 1, 0, 0); 234 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 235 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.roundPoint -self.Num1, 0, 0, 1); 236 | } 237 | break; 238 | case 1: 239 | { 240 | // 2 的情况 241 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 242 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.roundPoint - self.Num1, 0, 1, 0); 243 | perspective = CATransform3DRotate(perspective, M_PI_2 - self.Num1, 0, 0, 1); 244 | 245 | } 246 | break; 247 | case 2: 248 | { 249 | // 3 的情况 250 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * 2 - self.Num1, 1, 0, 0); 251 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.roundPoint, 0, 1, 0); 252 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 253 | 254 | } 255 | break; 256 | case 3: 257 | { 258 | // 4 的情况 259 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 260 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.roundPoint, 0, 1, 0); 261 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 262 | 263 | } 264 | break; 265 | case 4: 266 | { 267 | // 5 的情况 268 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 269 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.roundPoint - self.Num1, 0, 1, 0); 270 | perspective = CATransform3DRotate(perspective, -M_PI_2 - self.Num1, 0, 0, 1); 271 | 272 | } 273 | break; 274 | case 5: 275 | { 276 | // 6 的情况 277 | perspective = CATransform3DRotate(perspective, -M_PI_4 - M_PI_2 - self.Num1, 1, 0, 0); 278 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 279 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.roundPoint -self.Num1, 0, 0, 1); 280 | } 281 | break; 282 | 283 | default: 284 | break; 285 | } 286 | 287 | perspective = CATransform3DTranslate(perspective, 0, 0, 25 ); 288 | self.diceView.layer.sublayerTransform = perspective; 289 | 290 | }else{ 291 | [self.timer2 setFireDate:[NSDate distantFuture]]; 292 | self.thetag = 0; 293 | } 294 | 295 | 296 | } 297 | 298 | #pragma mark - 摇一摇 299 | - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { 300 | if (!(motion == UIEventSubtypeMotionShake)) { 301 | return; 302 | } 303 | if (self.thetag == 0 && [self.shakeSwitch isOn] == YES) { 304 | [self shakingAction]; 305 | } 306 | 307 | return; 308 | } 309 | 310 | - (void)switchAction 311 | { 312 | if ([self.shakeSwitch isOn]) { 313 | [USER_DEFAULT setObject:[NSNumber numberWithInt:0] forKey:OneOfShake]; 314 | }else{ 315 | [USER_DEFAULT setObject:[NSNumber numberWithInt:1] forKey:OneOfShake]; 316 | } 317 | } 318 | 319 | 320 | 321 | @end 322 | -------------------------------------------------------------------------------- /6个六斋/单骰摇晃/Controller/BeeOneExplainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeOneExplainViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeOneExplainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/单骰摇晃/Controller/BeeOneExplainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeOneExplainViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeOneExplainViewController.h" 10 | 11 | @interface BeeOneExplainViewController () 12 | 13 | @property (nonatomic,strong)UILabel *contentLabel; 14 | 15 | @end 16 | 17 | @implementation BeeOneExplainViewController 18 | 19 | - (UILabel *)contentLabel 20 | { 21 | if (!_contentLabel) { 22 | _contentLabel = [[UILabel alloc]init]; 23 | _contentLabel.font = SYSTEMFONT(16); 24 | _contentLabel.textColor = [UIColor blackColor]; 25 | _contentLabel.text = @" 右上角开光控制手机是否可以进行摇晃操作; \n\n 点击下方\"摇\"按钮或者摇晃手机可达到投掷骰子的效果;"; 26 | _contentLabel.textAlignment = 0; 27 | _contentLabel.numberOfLines = 0; 28 | } 29 | return _contentLabel; 30 | } 31 | 32 | - (void)viewWillAppear:(BOOL)animated 33 | { 34 | [super viewWillAppear:animated]; 35 | self.navigationController.navigationBarHidden = NO; 36 | 37 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 39 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 40 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 41 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 42 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 43 | 44 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 45 | self.navigationItem.leftBarButtonItem = leftItem; 46 | 47 | } 48 | 49 | - (void)leftButtonAction 50 | { 51 | [self.navigationController popViewControllerAnimated:YES]; 52 | } 53 | 54 | - (void)viewDidLoad { 55 | [super viewDidLoad]; 56 | // Do any additional setup after loading the view. 57 | 58 | self.title = @"操作说明"; 59 | self.view.backgroundColor = [UIColor whiteColor]; 60 | 61 | [self.view addSubview:self.contentLabel]; 62 | [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { 63 | make.top.mas_equalTo(BeeNavigationHeight + 30); 64 | make.left.mas_equalTo(20); 65 | make.right.mas_equalTo(-20); 66 | }]; 67 | 68 | 69 | } 70 | 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /6个六斋/大话骰/Controller/BeeBragViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeBragViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/31. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeBragViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/大话骰/Controller/BeeBragViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeBragViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/31. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeBragViewController.h" 10 | #import "BeeBragContentView.h" 11 | #import 12 | #import "BeeFiveExplainViewController.h" 13 | 14 | @interface BeeBragViewController () 15 | 16 | @property (nonatomic,strong)BeeBragContentView *bragContentView; 17 | @property (nonatomic,strong)UIImageView *yaoImg; 18 | @property (nonatomic,strong)UIImageView *suoImg; 19 | @property (nonatomic,strong)UIImageView *biImg; 20 | @property (nonatomic,strong)UIVisualEffectView *maoboli; 21 | @property (nonatomic,assign)BOOL canShake; 22 | @property (nonatomic,retain)UIAlertController *alert; 23 | @property (nonatomic,retain)UIAlertController *alert2; 24 | @property (nonatomic,strong)UIImageView *canShakeImg; 25 | @property (nonatomic,strong)UISwitch *shakeSwitch; 26 | @property (nonatomic , strong)AVAudioPlayer *player; 27 | 28 | @end 29 | 30 | @implementation BeeBragViewController 31 | 32 | - (AVAudioPlayer *)player 33 | { 34 | if (!_player) { 35 | NSURL *url = [[NSBundle mainBundle] URLForResource:@"zuobisound" withExtension:@"m4a"]; 36 | _player = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; 37 | _player.delegate = self; 38 | } 39 | return _player; 40 | } 41 | 42 | - (UISwitch *)shakeSwitch 43 | { 44 | if (!_shakeSwitch) { 45 | _shakeSwitch = [[UISwitch alloc]init]; 46 | if ([[USER_DEFAULT objectForKey:FiveOfShake]intValue] == 0) { 47 | [_shakeSwitch setOn:YES]; 48 | }else{ 49 | [_shakeSwitch setOn:NO]; 50 | } 51 | [_shakeSwitch addTarget:self action:@selector(switchAction) forControlEvents:UIControlEventValueChanged]; 52 | } 53 | return _shakeSwitch; 54 | } 55 | 56 | - (UIImageView *)canShakeImg 57 | { 58 | if (!_canShakeImg) { 59 | _canShakeImg = [[UIImageView alloc]init]; 60 | [_canShakeImg setImage:[UIImage imageNamed:@"yaoyiyao"]]; 61 | } 62 | return _canShakeImg; 63 | } 64 | 65 | - (UIAlertController *)alert2 66 | { 67 | if (!_alert2) { 68 | WS(weakSelf); 69 | _alert2 = [UIAlertController alertControllerWithTitle:nil message:@"请选择你想要的点数" preferredStyle:UIAlertControllerStyleActionSheet]; 70 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 71 | [weakSelf xuanzedianshu:0]; 72 | }]]; 73 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"2" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 74 | [weakSelf xuanzedianshu:1]; 75 | }]]; 76 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"3" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 77 | [weakSelf xuanzedianshu:2]; 78 | }]]; 79 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"4" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 80 | [weakSelf xuanzedianshu:3]; 81 | }]]; 82 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"5" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 83 | [weakSelf xuanzedianshu:4]; 84 | }]]; 85 | [_alert2 addAction:[UIAlertAction actionWithTitle:@"6" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 86 | [weakSelf xuanzedianshu:5]; 87 | }]]; 88 | 89 | 90 | } 91 | return _alert2; 92 | } 93 | 94 | 95 | - (UIAlertController *)alert 96 | { 97 | if (!_alert) { 98 | WS(weakSelf); 99 | _alert = [UIAlertController alertControllerWithTitle:nil message:@"自罚一杯即可随机改变一个骰子的点数" preferredStyle:UIAlertControllerStyleAlert]; 100 | _alert.modalPresentationStyle = UIModalPresentationFullScreen; 101 | [_alert addAction:[UIAlertAction actionWithTitle:@"自罚一杯" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 102 | [weakSelf zifayibei]; 103 | }]]; 104 | [_alert addAction:[UIAlertAction actionWithTitle:@"算了" style:UIAlertActionStyleCancel handler:nil]]; 105 | } 106 | return _alert; 107 | } 108 | 109 | 110 | - (UIVisualEffectView *)maoboli 111 | { 112 | if (!_maoboli) { 113 | UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; 114 | _maoboli = [[UIVisualEffectView alloc] initWithEffect:effect]; 115 | 116 | UIImageView *yuanImg = [[UIImageView alloc]init]; 117 | [yuanImg setImage:[UIImage imageNamed:@"yuan"]]; 118 | [_maoboli addSubview:yuanImg]; 119 | [yuanImg mas_makeConstraints:^(MASConstraintMaker *make) { 120 | make.centerX.mas_equalTo(0); 121 | make.height.width.mas_equalTo(150); 122 | make.top.mas_equalTo(ScreenHeight/2-75); 123 | }]; 124 | 125 | UILabel *label = [[UILabel alloc]init]; 126 | label.text = @"開"; 127 | label.textColor = [UIColor whiteColor]; 128 | label.font = SYSTEMFONT(40); 129 | [_maoboli addSubview:label]; 130 | [label mas_makeConstraints:^(MASConstraintMaker *make) { 131 | make.center.mas_equalTo(yuanImg); 132 | }]; 133 | 134 | WS(weakSelf); 135 | [_maoboli whenTapped:^{ 136 | [UIView animateWithDuration:0.5 animations:^{ 137 | [weakSelf.maoboli mas_updateConstraints:^(MASConstraintMaker *make) { 138 | make.top.mas_equalTo(ScreenHeight); 139 | }]; 140 | [BeeAppWindow layoutIfNeeded]; 141 | weakSelf.canShake = YES; 142 | }]; 143 | }]; 144 | 145 | } 146 | return _maoboli; 147 | } 148 | 149 | 150 | - (UIImageView *)yaoImg 151 | { 152 | if (!_yaoImg) { 153 | _yaoImg = [[UIImageView alloc]init]; 154 | [_yaoImg setImage:[UIImage imageNamed:@"yao"]]; 155 | WS(weakSelf); 156 | [_yaoImg whenTapped:^{ 157 | if (weakSelf.canShake == YES) { 158 | [weakSelf.bragContentView shakingAction]; 159 | } 160 | }]; 161 | } 162 | return _yaoImg; 163 | } 164 | 165 | - (UIImageView *)suoImg 166 | { 167 | if (!_suoImg) { 168 | _suoImg = [[UIImageView alloc]init]; 169 | [_suoImg setImage:[UIImage imageNamed:@"suo"]]; 170 | WS(weakSelf); 171 | [_suoImg whenTapped:^{ 172 | [UIView animateWithDuration:0.5 animations:^{ 173 | [weakSelf.maoboli mas_updateConstraints:^(MASConstraintMaker *make) { 174 | make.top.mas_equalTo(0); 175 | }]; 176 | [BeeAppWindow layoutIfNeeded]; 177 | weakSelf.canShake = NO; 178 | }]; 179 | }]; 180 | } 181 | return _suoImg; 182 | } 183 | 184 | - (UIImageView *)biImg 185 | { 186 | if (!_biImg) { 187 | _biImg = [[UIImageView alloc]init]; 188 | [_biImg setImage:[UIImage imageNamed:@"bi"]]; 189 | WS(weakSelf); 190 | [_biImg whenTapped:^{ 191 | [weakSelf zuobi]; 192 | }]; 193 | } 194 | return _biImg; 195 | } 196 | 197 | - (BeeBragContentView *)bragContentView 198 | { 199 | if (!_bragContentView) { 200 | _bragContentView = [[BeeBragContentView alloc]init]; 201 | } 202 | return _bragContentView; 203 | } 204 | 205 | - (void)viewWillAppear:(BOOL)animated 206 | { 207 | [super viewWillAppear:animated]; 208 | self.navigationController.navigationBarHidden = NO; 209 | 210 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 211 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 212 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 213 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 214 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 215 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 216 | 217 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 218 | self.navigationItem.leftBarButtonItem = leftItem; 219 | 220 | UIButton *rightBtn = [[UIButton alloc]init]; 221 | rightBtn.frame = CGRectMake(0, 0, 70, 64); 222 | rightBtn.titleLabel.font = SYSTEMFONT(15); 223 | rightBtn.titleLabel.textAlignment = NSTextAlignmentRight; 224 | [rightBtn setTitleColor:[UIColor blackColor] forState:0]; 225 | [rightBtn setTitle:@"操作说明" forState:0]; 226 | [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; 227 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn]; 228 | self.navigationItem.rightBarButtonItem = rightItem; 229 | 230 | 231 | } 232 | 233 | - (void)leftButtonAction 234 | { 235 | [self.navigationController popViewControllerAnimated:YES]; 236 | } 237 | 238 | - (void)rightBtnAction 239 | { 240 | BeeFiveExplainViewController *vc = [[BeeFiveExplainViewController alloc]init]; 241 | [self.navigationController pushViewController:vc animated:YES]; 242 | } 243 | 244 | 245 | - (void)viewDidLoad { 246 | [super viewDidLoad]; 247 | // Do any additional setup after loading the view. 248 | 249 | 250 | 251 | self.title = @"大话骰(吹牛逼)"; 252 | self.canShake = YES; 253 | self.view.backgroundColor = [UIColor whiteColor]; 254 | 255 | [self.view addSubview:self.bragContentView]; 256 | [self.bragContentView mas_makeConstraints:^(MASConstraintMaker *make) { 257 | make.left.right.top.mas_equalTo(0); 258 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop); 259 | }]; 260 | 261 | [self.view addSubview:self.suoImg]; 262 | [self.suoImg mas_makeConstraints:^(MASConstraintMaker *make) { 263 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 264 | make.centerX.mas_equalTo(0); 265 | make.height.width.mas_equalTo(70); 266 | }]; 267 | 268 | [self.view addSubview:self.yaoImg]; 269 | [self.yaoImg mas_makeConstraints:^(MASConstraintMaker *make) { 270 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 271 | make.centerX.mas_equalTo(self.suoImg.mas_left).offset(-50); 272 | make.height.width.mas_equalTo(70); 273 | }]; 274 | 275 | [self.view addSubview:self.biImg]; 276 | [self.biImg mas_makeConstraints:^(MASConstraintMaker *make) { 277 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 278 | make.centerX.mas_equalTo(self.suoImg.mas_right).offset(50); 279 | make.height.width.mas_equalTo(70); 280 | }]; 281 | 282 | [self.view addSubview:self.canShakeImg]; 283 | [self.canShakeImg mas_makeConstraints:^(MASConstraintMaker *make) { 284 | make.height.width.mas_equalTo(60); 285 | make.right.mas_equalTo(-15); 286 | make.top.mas_equalTo(BeeNavigationHeight + 10); 287 | }]; 288 | 289 | [self.view addSubview:self.shakeSwitch]; 290 | [self.shakeSwitch mas_makeConstraints:^(MASConstraintMaker *make) { 291 | make.top.mas_equalTo(self.canShakeImg.mas_bottom).offset(5); 292 | make.centerX.mas_equalTo(self.canShakeImg); 293 | }]; 294 | 295 | [BeeAppWindow addSubview:self.maoboli]; 296 | [self.maoboli mas_makeConstraints:^(MASConstraintMaker *make) { 297 | make.left.right.mas_equalTo(0); 298 | make.top.mas_equalTo(ScreenHeight); 299 | make.bottom.mas_equalTo(0); 300 | }]; 301 | 302 | 303 | } 304 | 305 | #pragma mark - 作弊操作 306 | - (void)zuobi 307 | { 308 | [self presentViewController:self.alert animated:YES completion:nil]; 309 | 310 | } 311 | 312 | - (void)zifayibei 313 | { 314 | [self.player stop]; 315 | [self.player play]; 316 | [self presentViewController:self.alert2 animated:YES completion:nil]; 317 | } 318 | 319 | - (void)xuanzedianshu:(int)thePoint 320 | { 321 | [self.bragContentView zuobi:thePoint]; 322 | } 323 | 324 | 325 | #pragma mark - 摇一摇 326 | - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { 327 | if (!(motion == UIEventSubtypeMotionShake)) { 328 | return; 329 | } 330 | if (self.canShake == YES && [self.shakeSwitch isOn] == YES) { 331 | [self.bragContentView shakingAction]; 332 | } 333 | 334 | return; 335 | } 336 | 337 | - (void)switchAction 338 | { 339 | if ([self.shakeSwitch isOn]) { 340 | [USER_DEFAULT setObject:[NSNumber numberWithInt:0] forKey:FiveOfShake]; 341 | }else{ 342 | [USER_DEFAULT setObject:[NSNumber numberWithInt:1] forKey:FiveOfShake]; 343 | } 344 | } 345 | 346 | 347 | @end 348 | -------------------------------------------------------------------------------- /6个六斋/大话骰/Controller/BeeFiveExplainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeFiveExplainViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeFiveExplainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/大话骰/Controller/BeeFiveExplainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeFiveExplainViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeFiveExplainViewController.h" 10 | 11 | @interface BeeFiveExplainViewController () 12 | 13 | @property (nonatomic,strong)UILabel *contentLabel; 14 | 15 | @end 16 | 17 | @implementation BeeFiveExplainViewController 18 | 19 | - (UILabel *)contentLabel 20 | { 21 | if (!_contentLabel) { 22 | _contentLabel = [[UILabel alloc]init]; 23 | _contentLabel.font = SYSTEMFONT(16); 24 | _contentLabel.textColor = [UIColor blackColor]; 25 | _contentLabel.text = @" 右上角开光控制手机是否可以进行摇晃操作; \n\n 下方\"摇\"按钮或者摇晃手机可达到投掷骰子的效果;\n\n 下方\"盖\"按钮可对屏幕进行遮挡操作,防止泄露天机;\n\n 下方\"弊\"可进行作弊操作,效果是随机对5个骰子中的一个进行投掷至选择的点数"; 26 | _contentLabel.textAlignment = 0; 27 | _contentLabel.numberOfLines = 0; 28 | } 29 | return _contentLabel; 30 | } 31 | 32 | - (void)viewWillAppear:(BOOL)animated 33 | { 34 | [super viewWillAppear:animated]; 35 | self.navigationController.navigationBarHidden = NO; 36 | 37 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 39 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 40 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 41 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 42 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 43 | 44 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 45 | self.navigationItem.leftBarButtonItem = leftItem; 46 | 47 | } 48 | 49 | - (void)leftButtonAction 50 | { 51 | [self.navigationController popViewControllerAnimated:YES]; 52 | } 53 | 54 | 55 | - (void)viewDidLoad { 56 | [super viewDidLoad]; 57 | // Do any additional setup after loading the view. 58 | 59 | self.title = @"操作说明"; 60 | self.view.backgroundColor = [UIColor whiteColor]; 61 | 62 | [self.view addSubview:self.contentLabel]; 63 | [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { 64 | make.top.mas_equalTo(BeeNavigationHeight + 30); 65 | make.left.mas_equalTo(20); 66 | make.right.mas_equalTo(-20); 67 | }]; 68 | 69 | } 70 | 71 | 72 | 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /6个六斋/大话骰/View/BeeBragContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeBragContentView.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/31. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeBragContentView : UIView 12 | 13 | - (void)shakingAction; 14 | - (void)zuobi:(int)point; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /6个六斋/大话骰/View/BeeBragContentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeBragContentView.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/1/31. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeBragContentView.h" 10 | #import "BeeDiceView.h" 11 | #import 12 | 13 | @interface BeeBragContentView () 14 | 15 | @property (nonatomic,strong) BeeDiceView *diceView; 16 | @property (nonatomic,strong) BeeDiceView *diceView1; 17 | @property (nonatomic,strong) BeeDiceView *diceView2; 18 | @property (nonatomic,strong) BeeDiceView *diceView3; 19 | @property (nonatomic,strong) BeeDiceView *diceView4; 20 | 21 | @property (nonatomic,assign)float theNum; 22 | @property (nonatomic,assign)float Num1; 23 | 24 | @property (nonatomic,assign)int thetag; 25 | @property (nonatomic,strong)NSTimer *timer; 26 | @property (nonatomic,strong)NSTimer *timer2; 27 | @property (nonatomic,strong)NSTimer *timer3; 28 | @property (nonatomic,strong)NSTimer *timer4; 29 | 30 | //@property (nonatomic,assign)int roundPoint; 31 | //@property (nonatomic,assign)int onPoint; 32 | @property (nonatomic,strong)NSMutableArray *roundArr; 33 | @property (nonatomic,strong)NSMutableArray *onArr; 34 | 35 | @property (nonatomic,assign)float zTrans; 36 | 37 | // zuobi 38 | @property (nonatomic,assign)int chooseNum; 39 | @property (nonatomic,assign)int chooseValue; 40 | @property (nonatomic,assign)int sjFour; 41 | 42 | @property (nonatomic , strong) AVAudioPlayer *player; 43 | 44 | 45 | @end 46 | 47 | @implementation BeeBragContentView 48 | 49 | - (AVAudioPlayer *)player 50 | { 51 | if (!_player) { 52 | NSURL *url = [[NSBundle mainBundle] URLForResource:@"yaoshaizi" withExtension:@"mp3"]; 53 | _player = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; 54 | _player.delegate = self; 55 | } 56 | return _player; 57 | } 58 | 59 | 60 | 61 | 62 | 63 | - (BeeDiceView *)diceView 64 | { 65 | if (!_diceView) { 66 | _diceView = [[BeeDiceView alloc]init]; 67 | } 68 | return _diceView; 69 | } 70 | 71 | - (BeeDiceView *)diceView1 72 | { 73 | if (!_diceView1) { 74 | _diceView1 = [[BeeDiceView alloc]init]; 75 | 76 | } 77 | return _diceView1; 78 | } 79 | 80 | - (BeeDiceView *)diceView2 81 | { 82 | if (!_diceView2) { 83 | _diceView2 = [[BeeDiceView alloc]init]; 84 | 85 | } 86 | return _diceView2; 87 | } 88 | 89 | - (BeeDiceView *)diceView3 90 | { 91 | if (!_diceView3) { 92 | _diceView3 = [[BeeDiceView alloc]init]; 93 | 94 | } 95 | return _diceView3; 96 | } 97 | 98 | - (BeeDiceView *)diceView4 99 | { 100 | if (!_diceView4) { 101 | _diceView4 = [[BeeDiceView alloc]init]; 102 | 103 | } 104 | return _diceView4; 105 | } 106 | 107 | 108 | - (id)initWithFrame:(CGRect)frame 109 | { 110 | if (self = [super initWithFrame:frame]) { 111 | 112 | float s72 = sin(M_PI_2*72/90) * 80; 113 | float c72 = cos(M_PI_2*72/90) * 80; 114 | float s36 = sin(M_PI_2*36/90) * 80; 115 | float c36 = cos(M_PI_2*36/90) * 80; 116 | 117 | [self addSubview:self.diceView]; 118 | [self.diceView mas_makeConstraints:^(MASConstraintMaker *make) { 119 | make.centerX.mas_equalTo(0); 120 | make.centerY.mas_equalTo(-80); 121 | make.width.height.mas_equalTo(50); 122 | }]; 123 | 124 | [self addSubview:self.diceView1]; 125 | [self.diceView1 mas_makeConstraints:^(MASConstraintMaker *make) { 126 | make.centerX.mas_equalTo(-s72); 127 | make.centerY.mas_equalTo(-c72); 128 | make.width.height.mas_equalTo(50); 129 | }]; 130 | 131 | [self addSubview:self.diceView2]; 132 | [self.diceView2 mas_makeConstraints:^(MASConstraintMaker *make) { 133 | make.centerX.mas_equalTo(s72); 134 | make.centerY.mas_equalTo(-c72); 135 | make.width.height.mas_equalTo(50); 136 | }]; 137 | 138 | [self addSubview:self.diceView3]; 139 | [self.diceView3 mas_makeConstraints:^(MASConstraintMaker *make) { 140 | make.centerX.mas_equalTo(-s36); 141 | make.centerY.mas_equalTo(c36); 142 | make.width.height.mas_equalTo(50); 143 | }]; 144 | 145 | [self addSubview:self.diceView4]; 146 | [self.diceView4 mas_makeConstraints:^(MASConstraintMaker *make) { 147 | make.centerX.mas_equalTo(s36); 148 | make.centerY.mas_equalTo(c36); 149 | make.width.height.mas_equalTo(50); 150 | }]; 151 | 152 | [self creatThe3DPerspective:self.diceView andZPointWithX:0 Y:0 Z:25]; 153 | [self creatThe3DPerspective:self.diceView1 andZPointWithX:0 Y:0 Z:25]; 154 | [self creatThe3DPerspective:self.diceView2 andZPointWithX:0 Y:0 Z:25]; 155 | [self creatThe3DPerspective:self.diceView3 andZPointWithX:0 Y:0 Z:25]; 156 | [self creatThe3DPerspective:self.diceView4 andZPointWithX:0 Y:0 Z:25]; 157 | 158 | 159 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerAction) userInfo:nil repeats:YES]; 160 | [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode]; 161 | [self.timer setFireDate:[NSDate distantFuture]]; 162 | 163 | self.timer2 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer2Action:) userInfo:nil repeats:YES]; 164 | [[NSRunLoop mainRunLoop] addTimer:self.timer2 forMode:NSDefaultRunLoopMode]; 165 | [self.timer2 setFireDate:[NSDate distantFuture]]; 166 | 167 | self.timer3 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer3Action) userInfo:nil repeats:YES]; 168 | [[NSRunLoop mainRunLoop] addTimer:self.timer3 forMode:NSDefaultRunLoopMode]; 169 | [self.timer3 setFireDate:[NSDate distantFuture]]; 170 | 171 | self.timer4 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer4Action) userInfo:nil repeats:YES]; 172 | [[NSRunLoop mainRunLoop] addTimer:self.timer4 forMode:NSDefaultRunLoopMode]; 173 | [self.timer4 setFireDate:[NSDate distantFuture]]; 174 | 175 | 176 | } 177 | return self; 178 | } 179 | 180 | 181 | - (void)creatThe3DPerspective:(BeeDiceView *)diceView andZPointWithX:(int)the_x Y:(int)the_y Z:(int)the_z 182 | { 183 | CATransform3D perspective1 = CATransform3DIdentity; 184 | perspective1.m34 = -1/500; 185 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4 + M_PI_2, 1, 0, 0); 186 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4, 0, 0, 1); 187 | perspective1 = CATransform3DTranslate(perspective1, the_x, the_y, the_z); 188 | diceView.layer.sublayerTransform = perspective1; 189 | } 190 | 191 | - (void)shakingAction 192 | { 193 | if (self.thetag == 0) { 194 | [self.player stop]; 195 | [self.player play]; 196 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 197 | self.roundArr = [[NSMutableArray alloc]init]; 198 | self.onArr = [[NSMutableArray alloc]init]; 199 | self.thetag = 1; 200 | self.Num1 = M_PI_4; // 控制之后timer2的时间动画长短 201 | [self.timer setFireDate:[NSDate distantFuture]]; 202 | [self.timer setFireDate:[NSDate distantPast]]; 203 | [self performSelector:@selector(toEndTheShaking) withObject:nil afterDelay:2.5]; 204 | 205 | // 进行位移 206 | [UIView animateWithDuration:1.25 animations:^{ 207 | [self.diceView mas_updateConstraints:^(MASConstraintMaker *make) { 208 | make.center.mas_equalTo(0); 209 | }]; 210 | [self.diceView1 mas_updateConstraints:^(MASConstraintMaker *make) { 211 | make.center.mas_equalTo(0); 212 | }]; 213 | [self.diceView2 mas_updateConstraints:^(MASConstraintMaker *make) { 214 | make.center.mas_equalTo(0); 215 | }]; 216 | [self.diceView3 mas_updateConstraints:^(MASConstraintMaker *make) { 217 | make.center.mas_equalTo(0); 218 | }]; 219 | [self.diceView4 mas_updateConstraints:^(MASConstraintMaker *make) { 220 | make.center.mas_equalTo(0); 221 | }]; 222 | 223 | [self layoutIfNeeded]; 224 | 225 | } completion:^(BOOL finished) { 226 | 227 | float s72 = sin(M_PI_2*72/90) * 80; 228 | float c72 = cos(M_PI_2*72/90) * 80; 229 | float s36 = sin(M_PI_2*36/90) * 80; 230 | float c36 = cos(M_PI_2*36/90) * 80; 231 | 232 | [UIView animateWithDuration:1.25 animations:^{ 233 | 234 | [self.diceView mas_updateConstraints:^(MASConstraintMaker *make) { 235 | make.centerX.mas_equalTo(0); 236 | make.centerY.mas_equalTo(-80); 237 | }]; 238 | 239 | [self.diceView1 mas_updateConstraints:^(MASConstraintMaker *make) { 240 | make.centerX.mas_equalTo(-s72); 241 | make.centerY.mas_equalTo(-c72); 242 | }]; 243 | 244 | [self.diceView2 mas_updateConstraints:^(MASConstraintMaker *make) { 245 | make.centerX.mas_equalTo(s72); 246 | make.centerY.mas_equalTo(-c72); 247 | }]; 248 | 249 | [self.diceView3 mas_updateConstraints:^(MASConstraintMaker *make) { 250 | make.centerX.mas_equalTo(-s36); 251 | make.centerY.mas_equalTo(c36); 252 | }]; 253 | 254 | [self.diceView4 mas_updateConstraints:^(MASConstraintMaker *make) { 255 | make.centerX.mas_equalTo(s36); 256 | make.centerY.mas_equalTo(c36); 257 | }]; 258 | 259 | [self layoutIfNeeded]; 260 | }]; 261 | 262 | }]; 263 | } 264 | 265 | } 266 | 267 | - (void)timerAction 268 | { 269 | self.zTrans += M_PI_2*8/125; 270 | 271 | self.theNum += 0.35; 272 | 273 | CATransform3D perspective = CATransform3DIdentity; 274 | perspective.m34 = -1.0/500.0; 275 | 276 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 277 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 278 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 279 | 280 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 281 | self.diceView.layer.sublayerTransform = perspective; 282 | self.diceView1.layer.sublayerTransform = perspective; 283 | self.diceView2.layer.sublayerTransform = perspective; 284 | self.diceView3.layer.sublayerTransform = perspective; 285 | self.diceView4.layer.sublayerTransform = perspective; 286 | 287 | CATransform3D perspective1 = CATransform3DIdentity; 288 | perspective1 = CATransform3DRotate(perspective1, self.zTrans, 0, 0, 1); 289 | self.layer.sublayerTransform = perspective1; 290 | 291 | } 292 | 293 | - (void)toEndTheShaking 294 | { 295 | self.zTrans = 0; 296 | self.theNum = 0; 297 | 298 | [self.timer setFireDate:[NSDate distantFuture]]; 299 | [self.timer2 setFireDate:[NSDate distantFuture]]; 300 | 301 | for (int i = 0; i < 5; i ++) { 302 | int roundPoint = (arc4random() % 4); 303 | int onPoint = (arc4random() % 6); 304 | 305 | [self.roundArr addObject:[NSNumber numberWithInt:roundPoint]]; 306 | [self.onArr addObject:[NSNumber numberWithInt:onPoint]]; 307 | } 308 | 309 | [self.timer2 setFireDate:[NSDate distantPast]]; 310 | 311 | CATransform3D perspective1 = CATransform3DIdentity; 312 | perspective1 = CATransform3DRotate(perspective1, 0, 0, 0, 1); 313 | self.layer.sublayerTransform = perspective1; 314 | 315 | } 316 | 317 | - (void)timer2Action:(NSTimer *)timer 318 | { 319 | 320 | self.Num1 = self.Num1 - 0.025; 321 | 322 | if (self.Num1 > 0) { 323 | 324 | 325 | for (int i = 0; i < 5; i ++) { 326 | 327 | CATransform3D perspective = CATransform3DIdentity; 328 | perspective.m34 = -1.0/500.0; 329 | 330 | switch ([self.onArr[i] intValue]) { 331 | case 0: 332 | { 333 | // 1 的情况 334 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 - self.Num1, 1, 0, 0); 335 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 336 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] -self.Num1, 0, 0, 1); 337 | } 338 | break; 339 | case 1: 340 | { 341 | // 2 的情况 342 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 343 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] - self.Num1, 0, 1, 0); 344 | perspective = CATransform3DRotate(perspective, M_PI_2 - self.Num1, 0, 0, 1); 345 | 346 | } 347 | break; 348 | case 2: 349 | { 350 | // 3 的情况 351 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * 2 - self.Num1, 1, 0, 0); 352 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * [self.roundArr[i] intValue], 0, 1, 0); 353 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 354 | 355 | } 356 | break; 357 | case 3: 358 | { 359 | // 4 的情况 360 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 361 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * [self.roundArr[i] intValue], 0, 1, 0); 362 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 363 | 364 | } 365 | break; 366 | case 4: 367 | { 368 | // 5 的情况 369 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 370 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] - self.Num1, 0, 1, 0); 371 | perspective = CATransform3DRotate(perspective, -M_PI_2 - self.Num1, 0, 0, 1); 372 | 373 | } 374 | break; 375 | case 5: 376 | { 377 | // 6 的情况 378 | perspective = CATransform3DRotate(perspective, -M_PI_4 - M_PI_2 - self.Num1, 1, 0, 0); 379 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 380 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] -self.Num1, 0, 0, 1); 381 | } 382 | break; 383 | 384 | default: 385 | break; 386 | } 387 | 388 | perspective = CATransform3DTranslate(perspective, 0, 0, 25 ); 389 | 390 | switch (i) { 391 | case 0: 392 | self.diceView.layer.sublayerTransform = perspective; 393 | break; 394 | case 1: 395 | self.diceView1.layer.sublayerTransform = perspective; 396 | break; 397 | case 2: 398 | self.diceView2.layer.sublayerTransform = perspective; 399 | break; 400 | case 3: 401 | self.diceView3.layer.sublayerTransform = perspective; 402 | break; 403 | case 4: 404 | self.diceView4.layer.sublayerTransform = perspective; 405 | break; 406 | 407 | default: 408 | break; 409 | } 410 | } 411 | 412 | }else{ 413 | [self.timer2 setFireDate:[NSDate distantFuture]]; 414 | self.thetag = 0; 415 | } 416 | } 417 | 418 | 419 | #pragma mark - 作弊操作 420 | - (void)zuobi:(int)point 421 | { 422 | [self.player stop]; 423 | [self.player play]; 424 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 425 | 426 | int num = (arc4random() % 5); 427 | int thesj = (arc4random() % 4); 428 | self.sjFour = thesj; 429 | self.chooseNum = num; 430 | self.chooseValue = point; 431 | self.thetag = 1; 432 | self.theNum = 0.1; 433 | 434 | [self performSelector:@selector(endTimer3Action) withObject:nil afterDelay:1.5]; 435 | 436 | [self.timer3 setFireDate:[NSDate distantFuture]]; 437 | [self.timer3 setFireDate:[NSDate distantPast]]; 438 | 439 | 440 | } 441 | 442 | - (void)timer3Action 443 | { 444 | self.theNum += 0.25; 445 | 446 | CATransform3D perspective = CATransform3DIdentity; 447 | perspective.m34 = -1.0/500.0; 448 | 449 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 450 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 451 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 452 | 453 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 454 | 455 | switch (self.chooseNum) { 456 | case 0: 457 | self.diceView.layer.sublayerTransform = perspective; 458 | break; 459 | case 1: 460 | self.diceView1.layer.sublayerTransform = perspective; 461 | break; 462 | case 2: 463 | self.diceView2.layer.sublayerTransform = perspective; 464 | break; 465 | case 3: 466 | self.diceView3.layer.sublayerTransform = perspective; 467 | break; 468 | case 4: 469 | self.diceView4.layer.sublayerTransform = perspective; 470 | break; 471 | 472 | default: 473 | break; 474 | } 475 | 476 | 477 | } 478 | 479 | - (void)endTimer3Action 480 | { 481 | self.theNum = 0; 482 | self.Num1 = M_PI_4; 483 | 484 | [self.timer3 setFireDate:[NSDate distantFuture]]; 485 | [self.timer4 setFireDate:[NSDate distantFuture]]; 486 | [self.timer4 setFireDate:[NSDate distantPast]]; 487 | 488 | } 489 | 490 | 491 | - (void)timer4Action 492 | { 493 | self.Num1 = self.Num1 - 0.025; 494 | 495 | if (self.Num1 > 0) { 496 | 497 | CATransform3D perspective = CATransform3DIdentity; 498 | perspective.m34 = -1.0/500.0; 499 | switch (self.chooseValue) { 500 | case 0: 501 | { 502 | // 1 的情况 503 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 - self.Num1, 1, 0, 0); 504 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 505 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.sjFour -self.Num1, 0, 0, 1); 506 | } 507 | break; 508 | case 1: 509 | { 510 | // 2 的情况 511 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 512 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.sjFour - self.Num1, 0, 1, 0); 513 | perspective = CATransform3DRotate(perspective, M_PI_2 - self.Num1, 0, 0, 1); 514 | 515 | } 516 | break; 517 | case 2: 518 | { 519 | // 3 的情况 520 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * 2 - self.Num1, 1, 0, 0); 521 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.sjFour , 0, 1, 0); 522 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 523 | 524 | } 525 | break; 526 | case 3: 527 | { 528 | // 4 的情况 529 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 530 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.sjFour, 0, 1, 0); 531 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 532 | 533 | } 534 | break; 535 | case 4: 536 | { 537 | // 5 的情况 538 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 539 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.sjFour - self.Num1, 0, 1, 0); 540 | perspective = CATransform3DRotate(perspective, -M_PI_2 - self.Num1, 0, 0, 1); 541 | 542 | } 543 | break; 544 | case 5: 545 | { 546 | // 6 的情况 547 | perspective = CATransform3DRotate(perspective, -M_PI_4 - M_PI_2 - self.Num1, 1, 0, 0); 548 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 549 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.sjFour -self.Num1, 0, 0, 1); 550 | } 551 | break; 552 | 553 | default: 554 | break; 555 | } 556 | 557 | perspective = CATransform3DTranslate(perspective, 0, 0, 25 ); 558 | switch (self.chooseNum) { 559 | case 0: 560 | self.diceView.layer.sublayerTransform = perspective; 561 | break; 562 | case 1: 563 | self.diceView1.layer.sublayerTransform = perspective; 564 | break; 565 | case 2: 566 | self.diceView2.layer.sublayerTransform = perspective; 567 | break; 568 | case 3: 569 | self.diceView3.layer.sublayerTransform = perspective; 570 | break; 571 | case 4: 572 | self.diceView4.layer.sublayerTransform = perspective; 573 | break; 574 | 575 | default: 576 | break; 577 | } 578 | }else{ 579 | [self.timer4 setFireDate:[NSDate distantFuture]]; 580 | self.thetag = 0; 581 | } 582 | } 583 | 584 | @end 585 | -------------------------------------------------------------------------------- /6个六斋/手势/UIView+WhenTappedBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+WhenTappedBlocks.h 3 | // 4 | // Created by Jake Marsh on 3/7/11. 5 | // Copyright 2011 Rubber Duck Software. All rights reserved. 6 | // 7 | 8 | //#if NS_BLOCKS_AVAILABLE 9 | 10 | #import 11 | 12 | typedef void (^JMWhenTappedBlock)(); 13 | 14 | @interface UIView (JMWhenTappedBlocks) 15 | 16 | - (void)whenTapped:(JMWhenTappedBlock)block; 17 | - (void)whenDoubleTapped:(JMWhenTappedBlock)block; 18 | - (void)whenTwoFingerTapped:(JMWhenTappedBlock)block; 19 | - (void)whenTouchedDown:(JMWhenTappedBlock)block; 20 | - (void)whenTouchedUp:(JMWhenTappedBlock)block; 21 | 22 | @end 23 | 24 | //#endif 25 | 26 | -------------------------------------------------------------------------------- /6个六斋/手势/UIView+WhenTappedBlocks.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+WhenTappedBlocks.m 3 | // 4 | // Created by Jake Marsh on 3/7/11. 5 | // Copyright 2011 Rubber Duck Software. All rights reserved. 6 | // 7 | 8 | //#if NS_BLOCKS_AVAILABLE 9 | 10 | #import "UIView+WhenTappedBlocks.h" 11 | #import 12 | 13 | @interface UIView (JMWhenTappedBlocks_Private) 14 | 15 | - (void)runBlockForKey:(void *)blockKey; 16 | - (void)setBlock:(JMWhenTappedBlock)block forKey:(void *)blockKey; 17 | 18 | - (UITapGestureRecognizer*)addTapGestureRecognizerWithTaps:(NSUInteger) taps touches:(NSUInteger) touches selector:(SEL) selector; 19 | - (void) addRequirementToSingleTapsRecognizer:(UIGestureRecognizer*) recognizer; 20 | - (void) addRequiredToDoubleTapsRecognizer:(UIGestureRecognizer*) recognizer; 21 | 22 | @end 23 | 24 | @implementation UIView (JMWhenTappedBlocks) 25 | 26 | static char kWhenTappedBlockKey; 27 | static char kWhenDoubleTappedBlockKey; 28 | static char kWhenTwoFingerTappedBlockKey; 29 | static char kWhenTouchedDownBlockKey; 30 | static char kWhenTouchedUpBlockKey; 31 | 32 | #pragma mark - 33 | #pragma mark Set blocks 34 | 35 | - (void)runBlockForKey:(void *)blockKey { 36 | JMWhenTappedBlock block = objc_getAssociatedObject(self, blockKey); 37 | if (block) block(); 38 | } 39 | 40 | - (void)setBlock:(JMWhenTappedBlock)block forKey:(void *)blockKey { 41 | self.userInteractionEnabled = YES; 42 | objc_setAssociatedObject(self, blockKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC); 43 | } 44 | 45 | #pragma mark - 46 | #pragma mark When Tapped 47 | 48 | - (void)whenTapped:(JMWhenTappedBlock)block { 49 | UITapGestureRecognizer* gesture = [self addTapGestureRecognizerWithTaps:1 touches:1 selector:@selector(viewWasTapped)]; 50 | [self addRequiredToDoubleTapsRecognizer:gesture]; 51 | 52 | [self setBlock:block forKey:&kWhenTappedBlockKey]; 53 | } 54 | 55 | - (void)whenDoubleTapped:(JMWhenTappedBlock)block { 56 | UITapGestureRecognizer* gesture = [self addTapGestureRecognizerWithTaps:2 touches:1 selector:@selector(viewWasDoubleTapped)]; 57 | [self addRequirementToSingleTapsRecognizer:gesture]; 58 | 59 | [self setBlock:block forKey:&kWhenDoubleTappedBlockKey]; 60 | } 61 | 62 | - (void)whenTwoFingerTapped:(JMWhenTappedBlock)block { 63 | [self addTapGestureRecognizerWithTaps:1 touches:2 selector:@selector(viewWasTwoFingerTapped)]; 64 | 65 | [self setBlock:block forKey:&kWhenTwoFingerTappedBlockKey]; 66 | } 67 | 68 | - (void)whenTouchedDown:(JMWhenTappedBlock)block { 69 | [self setBlock:block forKey:&kWhenTouchedDownBlockKey]; 70 | } 71 | 72 | - (void)whenTouchedUp:(JMWhenTappedBlock)block { 73 | [self setBlock:block forKey:&kWhenTouchedUpBlockKey]; 74 | } 75 | 76 | #pragma mark - 77 | #pragma mark Callbacks 78 | 79 | - (void)viewWasTapped { 80 | [self runBlockForKey:&kWhenTappedBlockKey]; 81 | } 82 | 83 | - (void)viewWasDoubleTapped { 84 | [self runBlockForKey:&kWhenDoubleTappedBlockKey]; 85 | } 86 | 87 | - (void)viewWasTwoFingerTapped { 88 | [self runBlockForKey:&kWhenTwoFingerTappedBlockKey]; 89 | } 90 | 91 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 92 | [super touchesBegan:touches withEvent:event]; 93 | [self runBlockForKey:&kWhenTouchedDownBlockKey]; 94 | } 95 | 96 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 97 | [super touchesEnded:touches withEvent:event]; 98 | [self runBlockForKey:&kWhenTouchedUpBlockKey]; 99 | } 100 | 101 | #pragma mark - 102 | #pragma mark Helpers 103 | 104 | - (UITapGestureRecognizer*)addTapGestureRecognizerWithTaps:(NSUInteger)taps touches:(NSUInteger)touches selector:(SEL)selector { 105 | UITapGestureRecognizer* tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:selector]; 106 | tapGesture.delegate = self; 107 | tapGesture.numberOfTapsRequired = taps; 108 | tapGesture.numberOfTouchesRequired = touches; 109 | [self addGestureRecognizer:tapGesture]; 110 | 111 | return tapGesture; 112 | } 113 | 114 | - (void) addRequirementToSingleTapsRecognizer:(UIGestureRecognizer*) recognizer { 115 | for (UIGestureRecognizer* gesture in [self gestureRecognizers]) { 116 | if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) { 117 | UITapGestureRecognizer* tapGesture = (UITapGestureRecognizer*) gesture; 118 | if (tapGesture.numberOfTouchesRequired == 1 && tapGesture.numberOfTapsRequired == 1) { 119 | [tapGesture requireGestureRecognizerToFail:recognizer]; 120 | } 121 | } 122 | } 123 | } 124 | 125 | - (void) addRequiredToDoubleTapsRecognizer:(UIGestureRecognizer*) recognizer { 126 | for (UIGestureRecognizer* gesture in [self gestureRecognizers]) { 127 | if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) { 128 | UITapGestureRecognizer* tapGesture = (UITapGestureRecognizer*) gesture; 129 | if (tapGesture.numberOfTouchesRequired == 2 && tapGesture.numberOfTapsRequired == 1) { 130 | [recognizer requireGestureRecognizerToFail:tapGesture]; 131 | } 132 | } 133 | } 134 | } 135 | 136 | @end 137 | 138 | //#endif 139 | 140 | -------------------------------------------------------------------------------- /6个六斋/比大小/Controller/BeeThreeDiceViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeDiceViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeThreeDiceViewController : UIViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /6个六斋/比大小/Controller/BeeThreeDiceViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeDiceViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeThreeDiceViewController.h" 10 | #import "BeeThreeDiceContentView.h" 11 | #import "BeeThreeExplainViewController.h" 12 | 13 | @interface BeeThreeDiceViewController () 14 | 15 | @property (nonatomic,strong)BeeThreeDiceContentView *contentView; 16 | @property (nonatomic,strong)UIImageView *yaoImg; 17 | @property (nonatomic,strong)UIImageView *suoImg; 18 | @property (nonatomic,strong)UIVisualEffectView *maoboli; 19 | @property (nonatomic,assign)BOOL canShake; 20 | @property (nonatomic,strong)UIImageView *canShakeImg; 21 | @property (nonatomic,strong)UISwitch *shakeSwitch; 22 | @end 23 | 24 | @implementation BeeThreeDiceViewController 25 | 26 | - (UISwitch *)shakeSwitch 27 | { 28 | if (!_shakeSwitch) { 29 | _shakeSwitch = [[UISwitch alloc]init]; 30 | if ([[USER_DEFAULT objectForKey:ThreeOfShake]intValue] == 0) { 31 | [_shakeSwitch setOn:YES]; 32 | }else{ 33 | [_shakeSwitch setOn:NO]; 34 | } 35 | [_shakeSwitch addTarget:self action:@selector(switchAction) forControlEvents:UIControlEventValueChanged]; 36 | } 37 | return _shakeSwitch; 38 | } 39 | 40 | - (UIImageView *)canShakeImg 41 | { 42 | if (!_canShakeImg) { 43 | _canShakeImg = [[UIImageView alloc]init]; 44 | [_canShakeImg setImage:[UIImage imageNamed:@"yaoyiyao"]]; 45 | } 46 | return _canShakeImg; 47 | } 48 | 49 | - (BeeThreeDiceContentView *)contentView 50 | { 51 | if (!_contentView) { 52 | _contentView = [[BeeThreeDiceContentView alloc]init]; 53 | WS(weakSelf); 54 | _contentView.hideBlock = ^{ 55 | [UIView animateWithDuration:0.5 animations:^{ 56 | [weakSelf.maoboli mas_updateConstraints:^(MASConstraintMaker *make) { 57 | make.top.mas_equalTo(0); 58 | }]; 59 | [BeeAppWindow layoutIfNeeded]; 60 | weakSelf.canShake = NO; 61 | }]; 62 | }; 63 | } 64 | return _contentView; 65 | } 66 | 67 | - (UIVisualEffectView *)maoboli 68 | { 69 | if (!_maoboli) { 70 | UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; 71 | _maoboli = [[UIVisualEffectView alloc] initWithEffect:effect]; 72 | 73 | UIImageView *yuanImg = [[UIImageView alloc]init]; 74 | [yuanImg setImage:[UIImage imageNamed:@"yuan"]]; 75 | [_maoboli addSubview:yuanImg]; 76 | [yuanImg mas_makeConstraints:^(MASConstraintMaker *make) { 77 | make.centerX.mas_equalTo(0); 78 | make.height.width.mas_equalTo(150); 79 | make.top.mas_equalTo(ScreenHeight/2-75); 80 | }]; 81 | 82 | UILabel *label = [[UILabel alloc]init]; 83 | label.text = @"開"; 84 | label.textColor = [UIColor whiteColor]; 85 | label.font = SYSTEMFONT(40); 86 | [_maoboli addSubview:label]; 87 | [label mas_makeConstraints:^(MASConstraintMaker *make) { 88 | make.center.mas_equalTo(yuanImg); 89 | }]; 90 | 91 | WS(weakSelf); 92 | [_maoboli whenTapped:^{ 93 | [UIView animateWithDuration:0.5 animations:^{ 94 | [weakSelf.maoboli mas_updateConstraints:^(MASConstraintMaker *make) { 95 | make.top.mas_equalTo(ScreenHeight); 96 | }]; 97 | [BeeAppWindow layoutIfNeeded]; 98 | weakSelf.canShake = YES; 99 | }]; 100 | }]; 101 | 102 | } 103 | return _maoboli; 104 | } 105 | 106 | 107 | - (UIImageView *)yaoImg 108 | { 109 | if (!_yaoImg) { 110 | _yaoImg = [[UIImageView alloc]init]; 111 | [_yaoImg setImage:[UIImage imageNamed:@"yao"]]; 112 | WS(weakSelf); 113 | [_yaoImg whenTapped:^{ 114 | if (weakSelf.canShake == YES) { 115 | [weakSelf.contentView shakingAction]; 116 | } 117 | }]; 118 | } 119 | return _yaoImg; 120 | } 121 | 122 | - (UIImageView *)suoImg 123 | { 124 | if (!_suoImg) { 125 | _suoImg = [[UIImageView alloc]init]; 126 | [_suoImg setImage:[UIImage imageNamed:@"suo"]]; 127 | WS(weakSelf); 128 | [_suoImg whenTapped:^{ 129 | [UIView animateWithDuration:0.5 animations:^{ 130 | [weakSelf.maoboli mas_updateConstraints:^(MASConstraintMaker *make) { 131 | make.top.mas_equalTo(0); 132 | }]; 133 | [BeeAppWindow layoutIfNeeded]; 134 | weakSelf.canShake = NO; 135 | }]; 136 | }]; 137 | } 138 | return _suoImg; 139 | } 140 | 141 | 142 | - (void)viewWillAppear:(BOOL)animated 143 | { 144 | [super viewWillAppear:animated]; 145 | self.navigationController.navigationBarHidden = NO; 146 | 147 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 148 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 149 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 150 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 151 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 152 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 153 | 154 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 155 | self.navigationItem.leftBarButtonItem = leftItem; 156 | 157 | UIButton *rightBtn = [[UIButton alloc]init]; 158 | rightBtn.frame = CGRectMake(0, 0, 70, 64); 159 | rightBtn.titleLabel.font = SYSTEMFONT(15); 160 | rightBtn.titleLabel.textAlignment = NSTextAlignmentRight; 161 | [rightBtn setTitleColor:[UIColor blackColor] forState:0]; 162 | [rightBtn setTitle:@"操作说明" forState:0]; 163 | [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; 164 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn]; 165 | self.navigationItem.rightBarButtonItem = rightItem; 166 | 167 | } 168 | 169 | - (void)leftButtonAction 170 | { 171 | [self.navigationController popViewControllerAnimated:YES]; 172 | } 173 | 174 | - (void)rightBtnAction 175 | { 176 | BeeThreeExplainViewController *vc = [[BeeThreeExplainViewController alloc]init]; 177 | [self.navigationController pushViewController:vc animated:YES]; 178 | } 179 | 180 | 181 | - (void)viewDidLoad { 182 | [super viewDidLoad]; 183 | // Do any additional setup after loading the view. 184 | 185 | self.title = @"比大小"; 186 | self.canShake = YES; 187 | self.view.backgroundColor = [UIColor whiteColor]; 188 | 189 | [self.view addSubview:self.contentView]; 190 | [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { 191 | make.left.right.top.mas_equalTo(0); 192 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop); 193 | }]; 194 | 195 | [self.view addSubview:self.yaoImg]; 196 | [self.yaoImg mas_makeConstraints:^(MASConstraintMaker *make) { 197 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 198 | make.centerX.mas_equalTo(-50); 199 | make.height.width.mas_equalTo(70); 200 | }]; 201 | 202 | [self.view addSubview:self.suoImg]; 203 | [self.suoImg mas_makeConstraints:^(MASConstraintMaker *make) { 204 | make.bottom.mas_equalTo(self.mas_bottomLayoutGuideTop).offset(-60); 205 | make.centerX.mas_equalTo(50); 206 | make.height.width.mas_equalTo(70); 207 | }]; 208 | 209 | [self.view addSubview:self.canShakeImg]; 210 | [self.canShakeImg mas_makeConstraints:^(MASConstraintMaker *make) { 211 | make.height.width.mas_equalTo(60); 212 | make.right.mas_equalTo(-15); 213 | make.top.mas_equalTo(BeeNavigationHeight + 10); 214 | }]; 215 | 216 | [self.view addSubview:self.shakeSwitch]; 217 | [self.shakeSwitch mas_makeConstraints:^(MASConstraintMaker *make) { 218 | make.top.mas_equalTo(self.canShakeImg.mas_bottom).offset(5); 219 | make.centerX.mas_equalTo(self.canShakeImg); 220 | }]; 221 | 222 | [BeeAppWindow addSubview:self.maoboli]; 223 | [self.maoboli mas_makeConstraints:^(MASConstraintMaker *make) { 224 | make.left.right.mas_equalTo(0); 225 | make.top.mas_equalTo(ScreenHeight); 226 | make.bottom.mas_equalTo(0); 227 | }]; 228 | 229 | 230 | 231 | } 232 | 233 | 234 | #pragma mark - 摇一摇 235 | - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { 236 | if (!(motion == UIEventSubtypeMotionShake)) { 237 | return; 238 | } 239 | if (self.canShake == YES && [self.shakeSwitch isOn] == YES) { 240 | [self.contentView shakingAction]; 241 | } 242 | 243 | return; 244 | } 245 | 246 | - (void)switchAction 247 | { 248 | if ([self.shakeSwitch isOn]) { 249 | [USER_DEFAULT setObject:[NSNumber numberWithInt:0] forKey:ThreeOfShake]; 250 | }else{ 251 | [USER_DEFAULT setObject:[NSNumber numberWithInt:1] forKey:ThreeOfShake]; 252 | } 253 | } 254 | 255 | @end 256 | -------------------------------------------------------------------------------- /6个六斋/比大小/Controller/BeeThreeExplainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeExplainViewController.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeeThreeExplainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /6个六斋/比大小/Controller/BeeThreeExplainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeExplainViewController.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/8. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeThreeExplainViewController.h" 10 | 11 | @interface BeeThreeExplainViewController () 12 | 13 | @property (nonatomic,strong)UILabel *contentLabel; 14 | 15 | @end 16 | 17 | @implementation BeeThreeExplainViewController 18 | 19 | - (UILabel *)contentLabel 20 | { 21 | if (!_contentLabel) { 22 | _contentLabel = [[UILabel alloc]init]; 23 | _contentLabel.font = SYSTEMFONT(16); 24 | _contentLabel.textColor = [UIColor blackColor]; 25 | _contentLabel.text = @" 右上角开光控制手机是否可以进行摇晃操作; \n\n 下方\"摇\"按钮或者摇晃手机可达到投掷骰子的效果,并且摇晃后会进行遮挡操作以防止天际泄露;\n\n 下方\"盖\"按钮可对屏幕进行遮挡操作,防止泄露天机;"; 26 | _contentLabel.textAlignment = 0; 27 | _contentLabel.numberOfLines = 0; 28 | } 29 | return _contentLabel; 30 | } 31 | 32 | - (void)viewWillAppear:(BOOL)animated 33 | { 34 | [super viewWillAppear:animated]; 35 | self.navigationController.navigationBarHidden = NO; 36 | 37 | UIButton *leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | [leftbtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 39 | [leftbtn addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside]; 40 | leftbtn.frame = CGRectMake(0, 0, 35, 35); 41 | [leftbtn setImageEdgeInsets:UIEdgeInsetsMake(10, -5, 5, 20)]; 42 | leftbtn.imageView.contentMode = UIViewContentModeScaleAspectFit; 43 | 44 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftbtn]; 45 | self.navigationItem.leftBarButtonItem = leftItem; 46 | 47 | } 48 | 49 | - (void)leftButtonAction 50 | { 51 | [self.navigationController popViewControllerAnimated:YES]; 52 | } 53 | 54 | - (void)viewDidLoad { 55 | [super viewDidLoad]; 56 | // Do any additional setup after loading the view. 57 | 58 | self.title = @"操作说明"; 59 | self.view.backgroundColor = [UIColor whiteColor]; 60 | 61 | [self.view addSubview:self.contentLabel]; 62 | [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { 63 | make.top.mas_equalTo(BeeNavigationHeight + 30); 64 | make.left.mas_equalTo(20); 65 | make.right.mas_equalTo(-20); 66 | }]; 67 | 68 | } 69 | 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /6个六斋/比大小/View/BeeThreeDiceContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeDiceContentView.h 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^HideActionBlock)(); 12 | 13 | @interface BeeThreeDiceContentView : UIView 14 | 15 | @property (nonatomic,copy)HideActionBlock hideBlock; 16 | 17 | - (void)shakingAction; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /6个六斋/比大小/View/BeeThreeDiceContentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeeThreeDiceContentView.m 3 | // 6个六斋 4 | // 5 | // Created by Ji_YuFeng on 2018/2/6. 6 | // Copyright © 2018年 GD_Bee. All rights reserved. 7 | // 8 | 9 | #import "BeeThreeDiceContentView.h" 10 | #import "BeeDiceView.h" 11 | #import 12 | 13 | @interface BeeThreeDiceContentView() 14 | 15 | @property (nonatomic,strong) BeeDiceView *diceView; 16 | @property (nonatomic,strong) BeeDiceView *diceView1; 17 | @property (nonatomic,strong) BeeDiceView *diceView2; 18 | @property (nonatomic,assign)float theNum; 19 | @property (nonatomic,assign)float Num1; 20 | @property (nonatomic,assign)int thetag; 21 | @property (nonatomic,strong)NSTimer *timer; 22 | @property (nonatomic,strong)NSTimer *timer2; 23 | @property (nonatomic,strong)NSMutableArray *roundArr; 24 | @property (nonatomic,strong)NSMutableArray *onArr; 25 | @property (nonatomic,assign)float zTrans; 26 | 27 | @property (nonatomic , strong) AVAudioPlayer *player; 28 | 29 | @end 30 | 31 | @implementation BeeThreeDiceContentView 32 | 33 | - (AVAudioPlayer *)player 34 | { 35 | if (!_player) { 36 | NSURL *url = [[NSBundle mainBundle] URLForResource:@"yaoshaizi" withExtension:@"mp3"]; 37 | _player = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; 38 | _player.delegate = self; 39 | } 40 | return _player; 41 | } 42 | 43 | - (BeeDiceView *)diceView 44 | { 45 | if (!_diceView) { 46 | _diceView = [[BeeDiceView alloc]init]; 47 | } 48 | return _diceView; 49 | } 50 | 51 | - (BeeDiceView *)diceView1 52 | { 53 | if (!_diceView1) { 54 | _diceView1 = [[BeeDiceView alloc]init]; 55 | 56 | } 57 | return _diceView1; 58 | } 59 | 60 | - (BeeDiceView *)diceView2 61 | { 62 | if (!_diceView2) { 63 | _diceView2 = [[BeeDiceView alloc]init]; 64 | 65 | } 66 | return _diceView2; 67 | } 68 | 69 | - (id)initWithFrame:(CGRect)frame 70 | { 71 | if (self = [super initWithFrame:frame]) { 72 | 73 | float s60 = sin(M_PI_2*60/90) * 65; 74 | float c60 = cos(M_PI_2*60/90) * 65; 75 | 76 | [self addSubview:self.diceView]; 77 | [self.diceView mas_makeConstraints:^(MASConstraintMaker *make) { 78 | make.centerX.mas_equalTo(0); 79 | make.centerY.mas_equalTo(-65); 80 | make.width.height.mas_equalTo(50); 81 | }]; 82 | 83 | [self addSubview:self.diceView1]; 84 | [self.diceView1 mas_makeConstraints:^(MASConstraintMaker *make) { 85 | make.centerX.mas_equalTo(-s60); 86 | make.centerY.mas_equalTo(c60); 87 | make.width.height.mas_equalTo(50); 88 | }]; 89 | 90 | [self addSubview:self.diceView2]; 91 | [self.diceView2 mas_makeConstraints:^(MASConstraintMaker *make) { 92 | make.centerX.mas_equalTo(s60); 93 | make.centerY.mas_equalTo(c60); 94 | make.width.height.mas_equalTo(50); 95 | }]; 96 | 97 | [self creatThe3DPerspective:self.diceView andZPointWithX:0 Y:0 Z:25]; 98 | [self creatThe3DPerspective:self.diceView1 andZPointWithX:0 Y:0 Z:25]; 99 | [self creatThe3DPerspective:self.diceView2 andZPointWithX:0 Y:0 Z:25]; 100 | 101 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerAction) userInfo:nil repeats:YES]; 102 | [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode]; 103 | [self.timer setFireDate:[NSDate distantFuture]]; 104 | 105 | self.timer2 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer2Action:) userInfo:nil repeats:YES]; 106 | [[NSRunLoop mainRunLoop] addTimer:self.timer2 forMode:NSDefaultRunLoopMode]; 107 | [self.timer2 setFireDate:[NSDate distantFuture]]; 108 | 109 | } 110 | return self; 111 | } 112 | 113 | - (void)creatThe3DPerspective:(BeeDiceView *)diceView andZPointWithX:(int)the_x Y:(int)the_y Z:(int)the_z 114 | { 115 | CATransform3D perspective1 = CATransform3DIdentity; 116 | perspective1.m34 = -1/500; 117 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4 + M_PI_2, 1, 0, 0); 118 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4, 0, 0, 1); 119 | perspective1 = CATransform3DTranslate(perspective1, the_x, the_y, the_z); 120 | diceView.layer.sublayerTransform = perspective1; 121 | } 122 | 123 | - (void)shakingAction 124 | { 125 | if (self.thetag == 0) { 126 | [self.player stop]; 127 | [self.player play]; 128 | AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 129 | self.roundArr = [[NSMutableArray alloc]init]; 130 | self.onArr = [[NSMutableArray alloc]init]; 131 | self.thetag = 1; 132 | self.Num1 = M_PI_4; // 控制之后timer2的时间动画长短 133 | [self.timer setFireDate:[NSDate distantFuture]]; 134 | [self.timer setFireDate:[NSDate distantPast]]; 135 | [self performSelector:@selector(toEndTheShaking) withObject:nil afterDelay:2.5]; 136 | [self performSelector:@selector(toHideTheResult) withObject:nil afterDelay:2]; 137 | 138 | // 进行位移 139 | [UIView animateWithDuration:1.25 animations:^{ 140 | [self.diceView mas_updateConstraints:^(MASConstraintMaker *make) { 141 | make.center.mas_equalTo(0); 142 | }]; 143 | [self.diceView1 mas_updateConstraints:^(MASConstraintMaker *make) { 144 | make.center.mas_equalTo(0); 145 | }]; 146 | [self.diceView2 mas_updateConstraints:^(MASConstraintMaker *make) { 147 | make.center.mas_equalTo(0); 148 | }]; 149 | 150 | [self layoutIfNeeded]; 151 | 152 | } completion:^(BOOL finished) { 153 | 154 | float s60 = sin(M_PI_2*60/90) * 65; 155 | float c60 = cos(M_PI_2*60/90) * 65; 156 | 157 | [UIView animateWithDuration:1.25 animations:^{ 158 | 159 | [self.diceView mas_updateConstraints:^(MASConstraintMaker *make) { 160 | make.centerX.mas_equalTo(0); 161 | make.centerY.mas_equalTo(-65); 162 | }]; 163 | 164 | [self.diceView1 mas_updateConstraints:^(MASConstraintMaker *make) { 165 | make.centerX.mas_equalTo(-s60); 166 | make.centerY.mas_equalTo(c60); 167 | }]; 168 | 169 | [self.diceView2 mas_updateConstraints:^(MASConstraintMaker *make) { 170 | make.centerX.mas_equalTo(s60); 171 | make.centerY.mas_equalTo(c60); 172 | }]; 173 | 174 | [self layoutIfNeeded]; 175 | }]; 176 | 177 | }]; 178 | } 179 | 180 | } 181 | 182 | - (void)timerAction 183 | { 184 | self.zTrans += M_PI_2*8/125; 185 | 186 | self.theNum += 0.35; 187 | 188 | CATransform3D perspective = CATransform3DIdentity; 189 | perspective.m34 = -1.0/500.0; 190 | 191 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 192 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 193 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 194 | 195 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 196 | self.diceView.layer.sublayerTransform = perspective; 197 | self.diceView1.layer.sublayerTransform = perspective; 198 | self.diceView2.layer.sublayerTransform = perspective; 199 | 200 | 201 | CATransform3D perspective1 = CATransform3DIdentity; 202 | perspective1 = CATransform3DRotate(perspective1, self.zTrans, 0, 0, 1); 203 | self.layer.sublayerTransform = perspective1; 204 | 205 | } 206 | 207 | - (void)toEndTheShaking 208 | { 209 | self.zTrans = 0; 210 | self.theNum = 0; 211 | 212 | [self.timer setFireDate:[NSDate distantFuture]]; 213 | [self.timer2 setFireDate:[NSDate distantFuture]]; 214 | 215 | for (int i = 0; i < 3; i ++) { 216 | int roundPoint = (arc4random() % 4); 217 | int onPoint = (arc4random() % 6); 218 | 219 | [self.roundArr addObject:[NSNumber numberWithInt:roundPoint]]; 220 | [self.onArr addObject:[NSNumber numberWithInt:onPoint]]; 221 | } 222 | 223 | [self.timer2 setFireDate:[NSDate distantPast]]; 224 | 225 | CATransform3D perspective1 = CATransform3DIdentity; 226 | perspective1 = CATransform3DRotate(perspective1, 0, 0, 0, 1); 227 | self.layer.sublayerTransform = perspective1; 228 | 229 | } 230 | 231 | - (void)toHideTheResult 232 | { 233 | if (self.hideBlock) { 234 | self.hideBlock(); 235 | } 236 | } 237 | 238 | 239 | - (void)timer2Action:(NSTimer *)timer 240 | { 241 | 242 | self.Num1 = self.Num1 - 0.025; 243 | 244 | if (self.Num1 > 0) { 245 | 246 | 247 | for (int i = 0; i < 3; i ++) { 248 | 249 | CATransform3D perspective = CATransform3DIdentity; 250 | perspective.m34 = -1.0/500.0; 251 | 252 | switch ([self.onArr[i] intValue]) { 253 | case 0: 254 | { 255 | // 1 的情况 256 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 - self.Num1, 1, 0, 0); 257 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 258 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] -self.Num1, 0, 0, 1); 259 | } 260 | break; 261 | case 1: 262 | { 263 | // 2 的情况 264 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 265 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] - self.Num1, 0, 1, 0); 266 | perspective = CATransform3DRotate(perspective, M_PI_2 - self.Num1, 0, 0, 1); 267 | 268 | } 269 | break; 270 | case 2: 271 | { 272 | // 3 的情况 273 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * 2 - self.Num1, 1, 0, 0); 274 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * [self.roundArr[i] intValue], 0, 1, 0); 275 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 276 | 277 | } 278 | break; 279 | case 3: 280 | { 281 | // 4 的情况 282 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 283 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * [self.roundArr[i] intValue], 0, 1, 0); 284 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 285 | 286 | } 287 | break; 288 | case 4: 289 | { 290 | // 5 的情况 291 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 292 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] - self.Num1, 0, 1, 0); 293 | perspective = CATransform3DRotate(perspective, -M_PI_2 - self.Num1, 0, 0, 1); 294 | 295 | } 296 | break; 297 | case 5: 298 | { 299 | // 6 的情况 300 | perspective = CATransform3DRotate(perspective, -M_PI_4 - M_PI_2 - self.Num1, 1, 0, 0); 301 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 302 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * [self.roundArr[i] intValue] -self.Num1, 0, 0, 1); 303 | } 304 | break; 305 | 306 | default: 307 | break; 308 | } 309 | 310 | perspective = CATransform3DTranslate(perspective, 0, 0, 25 ); 311 | 312 | switch (i) { 313 | case 0: 314 | self.diceView.layer.sublayerTransform = perspective; 315 | break; 316 | case 1: 317 | self.diceView1.layer.sublayerTransform = perspective; 318 | break; 319 | case 2: 320 | self.diceView2.layer.sublayerTransform = perspective; 321 | break; 322 | default: 323 | break; 324 | } 325 | } 326 | 327 | }else{ 328 | [self.timer2 setFireDate:[NSDate distantFuture]]; 329 | self.thetag = 0; 330 | } 331 | } 332 | 333 | @end 334 | -------------------------------------------------------------------------------- /6个六斋Tests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /6个六斋Tests/____Tests.m: -------------------------------------------------------------------------------- 1 | //___FILEHEADER___ 2 | 3 | #import 4 | 5 | @interface ___FILEBASENAMEASIDENTIFIER___ : XCTestCase 6 | 7 | @end 8 | 9 | @implementation ___FILEBASENAMEASIDENTIFIER___ 10 | 11 | - (void)setUp { 12 | [super setUp]; 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | } 15 | 16 | - (void)tearDown { 17 | // Put teardown code here. This method is called after the invocation of each test method in the class. 18 | [super tearDown]; 19 | } 20 | 21 | - (void)testExample { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | - (void)testPerformanceExample { 27 | // This is an example of a performance test case. 28 | [self measureBlock:^{ 29 | // Put the code you want to measure the time of here. 30 | }]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /6个六斋UITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /6个六斋UITests/____UITests.m: -------------------------------------------------------------------------------- 1 | //___FILEHEADER___ 2 | 3 | #import 4 | 5 | @interface ___FILEBASENAMEASIDENTIFIER___ : XCTestCase 6 | 7 | @end 8 | 9 | @implementation ___FILEBASENAMEASIDENTIFIER___ 10 | 11 | - (void)setUp { 12 | [super setUp]; 13 | 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | self.continueAfterFailure = NO; 18 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 19 | [[[XCUIApplication alloc] init] launch]; 20 | 21 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 22 | } 23 | 24 | - (void)tearDown { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample { 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform:ios,'8.0' 2 | target '6个六斋' do 3 | pod 'Masonry' 4 | pod 'Aspects' 5 | end 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DiceGame 2 | 项目使用了Cocoapods,又设置了忽略文件,所以下载的时候请自行 pod install 一下
3 | 项目主要利用CATransform3DRotate改变view的perspective来实现骰子的3D旋转功能,再进行随机数来达到摇骰子的功能
4 | 因为使用了毛玻璃,所以在模拟器的情况下会崩溃,建议真机运行,或者将毛玻璃效果(全局搜索maoboli)屏蔽即可
5 | 先附上效果图(使用liceape制作的gif,gif效果没有实际的好):
6 | ![gif](https://github.com/iOSJYF/DiceGame/raw/master/demoPic.gif)  
  7 | 8 | 实现思路 9 | ------ 10 | 首先,一个骰子为一个View,分别set 6张图片,然后分别设置对应的的CATransform3D
11 | eg:
12 | ```object-c 13 | - (UIView *)view1 14 | { 15 | if (!_view1) { 16 | _view1 = [[UIView alloc]init]; 17 | UIImageView *img = [[UIImageView alloc]init]; 18 | [img setImage:[UIImage imageNamed:@"one"]]; 19 | img.layer.allowsEdgeAntialiasing = true; 20 | [_view1 addSubview:img]; 21 | [img mas_makeConstraints:^(MASConstraintMaker *make) { 22 | make.top.left.mas_equalTo(0.3); 23 | make.bottom.right.mas_equalTo(-0.3); 24 | }]; 25 | _view1.layer.borderWidth = 1; 26 | _view1.layer.borderColor = [UIColor lightGrayColor].CGColor; 27 | _view1.layer.cornerRadius = 3; 28 | } 29 | return _view1; 30 | 31 | } 32 | ``` 33 | ```object-c 34 | [self addSubview:self.view1]; 35 | [self.view1 mas_makeConstraints:^(MASConstraintMaker *make) { 36 | make.left.right.top.bottom.mas_equalTo(0); 37 | }]; 38 | CATransform3D viewTrans = CATransform3DIdentity; 39 | viewTrans = CATransform3DRotate(view2Trans, M_PI_2, 0, 1, 0); 40 | viewTrans = CATransform3DTranslate(view2Trans, theWidth/2, 0, -theWidth/2); 41 | self.view1.layer.transform = viewTrans; 42 | ``` 43 | 最重要的,记得吧骰子所在的view的M34属性设置一下,才能看到3D效果 44 | ```object-c 45 | CATransform3D perspective = CATransform3DIdentity; 46 | perspective.m34 = -1.0/500.0; 47 | self.layer.sublayerTransform = perspective; 48 | ``` 49 | 在controller初始化骰子所在的view(diceview)的时候,记得设置一下3d角度,便于观察 50 | ```object-c 51 | CATransform3D perspective1 = CATransform3DIdentity; 52 | perspective1.m34 = -1/500; 53 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4 + M_PI_2, 1, 0, 0); 54 | perspective1 = CATransform3DRotate(perspective1, -M_PI_4, 0, 0, 1); 55 | perspective1 = CATransform3DTranslate(perspective1, 0, 0, 25); 56 | self.diceView.layer.sublayerTransform = perspective1; 57 | ``` 58 | 然后点击的时候,创建了一个timer,让CATransform3DRotate改变,从而达到骰子3D翻转的效果 59 | ```object-c 60 | - (void)timerAction 61 | { 62 | 63 | self.theNum += 0.35; 64 | 65 | CATransform3D perspective = CATransform3DIdentity; 66 | perspective.m34 = -1.0/500.0; 67 | 68 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 69 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 70 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 71 | 72 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 73 | self.diceView.layer.sublayerTransform = perspective; 74 | 75 | } 76 | ``` 77 | 再次点击的时候创建先停止之前的timer,然后做另外一个timer的Action,一开始脑子没转过来,总是想着让骰子摇到特定的角度,后来思路一通,先是用随机数随机出一个数,然后再让骰子做动画听到那个点数 78 | ```object-c 79 | - (void)timer2Action 80 | { 81 | self.Num1 = self.Num1 - 0.025; 82 | if (self.Num1 > 0) { 83 | CATransform3D perspective = CATransform3DIdentity; 84 | perspective.m34 = -1.0/500.0; 85 | switch (self.onPoint) { 86 | case 0: 87 | { 88 | // 1 的情况 89 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 - self.Num1, 1, 0, 0); 90 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 91 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.roundPoint -self.Num1, 0, 0, 1); 92 | } 93 | break; 94 | case 1: 95 | { 96 | // 2 的情况 97 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 98 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.roundPoint - self.Num1, 0, 1, 0); 99 | perspective = CATransform3DRotate(perspective, M_PI_2 - self.Num1, 0, 0, 1); 100 | 101 | } 102 | break; 103 | case 2: 104 | { 105 | // 3 的情况 106 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * 2 - self.Num1, 1, 0, 0); 107 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.roundPoint, 0, 1, 0); 108 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 109 | 110 | } 111 | break; 112 | case 3: 113 | { 114 | // 4 的情况 115 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 116 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1 + M_PI_2 * self.roundPoint, 0, 1, 0); 117 | perspective = CATransform3DRotate(perspective, - self.Num1, 0, 0, 1); 118 | 119 | } 120 | break; 121 | case 4: 122 | { 123 | // 5 的情况 124 | perspective = CATransform3DRotate(perspective, -M_PI_4 - self.Num1, 1, 0, 0); 125 | perspective = CATransform3DRotate(perspective, -M_PI_4 + M_PI_2 * self.roundPoint - self.Num1, 0, 1, 0); 126 | perspective = CATransform3DRotate(perspective, -M_PI_2 - self.Num1, 0, 0, 1); 127 | 128 | } 129 | break; 130 | case 5: 131 | { 132 | // 6 的情况 133 | perspective = CATransform3DRotate(perspective, -M_PI_4 - M_PI_2 - self.Num1, 1, 0, 0); 134 | perspective = CATransform3DRotate(perspective, -self.Num1 , 0, 1, 0); 135 | perspective = CATransform3DRotate(perspective, M_PI_4 + M_PI_2 * self.roundPoint -self.Num1, 0, 0, 1); 136 | } 137 | break; 138 | 139 | default: 140 | break; 141 | } 142 | 143 | perspective = CATransform3DTranslate(perspective, 0, 0, 25 ); 144 | self.diceView.layer.sublayerTransform = perspective; 145 | 146 | }else{ 147 | [self.timer2 setFireDate:[NSDate distantFuture]]; 148 | self.thetag = 0; 149 | } 150 | } 151 | ``` 152 | 最后有多个骰子存在的情况下,加了动画改进,让5个骰子做旋转动画,一开始想到的是用贝塞尔曲线实现,后来尝试 153 | 了一下利用CATransform3DRotate只改变Z的数值,发现这种方法也可行,然后再加上一个坐标往center的动画,效果出来就很炫酷了 154 | ```object-c 155 | - (void)timerAction 156 | { 157 | self.zTrans += M_PI_2*8/125; 158 | self.theNum += 0.35; 159 | CATransform3D perspective = CATransform3DIdentity; 160 | perspective.m34 = -1.0/500.0; 161 | perspective = CATransform3DRotate(perspective, self.theNum, 1, 0, 0); 162 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 1, 0); 163 | perspective = CATransform3DRotate(perspective, self.theNum, 0, 0, 1); 164 | perspective = CATransform3DTranslate(perspective, 0, 0, 25); 165 | self.diceView.layer.sublayerTransform = perspective; 166 | self.diceView1.layer.sublayerTransform = perspective; 167 | self.diceView2.layer.sublayerTransform = perspective; 168 | self.diceView3.layer.sublayerTransform = perspective; 169 | self.diceView4.layer.sublayerTransform = perspective; 170 | 171 | CATransform3D perspective1 = CATransform3DIdentity; 172 | perspective1 = CATransform3DRotate(perspective1, self.zTrans, 0, 0, 1); 173 | self.layer.sublayerTransform = perspective1; 174 | 175 | } 176 | ``` 177 | 参考资料 178 | ------ 179 | 具体的知识点可以参考 《核心动画高级技巧》
180 | 附上网址:https://www.gitbook.com/book/zsisme/ios-/details 181 | -------------------------------------------------------------------------------- /demoPic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iOSJYF/DiceGame/1e235153a6d762bc2d91c0f31ba16fc4ab2a26d6/demoPic.gif --------------------------------------------------------------------------------