diff --git a/Ash_AWord.xcodeproj/project.pbxproj b/Ash_AWord.xcodeproj/project.pbxproj index 90904ae..e0899cf 100644 --- a/Ash_AWord.xcodeproj/project.pbxproj +++ b/Ash_AWord.xcodeproj/project.pbxproj @@ -8,6 +8,26 @@ /* Begin PBXBuildFile section */ 018BA697D81ADF73A75A2345 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7B8559E65B4108EA2C3F343 /* libPods.a */; }; + A93441DE1ACA311700A6B233 /* Ash_UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A93441DD1ACA311700A6B233 /* Ash_UIUtil.m */; }; + A93441E11ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441DF1ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png */; }; + A93441E21ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E01ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png */; }; + A93441E51ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E31ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png */; }; + A93441E61ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E41ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png */; }; + A93441E91ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E71ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png */; }; + A93441EA1ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E81ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png */; }; + A93441ED1ACA8C8F00A6B233 /* defaultUserIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441EB1ACA8C8F00A6B233 /* defaultUserIcon.png */; }; + A93441EE1ACA8C8F00A6B233 /* defaultUserIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441EC1ACA8C8F00A6B233 /* defaultUserIcon@2x.png */; }; + A93441F11ACA916D00A6B233 /* tabbarQuotation@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441EF1ACA916C00A6B233 /* tabbarQuotation@2x.png */; }; + A93441F21ACA916D00A6B233 /* tabbarQuotationClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441F01ACA916D00A6B233 /* tabbarQuotationClick@2x.png */; }; + A93441F61ACA918100A6B233 /* tabbarSetup-dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441F31ACA918100A6B233 /* tabbarSetup-dark@2x.png */; }; + A93441F71ACA918100A6B233 /* tabbarSetup@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441F41ACA918100A6B233 /* tabbarSetup@2x.png */; }; + A93441F81ACA918100A6B233 /* tabbarSetupClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441F51ACA918100A6B233 /* tabbarSetupClick@2x.png */; }; + A93441FA1ACA919500A6B233 /* tabbarQuotation-dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441F91ACA919500A6B233 /* tabbarQuotation-dark@2x.png */; }; + A93441FE1ACA919F00A6B233 /* tabbarVoice-dark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441FB1ACA919F00A6B233 /* tabbarVoice-dark@2x.png */; }; + A93441FF1ACA919F00A6B233 /* tabbarVoice@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441FC1ACA919F00A6B233 /* tabbarVoice@2x.png */; }; + A93442001ACA919F00A6B233 /* tabbarVoiceClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441FD1ACA919F00A6B233 /* tabbarVoiceClick@2x.png */; }; + A93442031ACA981D00A6B233 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93442011ACA981D00A6B233 /* Default-568h@2x.png */; }; + A93442041ACA981D00A6B233 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93442021ACA981D00A6B233 /* Default@2x.png */; }; A95510921AC39E6A0006D16F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A95510911AC39E6A0006D16F /* main.m */; }; A95510951AC39E6A0006D16F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A95510941AC39E6A0006D16F /* AppDelegate.m */; }; A95510981AC39E6A0006D16F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A95510971AC39E6A0006D16F /* ViewController.m */; }; @@ -34,6 +54,20 @@ A97C55061AC933AD0038818A /* UMSnsAccountViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FA1AC933AD0038818A /* UMSnsAccountViewController.xib */; }; A97C55071AC933AD0038818A /* UMSShareListController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FB1AC933AD0038818A /* UMSShareListController.xib */; }; A97C55081AC933AD0038818A /* UMSocialSDKResourcesNew.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FC1AC933AD0038818A /* UMSocialSDKResourcesNew.bundle */; }; + A97DBE331ACAE10800705682 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A97DBE311ACAE10800705682 /* LoginViewController.m */; }; + A97DBE341ACAE10800705682 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE321ACAE10800705682 /* LoginViewController.xib */; }; + A97DBE3B1ACAE29E00705682 /* Icon-Small-50.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE351ACAE29E00705682 /* Icon-Small-50.png */; }; + A97DBE3C1ACAE29E00705682 /* Icon-Small-50@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE361ACAE29E00705682 /* Icon-Small-50@2x.png */; }; + A97DBE3D1ACAE29E00705682 /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE371ACAE29E00705682 /* Icon-Small.png */; }; + A97DBE3E1ACAE29E00705682 /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE381ACAE29E00705682 /* Icon-Small@2x.png */; }; + A97DBE3F1ACAE29E00705682 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE391ACAE29E00705682 /* Icon.png */; }; + A97DBE401ACAE29E00705682 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE3A1ACAE29E00705682 /* Icon@2x.png */; }; + A97DBE421ACAE4E300705682 /* first-login-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE411ACAE4E300705682 /* first-login-icon.png */; }; + A97DBE441ACAE61400705682 /* first-login-qq@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE431ACAE61400705682 /* first-login-qq@2x.png */; }; + A97DBE461ACAE7B500705682 /* iconWeixin@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE451ACAE7B500705682 /* iconWeixin@2x.png */; }; + A97DBE481ACAE7F600705682 /* smalliconWeixin@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE471ACAE7F600705682 /* smalliconWeixin@2x.png */; }; + A97DBE4C1ACAEBE300705682 /* first-login-sina@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE4B1ACAEBE300705682 /* first-login-sina@2x.png */; }; + A97DBE4E1ACAED4900705682 /* camera-close-select@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE4D1ACAED4900705682 /* camera-close-select@2x.png */; }; A98F98521ACA29B5007C4594 /* libSocialQQ.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F98481ACA29B5007C4594 /* libSocialQQ.a */; }; A98F98531ACA29B5007C4594 /* TencentOpenAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F98491ACA29B5007C4594 /* TencentOpenAPI.framework */; }; A98F98541ACA29B5007C4594 /* TencentOpenApi_IOS_Bundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A98F984A1ACA29B5007C4594 /* TencentOpenApi_IOS_Bundle.bundle */; }; @@ -47,6 +81,8 @@ A98F98621ACA2A8E007C4594 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F98611ACA2A8E007C4594 /* CoreTelephony.framework */; }; A98F98641ACA2A95007C4594 /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F98631ACA2A95007C4594 /* libstdc++.dylib */; }; A98F98661ACA2A9F007C4594 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F98651ACA2A9F007C4594 /* libz.dylib */; }; + A98F986B1ACA2FA9007C4594 /* BaseRefreshViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A98F98691ACA2FA9007C4594 /* BaseRefreshViewController.m */; }; + A98F986C1ACA2FA9007C4594 /* BaseRefreshViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A98F986A1ACA2FA9007C4594 /* BaseRefreshViewController.xib */; }; A9B4E39F1AC9908E00A1DBDF /* libMobClickLibrary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B4E39C1AC9908E00A1DBDF /* libMobClickLibrary.a */; }; A9FAD4221AC922A5007ADC10 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9FAD4201AC922A5007ADC10 /* MainViewController.m */; }; A9FAD4231AC922A5007ADC10 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9FAD4211AC922A5007ADC10 /* MainViewController.xib */; }; @@ -61,6 +97,27 @@ /* Begin PBXFileReference section */ 93C9ED3E7E1041224C33AED5 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + A93441DC1ACA311700A6B233 /* Ash_UIUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ash_UIUtil.h; sourceTree = ""; }; + A93441DD1ACA311700A6B233 /* Ash_UIUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Ash_UIUtil.m; sourceTree = ""; }; + A93441DF1ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_voiceIcon@2x.png"; sourceTree = ""; }; + A93441E01ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_voiceIconClick@2x.png"; sourceTree = ""; }; + A93441E31ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_contentIcon@2x.png"; sourceTree = ""; }; + A93441E41ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_contentIconClick@2x.png"; sourceTree = ""; }; + A93441E71ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_ImageIcon@2x.png"; sourceTree = ""; }; + A93441E81ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_ImageIconClick@2x.png"; sourceTree = ""; }; + A93441EB1ACA8C8F00A6B233 /* defaultUserIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = defaultUserIcon.png; sourceTree = ""; }; + A93441EC1ACA8C8F00A6B233 /* defaultUserIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "defaultUserIcon@2x.png"; sourceTree = ""; }; + A93441EF1ACA916C00A6B233 /* tabbarQuotation@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarQuotation@2x.png"; sourceTree = ""; }; + A93441F01ACA916D00A6B233 /* tabbarQuotationClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarQuotationClick@2x.png"; sourceTree = ""; }; + A93441F31ACA918100A6B233 /* tabbarSetup-dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarSetup-dark@2x.png"; sourceTree = ""; }; + A93441F41ACA918100A6B233 /* tabbarSetup@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarSetup@2x.png"; sourceTree = ""; }; + A93441F51ACA918100A6B233 /* tabbarSetupClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarSetupClick@2x.png"; sourceTree = ""; }; + A93441F91ACA919500A6B233 /* tabbarQuotation-dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarQuotation-dark@2x.png"; sourceTree = ""; }; + A93441FB1ACA919F00A6B233 /* tabbarVoice-dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarVoice-dark@2x.png"; sourceTree = ""; }; + A93441FC1ACA919F00A6B233 /* tabbarVoice@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarVoice@2x.png"; sourceTree = ""; }; + A93441FD1ACA919F00A6B233 /* tabbarVoiceClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabbarVoiceClick@2x.png"; sourceTree = ""; }; + A93442011ACA981D00A6B233 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + A93442021ACA981D00A6B233 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; A955108C1AC39E6A0006D16F /* Ash_AWord.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ash_AWord.app; sourceTree = BUILT_PRODUCTS_DIR; }; A95510901AC39E6A0006D16F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A95510911AC39E6A0006D16F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -116,6 +173,21 @@ A97C54FB1AC933AD0038818A /* UMSShareListController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UMSShareListController.xib; sourceTree = ""; }; A97C54FC1AC933AD0038818A /* UMSocialSDKResourcesNew.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = UMSocialSDKResourcesNew.bundle; sourceTree = ""; }; A97C54FD1AC933AD0038818A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/UMSocialLocalizable.strings"; sourceTree = ""; }; + A97DBE301ACAE10800705682 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = ""; }; + A97DBE311ACAE10800705682 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = ""; }; + A97DBE321ACAE10800705682 /* LoginViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = ""; }; + A97DBE351ACAE29E00705682 /* Icon-Small-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small-50.png"; sourceTree = ""; }; + A97DBE361ACAE29E00705682 /* Icon-Small-50@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small-50@2x.png"; sourceTree = ""; }; + A97DBE371ACAE29E00705682 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small.png"; sourceTree = ""; }; + A97DBE381ACAE29E00705682 /* Icon-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small@2x.png"; sourceTree = ""; }; + A97DBE391ACAE29E00705682 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; + A97DBE3A1ACAE29E00705682 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; + A97DBE411ACAE4E300705682 /* first-login-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "first-login-icon.png"; sourceTree = ""; }; + A97DBE431ACAE61400705682 /* first-login-qq@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "first-login-qq@2x.png"; sourceTree = ""; }; + A97DBE451ACAE7B500705682 /* iconWeixin@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iconWeixin@2x.png"; sourceTree = ""; }; + A97DBE471ACAE7F600705682 /* smalliconWeixin@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "smalliconWeixin@2x.png"; sourceTree = ""; }; + A97DBE4B1ACAEBE300705682 /* first-login-sina@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "first-login-sina@2x.png"; sourceTree = ""; }; + A97DBE4D1ACAED4900705682 /* camera-close-select@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "camera-close-select@2x.png"; sourceTree = ""; }; A98F98481ACA29B5007C4594 /* libSocialQQ.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSocialQQ.a; sourceTree = ""; }; A98F98491ACA29B5007C4594 /* TencentOpenAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = TencentOpenAPI.framework; sourceTree = ""; }; A98F984A1ACA29B5007C4594 /* TencentOpenApi_IOS_Bundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TencentOpenApi_IOS_Bundle.bundle; sourceTree = ""; }; @@ -133,6 +205,9 @@ A98F98611ACA2A8E007C4594 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; A98F98631ACA2A95007C4594 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; }; A98F98651ACA2A9F007C4594 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + A98F98681ACA2FA9007C4594 /* BaseRefreshViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseRefreshViewController.h; sourceTree = ""; }; + A98F98691ACA2FA9007C4594 /* BaseRefreshViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseRefreshViewController.m; sourceTree = ""; }; + A98F986A1ACA2FA9007C4594 /* BaseRefreshViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BaseRefreshViewController.xib; sourceTree = ""; }; A9B4E39C1AC9908E00A1DBDF /* libMobClickLibrary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMobClickLibrary.a; sourceTree = ""; }; A9B4E39D1AC9908E00A1DBDF /* MobClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobClick.h; sourceTree = ""; }; A9B4E39E1AC9908E00A1DBDF /* MobClickSocialAnalytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobClickSocialAnalytics.h; sourceTree = ""; }; @@ -251,6 +326,8 @@ A97C54B71AC8F0370038818A /* ViewControllers */ = { isa = PBXGroup; children = ( + A97DBE2F1ACAE0F100705682 /* Login */, + A98F98671ACA2F27007C4594 /* Common */, A9FAD41E1AC92293007ADC10 /* Main */, ); path = ViewControllers; @@ -343,6 +420,8 @@ children = ( A97C54DF1AC91DA10038818A /* CommonUtil.h */, A97C54E01AC91DA10038818A /* CommonUtil.m */, + A93441DC1ACA311700A6B233 /* Ash_UIUtil.h */, + A93441DD1ACA311700A6B233 /* Ash_UIUtil.m */, ); path = Tool; sourceTree = ""; @@ -350,6 +429,37 @@ A97C54E21AC91FD70038818A /* Resource */ = { isa = PBXGroup; children = ( + A97DBE4D1ACAED4900705682 /* camera-close-select@2x.png */, + A97DBE471ACAE7F600705682 /* smalliconWeixin@2x.png */, + A97DBE451ACAE7B500705682 /* iconWeixin@2x.png */, + A97DBE431ACAE61400705682 /* first-login-qq@2x.png */, + A97DBE4B1ACAEBE300705682 /* first-login-sina@2x.png */, + A97DBE411ACAE4E300705682 /* first-login-icon.png */, + A97DBE351ACAE29E00705682 /* Icon-Small-50.png */, + A97DBE361ACAE29E00705682 /* Icon-Small-50@2x.png */, + A97DBE371ACAE29E00705682 /* Icon-Small.png */, + A97DBE381ACAE29E00705682 /* Icon-Small@2x.png */, + A97DBE391ACAE29E00705682 /* Icon.png */, + A97DBE3A1ACAE29E00705682 /* Icon@2x.png */, + A93442011ACA981D00A6B233 /* Default-568h@2x.png */, + A93442021ACA981D00A6B233 /* Default@2x.png */, + A93441F31ACA918100A6B233 /* tabbarSetup-dark@2x.png */, + A93441F41ACA918100A6B233 /* tabbarSetup@2x.png */, + A93441F51ACA918100A6B233 /* tabbarSetupClick@2x.png */, + A93441EF1ACA916C00A6B233 /* tabbarQuotation@2x.png */, + A93441F91ACA919500A6B233 /* tabbarQuotation-dark@2x.png */, + A93441F01ACA916D00A6B233 /* tabbarQuotationClick@2x.png */, + A93441FB1ACA919F00A6B233 /* tabbarVoice-dark@2x.png */, + A93441FC1ACA919F00A6B233 /* tabbarVoice@2x.png */, + A93441FD1ACA919F00A6B233 /* tabbarVoiceClick@2x.png */, + A93441EB1ACA8C8F00A6B233 /* defaultUserIcon.png */, + A93441EC1ACA8C8F00A6B233 /* defaultUserIcon@2x.png */, + A93441E71ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png */, + A93441E81ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png */, + A93441E31ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png */, + A93441E41ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png */, + A93441DF1ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png */, + A93441E01ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png */, ); path = Resource; sourceTree = ""; @@ -399,6 +509,16 @@ path = SocialSDKXib; sourceTree = ""; }; + A97DBE2F1ACAE0F100705682 /* Login */ = { + isa = PBXGroup; + children = ( + A97DBE301ACAE10800705682 /* LoginViewController.h */, + A97DBE311ACAE10800705682 /* LoginViewController.m */, + A97DBE321ACAE10800705682 /* LoginViewController.xib */, + ); + path = Login; + sourceTree = ""; + }; A98F98461ACA29B5007C4594 /* UMSocial_Sdk_Extra_Frameworks */ = { isa = PBXGroup; children = ( @@ -431,6 +551,16 @@ path = Wechat; sourceTree = ""; }; + A98F98671ACA2F27007C4594 /* Common */ = { + isa = PBXGroup; + children = ( + A98F98681ACA2FA9007C4594 /* BaseRefreshViewController.h */, + A98F98691ACA2FA9007C4594 /* BaseRefreshViewController.m */, + A98F986A1ACA2FA9007C4594 /* BaseRefreshViewController.xib */, + ); + path = Common; + sourceTree = ""; + }; A9B4E39B1AC9908E00A1DBDF /* UMAnalytics_Sdk_3.4.6 */ = { isa = PBXGroup; children = ( @@ -545,24 +675,57 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A93442001ACA919F00A6B233 /* tabbarVoiceClick@2x.png in Resources */, A97C55001AC933AD0038818A /* UMSCommentDetailController.xib in Resources */, + A93441F21ACA916D00A6B233 /* tabbarQuotationClick@2x.png in Resources */, + A93442031ACA981D00A6B233 /* Default-568h@2x.png in Resources */, A9FAD4321AC923FC007ADC10 /* MyViewController.xib in Resources */, + A93441FF1ACA919F00A6B233 /* tabbarVoice@2x.png in Resources */, + A93441FA1ACA919500A6B233 /* tabbarQuotation-dark@2x.png in Resources */, A955109B1AC39E6A0006D16F /* Main.storyboard in Resources */, + A97DBE3F1ACAE29E00705682 /* Icon.png in Resources */, + A97DBE3D1ACAE29E00705682 /* Icon-Small.png in Resources */, + A93441ED1ACA8C8F00A6B233 /* defaultUserIcon.png in Resources */, + A97DBE461ACAE7B500705682 /* iconWeixin@2x.png in Resources */, A97C55071AC933AD0038818A /* UMSShareListController.xib in Resources */, + A93441EE1ACA8C8F00A6B233 /* defaultUserIcon@2x.png in Resources */, A97C54FE1AC933AD0038818A /* UMSocialLocalizable.strings in Resources */, + A93441E91ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png in Resources */, A97C55041AC933AD0038818A /* UMShareEditViewControlleriPad.xib in Resources */, A98F98541ACA29B5007C4594 /* TencentOpenApi_IOS_Bundle.bundle in Resources */, A95510A01AC39E6A0006D16F /* LaunchScreen.xib in Resources */, + A93442041ACA981D00A6B233 /* Default@2x.png in Resources */, + A97DBE401ACAE29E00705682 /* Icon@2x.png in Resources */, + A97DBE481ACAE7F600705682 /* smalliconWeixin@2x.png in Resources */, + A97DBE441ACAE61400705682 /* first-login-qq@2x.png in Resources */, A9FAD42D1AC923E2007ADC10 /* MessageViewController.xib in Resources */, + A98F986C1ACA2FA9007C4594 /* BaseRefreshViewController.xib in Resources */, A955109D1AC39E6A0006D16F /* Images.xcassets in Resources */, + A97DBE4C1ACAEBE300705682 /* first-login-sina@2x.png in Resources */, A9FAD4281AC922BE007ADC10 /* NoteViewController.xib in Resources */, + A93441E61ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png in Resources */, + A93441E11ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png in Resources */, A97C55031AC933AD0038818A /* UMShareEditViewController.xib in Resources */, + A97DBE4E1ACAED4900705682 /* camera-close-select@2x.png in Resources */, + A93441E21ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png in Resources */, + A97DBE3C1ACAE29E00705682 /* Icon-Small-50@2x.png in Resources */, A97C55061AC933AD0038818A /* UMSnsAccountViewController.xib in Resources */, + A93441F71ACA918100A6B233 /* tabbarSetup@2x.png in Resources */, A97C55011AC933AD0038818A /* UMSCommentInputController.xib in Resources */, + A93441F81ACA918100A6B233 /* tabbarSetupClick@2x.png in Resources */, + A93441FE1ACA919F00A6B233 /* tabbarVoice-dark@2x.png in Resources */, + A93441E51ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png in Resources */, A9FAD4231AC922A5007ADC10 /* MainViewController.xib in Resources */, + A93441F61ACA918100A6B233 /* tabbarSetup-dark@2x.png in Resources */, + A97DBE421ACAE4E300705682 /* first-login-icon.png in Resources */, + A97DBE3E1ACAE29E00705682 /* Icon-Small@2x.png in Resources */, A97C55051AC933AD0038818A /* UMSLoginViewController.xib in Resources */, A97C55081AC933AD0038818A /* UMSocialSDKResourcesNew.bundle in Resources */, + A97DBE341ACAE10800705682 /* LoginViewController.xib in Resources */, + A93441EA1ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png in Resources */, + A97DBE3B1ACAE29E00705682 /* Icon-Small-50.png in Resources */, A97C55021AC933AD0038818A /* UMSCommentInputControlleriPad.xib in Resources */, + A93441F11ACA916D00A6B233 /* tabbarQuotation@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -610,7 +773,9 @@ A97C54D31AC8F10F0038818A /* XiaoYuAPIClient.m in Sources */, A9FAD4311AC923FC007ADC10 /* MyViewController.m in Sources */, A97C54DD1AC901980038818A /* MBProgressHUD+Util.m in Sources */, + A97DBE331ACAE10800705682 /* LoginViewController.m in Sources */, A95510981AC39E6A0006D16F /* ViewController.m in Sources */, + A98F986B1ACA2FA9007C4594 /* BaseRefreshViewController.m in Sources */, A97C54D21AC8F10F0038818A /* AFgzipResponseSerializer.m in Sources */, A9FAD4221AC922A5007ADC10 /* MainViewController.m in Sources */, A9FAD42C1AC923E2007ADC10 /* MessageViewController.m in Sources */, @@ -619,6 +784,7 @@ A95510951AC39E6A0006D16F /* AppDelegate.m in Sources */, A97C54D11AC8F10F0038818A /* RequireEngine.m in Sources */, A97C54D01AC8F10F0038818A /* PropertyEntity.m in Sources */, + A93441DE1ACA311700A6B233 /* Ash_UIUtil.m in Sources */, A97C54D41AC8F10F0038818A /* XMFishBaseCode.m in Sources */, A97C54E11AC91DA10038818A /* CommonUtil.m in Sources */, A9FAD4351AC925AC007ADC10 /* LoginViewModel.m in Sources */, diff --git a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index ed9a9b4..3da2e4f 100644 --- a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,4 +2,86 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/AppDelegate.h b/Ash_AWord/AppDelegate.h index b2066f9..b4828a5 100644 --- a/Ash_AWord/AppDelegate.h +++ b/Ash_AWord/AppDelegate.h @@ -7,10 +7,14 @@ // #import +@class MainViewController; +@interface AppDelegate : UIResponder +{ + MainViewController* _mainViewController; -@interface AppDelegate : UIResponder - +} @property (strong, nonatomic) UIWindow *window; +@property (strong, nonatomic) MainViewController* mainViewController; @end diff --git a/Ash_AWord/AppDelegate.m b/Ash_AWord/AppDelegate.m index 104bf8e..11b6576 100644 --- a/Ash_AWord/AppDelegate.m +++ b/Ash_AWord/AppDelegate.m @@ -11,6 +11,7 @@ #import "UMSocialWechatHandler.h" #import "UMSocialQQHandler.h" #import "MobClick.h" +#import "MainViewController.h" @interface AppDelegate () @end @@ -20,6 +21,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. + + _mainViewController = [[MainViewController alloc] init]; + self.window.rootViewController = _mainViewController; + _mainViewController.delegate = self; + + [self setUmeng]; + return YES; } @@ -45,6 +53,24 @@ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url +{ + return [UMSocialSnsService handleOpenURL:url]; +} +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + annotation:(id)annotation +{ + return [UMSocialSnsService handleOpenURL:url]; +} + +#pragma mark - UITabBarController +- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController +{ + return YES; +} + #pragma mark methods -(void)setUmeng { diff --git a/Ash_AWord/Base.lproj/LaunchScreen.xib b/Ash_AWord/Base.lproj/LaunchScreen.xib index 3c03369..103db8f 100644 --- a/Ash_AWord/Base.lproj/LaunchScreen.xib +++ b/Ash_AWord/Base.lproj/LaunchScreen.xib @@ -1,7 +1,8 @@ - + - + + diff --git a/Ash_AWord/Info.plist b/Ash_AWord/Info.plist index 337fbc5..1a19649 100644 --- a/Ash_AWord/Info.plist +++ b/Ash_AWord/Info.plist @@ -12,6 +12,8 @@ 6.0 CFBundleName $(PRODUCT_NAME) + CFBundleDisplayName + OneWord CFBundlePackageType APPL CFBundleShortVersionString @@ -20,6 +22,30 @@ ???? CFBundleVersion 1 + CFBundleIconFiles + + Icon@2x + Icon + + CFBundleURLTypes + + + CFBundleURLName + QQ + CFBundleURLSchemes + + QQ41CEC6B9 + + + + CFBundleURLName + tencent + CFBundleURLSchemes + + tencent1104070329 + + + LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/Ash_AWord/PrefixHeader.pch b/Ash_AWord/PrefixHeader.pch index e1795b9..764733f 100644 --- a/Ash_AWord/PrefixHeader.pch +++ b/Ash_AWord/PrefixHeader.pch @@ -25,6 +25,9 @@ #import "Common.h" #import "MBProgressHUD+Util.h" #import "CommonUtil.h" + #import "Ash_UIUtil.h" + #import "PropertyEntity.h" + #import "RequireEngine.h" #endif #endif diff --git a/Ash_AWord/Resource/Default-568h@2x.png b/Ash_AWord/Resource/Default-568h@2x.png new file mode 100644 index 0000000..7e72ff3 Binary files /dev/null and b/Ash_AWord/Resource/Default-568h@2x.png differ diff --git a/Ash_AWord/Resource/Default@2x.png b/Ash_AWord/Resource/Default@2x.png new file mode 100644 index 0000000..20fdd60 Binary files /dev/null and b/Ash_AWord/Resource/Default@2x.png differ diff --git a/Ash_AWord/Resource/Icon-Small-50.png b/Ash_AWord/Resource/Icon-Small-50.png new file mode 100644 index 0000000..1fbc53b Binary files /dev/null and b/Ash_AWord/Resource/Icon-Small-50.png differ diff --git a/Ash_AWord/Resource/Icon-Small-50@2x.png b/Ash_AWord/Resource/Icon-Small-50@2x.png new file mode 100644 index 0000000..881b667 Binary files /dev/null and b/Ash_AWord/Resource/Icon-Small-50@2x.png differ diff --git a/Ash_AWord/Resource/Icon-Small.png b/Ash_AWord/Resource/Icon-Small.png new file mode 100644 index 0000000..7d2e339 Binary files /dev/null and b/Ash_AWord/Resource/Icon-Small.png differ diff --git a/Ash_AWord/Resource/Icon-Small@2x.png b/Ash_AWord/Resource/Icon-Small@2x.png new file mode 100644 index 0000000..83106e8 Binary files /dev/null and b/Ash_AWord/Resource/Icon-Small@2x.png differ diff --git a/Ash_AWord/Resource/Icon.png b/Ash_AWord/Resource/Icon.png new file mode 100644 index 0000000..83106e8 Binary files /dev/null and b/Ash_AWord/Resource/Icon.png differ diff --git a/Ash_AWord/Resource/Icon@2x.png b/Ash_AWord/Resource/Icon@2x.png new file mode 100644 index 0000000..0152449 Binary files /dev/null and b/Ash_AWord/Resource/Icon@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_ImageIcon@2x.png b/Ash_AWord/Resource/Profile_filter_ImageIcon@2x.png new file mode 100644 index 0000000..82a5e8d Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_ImageIcon@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_ImageIconClick@2x.png b/Ash_AWord/Resource/Profile_filter_ImageIconClick@2x.png new file mode 100644 index 0000000..fc61c36 Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_ImageIconClick@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_contentIcon@2x.png b/Ash_AWord/Resource/Profile_filter_contentIcon@2x.png new file mode 100644 index 0000000..e218bbd Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_contentIcon@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_contentIconClick@2x.png b/Ash_AWord/Resource/Profile_filter_contentIconClick@2x.png new file mode 100644 index 0000000..0e86570 Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_contentIconClick@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_voiceIcon@2x.png b/Ash_AWord/Resource/Profile_filter_voiceIcon@2x.png new file mode 100644 index 0000000..2615c4e Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_voiceIcon@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_voiceIconClick@2x.png b/Ash_AWord/Resource/Profile_filter_voiceIconClick@2x.png new file mode 100644 index 0000000..414d3b5 Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_voiceIconClick@2x.png differ diff --git a/Ash_AWord/Resource/camera-close-select@2x.png b/Ash_AWord/Resource/camera-close-select@2x.png new file mode 100644 index 0000000..da047f2 Binary files /dev/null and b/Ash_AWord/Resource/camera-close-select@2x.png differ diff --git a/Ash_AWord/Resource/defaultUserIcon.png b/Ash_AWord/Resource/defaultUserIcon.png new file mode 100644 index 0000000..cc179ce Binary files /dev/null and b/Ash_AWord/Resource/defaultUserIcon.png differ diff --git a/Ash_AWord/Resource/defaultUserIcon@2x.png b/Ash_AWord/Resource/defaultUserIcon@2x.png new file mode 100644 index 0000000..8449f8b Binary files /dev/null and b/Ash_AWord/Resource/defaultUserIcon@2x.png differ diff --git a/Ash_AWord/Resource/first-login-icon.png b/Ash_AWord/Resource/first-login-icon.png new file mode 100644 index 0000000..2d8d840 Binary files /dev/null and b/Ash_AWord/Resource/first-login-icon.png differ diff --git a/Ash_AWord/Resource/first-login-qq@2x.png b/Ash_AWord/Resource/first-login-qq@2x.png new file mode 100644 index 0000000..6017316 Binary files /dev/null and b/Ash_AWord/Resource/first-login-qq@2x.png differ diff --git a/Ash_AWord/Resource/first-login-sina@2x.png b/Ash_AWord/Resource/first-login-sina@2x.png new file mode 100644 index 0000000..4cb0974 Binary files /dev/null and b/Ash_AWord/Resource/first-login-sina@2x.png differ diff --git a/Ash_AWord/Resource/iconWeixin@2x.png b/Ash_AWord/Resource/iconWeixin@2x.png new file mode 100644 index 0000000..28ead6f Binary files /dev/null and b/Ash_AWord/Resource/iconWeixin@2x.png differ diff --git a/Ash_AWord/Resource/smalliconWeixin@2x.png b/Ash_AWord/Resource/smalliconWeixin@2x.png new file mode 100644 index 0000000..bdd73c0 Binary files /dev/null and b/Ash_AWord/Resource/smalliconWeixin@2x.png differ diff --git a/Ash_AWord/Resource/tabbarQuotation-dark@2x.png b/Ash_AWord/Resource/tabbarQuotation-dark@2x.png new file mode 100644 index 0000000..5a5d44c Binary files /dev/null and b/Ash_AWord/Resource/tabbarQuotation-dark@2x.png differ diff --git a/Ash_AWord/Resource/tabbarQuotation@2x.png b/Ash_AWord/Resource/tabbarQuotation@2x.png new file mode 100644 index 0000000..b6049a5 Binary files /dev/null and b/Ash_AWord/Resource/tabbarQuotation@2x.png differ diff --git a/Ash_AWord/Resource/tabbarQuotationClick@2x.png b/Ash_AWord/Resource/tabbarQuotationClick@2x.png new file mode 100644 index 0000000..472fc43 Binary files /dev/null and b/Ash_AWord/Resource/tabbarQuotationClick@2x.png differ diff --git a/Ash_AWord/Resource/tabbarSetup-dark@2x.png b/Ash_AWord/Resource/tabbarSetup-dark@2x.png new file mode 100644 index 0000000..8fe3905 Binary files /dev/null and b/Ash_AWord/Resource/tabbarSetup-dark@2x.png differ diff --git a/Ash_AWord/Resource/tabbarSetup@2x.png b/Ash_AWord/Resource/tabbarSetup@2x.png new file mode 100644 index 0000000..87dd120 Binary files /dev/null and b/Ash_AWord/Resource/tabbarSetup@2x.png differ diff --git a/Ash_AWord/Resource/tabbarSetupClick@2x.png b/Ash_AWord/Resource/tabbarSetupClick@2x.png new file mode 100644 index 0000000..2e2dfc7 Binary files /dev/null and b/Ash_AWord/Resource/tabbarSetupClick@2x.png differ diff --git a/Ash_AWord/Resource/tabbarVoice-dark@2x.png b/Ash_AWord/Resource/tabbarVoice-dark@2x.png new file mode 100644 index 0000000..1b7115e Binary files /dev/null and b/Ash_AWord/Resource/tabbarVoice-dark@2x.png differ diff --git a/Ash_AWord/Resource/tabbarVoice@2x.png b/Ash_AWord/Resource/tabbarVoice@2x.png new file mode 100644 index 0000000..c75dab1 Binary files /dev/null and b/Ash_AWord/Resource/tabbarVoice@2x.png differ diff --git a/Ash_AWord/Resource/tabbarVoiceClick@2x.png b/Ash_AWord/Resource/tabbarVoiceClick@2x.png new file mode 100644 index 0000000..028297d Binary files /dev/null and b/Ash_AWord/Resource/tabbarVoiceClick@2x.png differ diff --git a/Ash_AWord/Utility/Network/BaseViewModel.h b/Ash_AWord/Utility/Network/BaseViewModel.h index f6be791..d7590d1 100644 --- a/Ash_AWord/Utility/Network/BaseViewModel.h +++ b/Ash_AWord/Utility/Network/BaseViewModel.h @@ -11,7 +11,7 @@ @interface BaseViewModel : MTLModel -@property (nonatomic, readonly) NSNumber *errCode; +@property (nonatomic, readonly) NSInteger errCode; @property (nonatomic, readonly) NSString *errMessage; - (BOOL)success; diff --git a/Ash_AWord/Utility/Network/BaseViewModel.m b/Ash_AWord/Utility/Network/BaseViewModel.m index ddc320f..30afac8 100644 --- a/Ash_AWord/Utility/Network/BaseViewModel.m +++ b/Ash_AWord/Utility/Network/BaseViewModel.m @@ -11,7 +11,7 @@ @implementation BaseViewModel + (NSDictionary *)JSONKeyPathsByPropertyKey { return @{ - @"errCode": @"errCode", + @"errCode": @"ret", @"errMessage": @"errMessage", }; } @@ -27,12 +27,12 @@ - (BOOL)success { - return ([self.errCode integerValue] == 0); + return (self.errCode == 0); } - (BOOL)needLogin { - return ([self.errCode integerValue] == 1001); + return (self.errCode == 1001); } @end diff --git a/Ash_AWord/Utility/Tool/Ash_UIUtil.h b/Ash_AWord/Utility/Tool/Ash_UIUtil.h new file mode 100644 index 0000000..9593bcb --- /dev/null +++ b/Ash_AWord/Utility/Tool/Ash_UIUtil.h @@ -0,0 +1,223 @@ +// +// Ash_UIUtil.h +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import + +@interface Ash_UIUtil : NSObject +/** + * 通过类名出创建xib类 + */ ++(id)instanceXibView:(NSString*)xibName; +/** + * 等分排列若干相同控件 + * 参数1:各个控件距离父视图的距离约束数组 + * 参数2:控件的自身款或者高 + * 参数3:父视图的宽度 + */ ++(void)autoArrangeWidgetsWithConstraints:(NSArray *) constraints width:(CGFloat) width containerWidth:(CGFloat) containerWidth; +/** + * 手机号码正则 + * + * @param phoneNumber 手机号 + * + * @return 是否正确 + */ ++(BOOL)phoneNumberRegularExpression:(NSString*)phoneNumber; + +/** + * 创建自定义UIBarButtonItem,用于右边 + */ ++ (UIBarButtonItem *)rightBarButtonItemWithTarget:(id)target action:(SEL)action image:(UIImage *)image; + +/** + * 创建自定义UIBarButtonItem,用于左边 + */ ++ (UIBarButtonItem *)leftBarButtonItemWithTarget:(id)target action:(SEL)action image:(UIImage *)image; + ++ (CGFloat)currentScreenSizeRate; + +/** + * 创建导航栏顶部的搜索框 + * + * @param title placeholder + * + * @return searchBar + */ ++ (UISearchBar *)navigationItemSearchBarWithPlaceholder:(NSString *)title; + +/** + * 防止相机获取相片图片旋转 + * + * @param aImage 修改前的图片 + * + * @return 正常的相片 + */ ++ (UIImage *)fixOrientation:(UIImage *)aImage; + +/** + * 压缩图片到屏幕大小 + * + * @param originImage原图 + * @return 压缩后的图片 + */ ++(UIImage*)compressImageDownToPhoneScreenSize:(UIImage*)originImage; +@end + +@interface UIFont (CustomFont) + ++ (UIFont *)appFontOfSize:(CGFloat)size; + ++ (UIFont *)appBoldFontOfSize:(CGFloat)size; + +@end + +@interface UIColor (CustomColor) + +/** + * 十六进制数转换UIColor + * 例如: 0x123456 + */ ++ (UIColor *)colorWithHex:(UInt32)col alpha:(CGFloat)alpha; + +/** + * 十六进制字符串转换UIColor + * 例如: @"#123456" + */ ++ (UIColor *)colorWithHexString:(NSString *)str alpha:(CGFloat)alpha; + + +/** + * app风格主色 + */ ++ (UIColor *)appMainColor; ++ (UIColor *)appMainColorAlpha:(CGFloat)alpha; + +/** + * 导航背景颜色 + */ ++ (UIColor *)appNavBackgroundColor; + +/** + * Table页面背景颜色 + */ ++ (UIColor *)appTableBackgroundColor; + +/** + * 所有UIViewController统一的背景颜色 + */ ++ (UIColor *)genenalBackgroudColor; + +/** + * 按钮颜色:蓝绿色 + */ ++ (UIColor *)buttonMainColor; + +/** + * 按钮颜色:浅灰色 + */ ++ (UIColor *)buttonSubColor; + +/** + * 按钮文字颜色:黑色,配合的按钮颜色:buttonMainColor + */ ++ (UIColor *)buttonTextColor; + +/** + * 按钮文字颜色:灰色,配合的按钮颜色:buttonSubColor + */ ++ (UIColor *)buttonTextSubColor; + +/** + * 所有页面统一的字体颜色 + */ ++ (UIColor *)textColor; + +/** + * 所有页面统一的字体次颜色 + */ ++ (UIColor *)textSubColor; + +/** + * 按钮描边颜色 + */ ++ (UIColor *)buttonBorderColor; +/** + * 线条颜色 + */ ++ (UIColor *)lineColor; + +//首页顶部类型选择中间线条颜色 ++ (UIColor *)lineColor2; + +//首页顶部类型选择文字灰颜色 ++ (UIColor *)textSubColor2; + +//首页顶部类型选择背景颜色 ++ (UIColor *)homeBackgroundColor2; + +//searchBar的背景颜色 ++ (UIColor *)searchBarColor; + +//搜索按钮的颜色 ++ (UIColor *)searchButtonColor; + +//头部视图的背景 ++(UIColor *)headerBackgroundColor; + +//图片默认颜色 ++ (UIColor *)imagePlaceholderColor; +@end + +@interface UIImage(custom) + ++ (UIImage *)imageWithColor:(UIColor *)color; ++ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)imageSize; + +@end + +@interface UIButton(custom) ++ (UIButton *)buttonWithImageName:(NSString *)imageName; +- (void)setImageWithColor:(UIColor *)color; + +/** + * 设置background颜色:buttonMainColor,字体颜色:buttonTextColor + */ +- (void)setWithMainColor; + +- (void)setWithMainColorAndDefaultBorderColor; + +/** + * 设置button title color为正常颜色的alpha0.5值效果 + */ +- (void)setDefaultHighlitedTitleColor; + +/** + * 设置background颜色:buttonSubColor,字体颜色:buttonTextSubColor + */ +- (void)setWithSubColor; + +@end + +@interface UIWebView(userAgent) + +/** + * 每次程序重启将被系统重置默认的useragent + *如果需要自定义添加ua,需在每次启动程序执行此方法 + */ ++ (void)addUserAgent; +@end + + +@interface UIViewController(customViewController) + +/** + * 通用的自定义:比如背景色、iOS7适配等,在viewDidLoad之后调用 + */ +- (void)customViewDidLoad; + +@end diff --git a/Ash_AWord/Utility/Tool/Ash_UIUtil.m b/Ash_AWord/Utility/Tool/Ash_UIUtil.m new file mode 100644 index 0000000..bad9893 --- /dev/null +++ b/Ash_AWord/Utility/Tool/Ash_UIUtil.m @@ -0,0 +1,515 @@ +// +// Ash_UIUtil.m +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "Ash_UIUtil.h" + +@implementation Ash_UIUtil + ++ (id)instanceXibView:(NSString*)xibName +{ + NSArray* nibView = [[NSBundle mainBundle] loadNibNamed:xibName owner:nil options:nil]; + return [nibView objectAtIndex:0]; +} + ++ (void)autoArrangeWidgetsWithConstraints:(NSArray *) constraints width:(CGFloat) width containerWidth:(CGFloat) containerWidth +{ + CGFloat step = (containerWidth - (width * constraints.count)) / (constraints.count + 1); + for (int i = 0; i < constraints.count; i ++) + { + NSLayoutConstraint * constraint = constraints[i]; + constraint.constant = step * (i + 1) + (width * i); + } +} + ++(BOOL)phoneNumberRegularExpression:(NSString*)phoneNumber +{ + NSError *error; + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^1([3578][0-9]|45|47)[0-9]{8}" options:0 error:&error]; + + if (phoneNumber !=nil) + { + //从urlString中截取数据 + NSTextCheckingResult *firstMatch = [regex firstMatchInString:phoneNumber options:0 range:NSMakeRange(0, [phoneNumber length])]; + + NSRange resultRange = [firstMatch rangeAtIndex:0]; + //从urlString中截取数据 + NSString *result = [phoneNumber substringWithRange:resultRange]; + + if([result isEqualToString:@""]||![result isEqualToString:phoneNumber]) + { + return NO; + } + else + { + return YES; + } + } + else + { + return NO; + } +} + ++ (UIBarButtonItem *)rightBarButtonItemWithTarget:(id)target action:(SEL)action image:(UIImage *)image +{ + UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)]; + [btn setImage:image forState:UIControlStateNormal]; + [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; + + if (iOSVersion >= 7.0) + { + btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -15); + } + + UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:btn]; + return barItem; +} + ++ (UIBarButtonItem *)leftBarButtonItemWithTarget:(id)target action:(SEL)action image:(UIImage *)image +{ + UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)]; + [btn setImage:image forState:UIControlStateNormal]; + [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; + + if (iOSVersion >= 7.0) + { + btn.imageEdgeInsets = UIEdgeInsetsMake(0, -15, 0, 0); + } + + UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:btn]; + return barItem; +} + ++ (UISearchBar *)navigationItemSearchBarWithPlaceholder:(NSString *)title +{ + UISearchBar *search = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 0, 40)]; + search.tintColor = [UIColor appMainColor]; + search.placeholder = title; + search.barStyle = UIBarStyleDefault; + [search setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]]]; + + //修改searchBar的输入框的背景色 + for(UIView *view in search.subviews) + { + for (UIView *subView in view.subviews) + { + if ([subView isKindOfClass:[UITextField class]]) + { + [(UITextField *)subView setBackgroundColor:[UIColor searchBarColor]]; + } + } + } + return search; +} + +/** + * 防止相机获取相片图片旋转 + * + * @param aImage 修改前的图片 + * + * @return 正常的相片 + */ ++ (UIImage *)fixOrientation:(UIImage *)aImage { + + // No-op if the orientation is already correct + if (aImage.imageOrientation == UIImageOrientationUp) + return aImage; + + // We need to calculate the proper transformation to make the image upright. + // We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored. + CGAffineTransform transform = CGAffineTransformIdentity; + + switch (aImage.imageOrientation) { + case UIImageOrientationDown: + case UIImageOrientationDownMirrored: + transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height); + transform = CGAffineTransformRotate(transform, M_PI); + break; + + case UIImageOrientationLeft: + case UIImageOrientationLeftMirrored: + transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); + transform = CGAffineTransformRotate(transform, M_PI_2); + break; + + case UIImageOrientationRight: + case UIImageOrientationRightMirrored: + transform = CGAffineTransformTranslate(transform, 0, aImage.size.height); + transform = CGAffineTransformRotate(transform, -M_PI_2); + break; + default: + break; + } + + switch (aImage.imageOrientation) { + case UIImageOrientationUpMirrored: + case UIImageOrientationDownMirrored: + transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); + transform = CGAffineTransformScale(transform, -1, 1); + break; + + case UIImageOrientationLeftMirrored: + case UIImageOrientationRightMirrored: + transform = CGAffineTransformTranslate(transform, aImage.size.height, 0); + transform = CGAffineTransformScale(transform, -1, 1); + break; + default: + break; + } + + // Now we draw the underlying CGImage into a new context, applying the transform + // calculated above. + CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height, + CGImageGetBitsPerComponent(aImage.CGImage), 0, + CGImageGetColorSpace(aImage.CGImage), + CGImageGetBitmapInfo(aImage.CGImage)); + CGContextConcatCTM(ctx, transform); + switch (aImage.imageOrientation) { + case UIImageOrientationLeft: + case UIImageOrientationLeftMirrored: + case UIImageOrientationRight: + case UIImageOrientationRightMirrored: + // Grr... + CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage); + break; + + default: + CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage); + break; + } + + // And now we just create a new UIImage from the drawing context + CGImageRef cgimg = CGBitmapContextCreateImage(ctx); + UIImage *img = [UIImage imageWithCGImage:cgimg]; + CGContextRelease(ctx); + CGImageRelease(cgimg); + return img; +} + ++(UIImage*)compressImageDownToPhoneScreenSize:(UIImage*)theImage{ + + UIImage * bigImage = theImage; + + float actualHeight = bigImage.size.height; + float actualWidth = bigImage.size.width; + float radio = 1.0; + float pixel = 2048*1536; + float pixelImg = actualHeight*actualWidth; + + if (pixelImg>pixel) + { + actualWidth = actualWidth*pixel/pixelImg; + actualHeight = actualHeight*pixel/pixelImg; + } + // if (actualHeight > kScreenHeight) + // { + // + // actualWidth = actualWidth*(kScreenHeight/actualHeight); + // actualHeight = kScreenHeight; + // }else if(actualWidth > kScreenWidth) + // { + // + // actualHeight = actualHeight*(kScreenWidth/actualWidth); + // actualWidth = kScreenWidth; + // } + + CGRect rect = CGRectMake(0.0, 0.0, actualWidth*radio, actualHeight*radio); + UIGraphicsBeginImageContext(rect.size); + [bigImage drawInRect:rect]; // scales image to rect + theImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + //RETURN + return theImage; +} +/** + * 获取当前屏幕与4寸屏幕比例 + * 4寸返回1.0 + * 4.7返回1.17185 + * 5.5寸返回1.29375 + */ ++ (CGFloat)currentScreenSizeRate +{ + return kScreenWidth/320; +} + +@end + +@implementation UIFont (CustomFont) + ++ (UIFont *)appFontOfSize:(CGFloat)size +{ + return [UIFont systemFontOfSize:size]; +} + ++ (UIFont *)appBoldFontOfSize:(CGFloat)size +{ + return [UIFont boldSystemFontOfSize:size]; +} + +@end + +@implementation UIColor (CustomColor) + +// 例如: @"#123456" ++ (UIColor *)colorWithHexString:(NSString *)str alpha:(CGFloat)alpha +{ + const char *cStr = [str cStringUsingEncoding:NSASCIIStringEncoding]; + UInt32 x = (UInt32)strtol(cStr+1, NULL, 16); + return [UIColor colorWithHex:x alpha:alpha]; +} + +// 例如 0x123456 ++ (UIColor *)colorWithHex:(UInt32)col alpha:(CGFloat)alpha +{ + unsigned char r, g, b; + b = col & 0xFF; + g = (col >> 8) & 0xFF; + r = (col >> 16) & 0xFF; + return [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:alpha]; +} + ++ (UIColor *)appMainColor +{ + return [UIColor appMainColorAlpha:1]; +} + ++(UIColor *)searchBarColor +{ + return [UIColor colorWithHexString:@"#f3f3f3" alpha:1]; +} + ++(UIColor *)searchButtonColor +{ + return [UIColor colorWithHexString:@"#f6f6f6" alpha:1]; +} + ++(UIColor *)headerBackgroundColor +{ + return [UIColor colorWithHexString:@"#F6F6F6" alpha:1]; +} + ++ (UIColor *)appMainColorAlpha:(CGFloat)alpha +{ + return [UIColor colorWithHexString:@"#68d430" alpha:1]; +} + ++ (UIColor *)appNavBackgroundColor +{ + return [UIColor whiteColor]; +} + ++(UIColor *)appTableBackgroundColor +{ + return [UIColor whiteColor]; +} +/** + * 按钮颜色:蓝绿色 + */ ++ (UIColor *)buttonMainColor +{ + return [UIColor appMainColorAlpha:1]; +} + +/** + * 按钮颜色:浅灰色 + */ ++ (UIColor *)buttonSubColor +{ + return [UIColor colorWithHexString:@"#e5e5e5" alpha:1]; +} + +/** + * 按钮文字颜色:黑色,配合的按钮颜色:buttonMainColor + */ ++ (UIColor *)buttonTextColor +{ + return [UIColor whiteColor]; +} + +/** + * 按钮文字颜色:灰色,配合的按钮颜色:buttonSubColor + */ ++ (UIColor *)buttonTextSubColor +{ + return [UIColor colorWithHexString:@"#7d7d7d" alpha:1]; +} + +/** + * 页面背景颜色 + */ ++ (UIColor *)genenalBackgroudColor +{ + return [UIColor colorWithHexString:@"#f3f3f3" alpha:1]; +} + +/** + * 所有页面统一的字体颜色 + */ ++ (UIColor *)textColor +{ + return [UIColor blackColor]; +} + +/** + * 所有页面统一的字体次颜色 + */ ++ (UIColor *)textSubColor +{ + return [UIColor colorWithHexString:@"#7d7d7d" alpha:1]; +} + ++ (UIColor *)buttonBorderColor +{ + return [UIColor colorWithHexString:@"#eeeeee" alpha:1]; +} ++ (UIColor *)lineColor +{ + return [UIColor colorWithHexString:@"#dcdcdc" alpha:1]; +} + ++ (UIColor *)lineColor2 +{ + return [UIColor colorWithHexString:@"#535353" alpha:1]; +} + ++ (UIColor *)textSubColor2 +{ + return [UIColor colorWithHexString:@"#898989" alpha:1]; +} + ++ (UIColor *)homeBackgroundColor2 +{ + return [UIColor colorWithHexString:@"#434343" alpha:1]; +} + ++ (UIColor *)imagePlaceholderColor +{ + return [UIColor colorWithHexString:@"#e5e5e5" alpha:1]; +} + +@end + +@implementation UIImage(custom) + ++ (UIImage *)imageWithColor:(UIColor *)color +{ + return [UIImage imageWithColor:color size:CGSizeMake(1, 1)]; +} + ++ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)imageSize +{ + UIGraphicsBeginImageContextWithOptions(imageSize, 0, [UIScreen mainScreen].scale); + [color set]; + UIRectFill(CGRectMake(0, 0, imageSize.width, imageSize.height)); + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} +@end + +@implementation UIButton(custom) + ++ (UIButton *)buttonWithImageName:(NSString *)imageName +{ + UIImage *back = [UIImage imageNamed:imageName]; + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, back.size.width, back.size.height)]; + [button setBackgroundImage:back forState:UIControlStateNormal]; + return button; +} + +- (void)setImageWithColor:(UIColor *)color +{ + [self setBackgroundImage:[UIImage imageWithColor:color] forState:UIControlStateNormal]; + // [self setBackgroundImage:[UIImage imageWithColor:[UIColor pressedBrownColor]] forState:UIControlStateHighlighted]; + // [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [self.layer setMasksToBounds:YES]; + [self.layer setCornerRadius:3]; +} + +/** + * 设置background颜色:buttonMainColor,字体颜色:buttonTextColor + */ +- (void)setWithMainColor +{ + [self setBackgroundImage:[UIImage imageWithColor:[UIColor buttonMainColor]] forState:UIControlStateNormal]; + [self setTitleColor:[UIColor buttonTextColor] forState:UIControlStateNormal]; + [self.layer setMasksToBounds:YES]; + [self.layer setCornerRadius:3]; +} + +- (void)setWithMainColorAndDefaultBorderColor +{ + [self setWithMainColor]; + self.layer.borderWidth = 1; + self.layer.borderColor = [UIColor buttonBorderColor].CGColor; +} + +- (void)setDefaultHighlitedTitleColor +{ + UIColor *color = self.titleLabel.textColor; + [self setTitleColor:[color colorWithAlphaComponent:0.3] forState:UIControlStateHighlighted]; +} + +/** + * 设置background颜色:buttonSubColor,字体颜色:buttonTextSubColor + */ +- (void)setWithSubColor +{ + [self setBackgroundImage:[UIImage imageWithColor:[UIColor buttonSubColor]] forState:UIControlStateNormal]; + [self setTitleColor:[UIColor buttonTextSubColor] forState:UIControlStateNormal]; + [self.layer setMasksToBounds:YES]; + [self.layer setCornerRadius:3]; +} + +@end + +@implementation UIViewController(customViewController) + +- (void)customViewDidLoad +{ + self.view.backgroundColor = [UIColor genenalBackgroudColor]; + self.navigationController.view.backgroundColor = [UIColor appNavBackgroundColor]; + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + if (iOS7AndLater) + { + self.edgesForExtendedLayout = UIRectEdgeNone; + self.extendedLayoutIncludesOpaqueBars = NO; + self.modalPresentationCapturesStatusBarAppearance = NO; + self.navigationController.navigationBar.translucent = NO; + self.tabBarController.tabBar.translucent = NO; + } +#endif +} + + +@end + +@implementation UIWebView(userAgent) + ++ (void)addUserAgent +{ + NSString *oldAgent = [[[UIWebView alloc] init] stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"]; + + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; + NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; + NSString *buildVersion = [infoDictionary objectForKey:@"CFBundleVersion"]; + NSString *version = [NSString stringWithFormat:@"%@.%@",appVersion, buildVersion]; + NSString *userAgentP1 = @"ufun/"; + NSString *myAgent = [NSString stringWithFormat:@" %@%@", userAgentP1, version]; + + NSRange range = [oldAgent rangeOfString:userAgentP1]; + if (range.location == NSNotFound) + { + NSString *newAgent = [oldAgent stringByAppendingString:myAgent]; + NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:newAgent, @"UserAgent", newAgent, @"User-Agent", nil]; + [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary]; + } +} +@end diff --git a/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.h b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.h new file mode 100644 index 0000000..b2edf4e --- /dev/null +++ b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.h @@ -0,0 +1,21 @@ +// +// BaseRefreshViewController.h +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "ViewController.h" + +@interface BaseRefreshViewController : ViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; + + +- (void)headerRereshing; +- (void)footerRereshing; +- (void)headerBeginRefreshing; +- (void)headerEndRefreshing; +- (void)footerBeginRefreshing; +- (void)footerEndRefreshing; +@end diff --git a/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.m b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.m new file mode 100644 index 0000000..94a4e90 --- /dev/null +++ b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.m @@ -0,0 +1,80 @@ +// +// BaseRefreshViewController.m +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "BaseRefreshViewController.h" +#import "MJRefresh.h" + +@interface BaseRefreshViewController () + +@end + +@implementation BaseRefreshViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + + self.tableView.delegate = self; + self.tableView.dataSource = self; + [self.tableView addGifHeaderWithRefreshingTarget:self refreshingAction:@selector(headerRereshing)]; + [self.tableView addGifFooterWithRefreshingTarget:self refreshingAction:@selector(footerRereshing)]; + [self customViewDidLoad]; + self.tableView.separatorColor = [UIColor clearColor]; +} + +#pragma mark MJRefreshDelegate +- (void)headerRereshing +{ + +} + +- (void)footerRereshing +{ + +} +- (void)headerBeginRefreshing +{ + [self.tableView.header beginRefreshing]; +} +-(void)headerEndRefreshing +{ + [self.tableView.header endRefreshing]; +} +-(void)footerBeginRefreshing +{ + [self.tableView.footer beginRefreshing]; +} +-(void)footerEndRefreshing +{ + [self.tableView.footer endRefreshing]; +} +#pragma mark UITableViewDelegate +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 0; +} +-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return nil; +} +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.xib b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.xib new file mode 100644 index 0000000..edacb5d --- /dev/null +++ b/Ash_AWord/ViewControllers/Common/BaseRefreshViewController.xib @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/ViewControllers/Login/LoginViewController.h b/Ash_AWord/ViewControllers/Login/LoginViewController.h new file mode 100644 index 0000000..4b119ea --- /dev/null +++ b/Ash_AWord/ViewControllers/Login/LoginViewController.h @@ -0,0 +1,13 @@ +// +// LoginViewController.h +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import + +@interface LoginViewController : UIViewController + +@end diff --git a/Ash_AWord/ViewControllers/Login/LoginViewController.m b/Ash_AWord/ViewControllers/Login/LoginViewController.m new file mode 100644 index 0000000..7b4e10d --- /dev/null +++ b/Ash_AWord/ViewControllers/Login/LoginViewController.m @@ -0,0 +1,37 @@ +// +// LoginViewController.m +// Ash_AWord +// +// Created by xmfish on 15/3/31. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "LoginViewController.h" + +@interface LoginViewController () + +@end + +@implementation LoginViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Ash_AWord/ViewControllers/Login/LoginViewController.xib b/Ash_AWord/ViewControllers/Login/LoginViewController.xib new file mode 100644 index 0000000..2579e37 --- /dev/null +++ b/Ash_AWord/ViewControllers/Login/LoginViewController.xib @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.h b/Ash_AWord/ViewControllers/Main/MainViewController.h index 84c829b..aa5c552 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.h +++ b/Ash_AWord/ViewControllers/Main/MainViewController.h @@ -8,6 +8,6 @@ #import "ViewController.h" -@interface MainViewController : ViewController +@interface MainViewController : UITabBarController @end diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.m b/Ash_AWord/ViewControllers/Main/MainViewController.m index 02b1b49..eaf9523 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.m +++ b/Ash_AWord/ViewControllers/Main/MainViewController.m @@ -7,6 +7,9 @@ // #import "MainViewController.h" +#import "NoteViewController.h" +#import "MessageViewController.h" +#import "MyViewController.h" @interface MainViewController () @@ -19,6 +22,18 @@ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization + UINavigationController* _noteNav = [[UINavigationController alloc] initWithRootViewController:[[NoteViewController alloc] init]]; + UINavigationController* _messageNav = [[UINavigationController alloc] initWithRootViewController:[[MessageViewController alloc] init]]; + UINavigationController* _myNav = [[UINavigationController alloc] initWithRootViewController:[[MyViewController alloc] init]]; + if (iOS7AndLater) { + [_noteNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"文字" image:[UIImage imageNamed:@"tabbarQuotation-dark"] selectedImage:[UIImage imageNamed:@"tabbarQuotationClick"]]]; + + [_messageNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"声音" image:[UIImage imageNamed:@"tabbarVoice-dark"] selectedImage:[UIImage imageNamed:@"tabbarVoiceClick"]]]; + + [_myNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"我的" image:[UIImage imageNamed:@"tabbarSetup-dark"] selectedImage:[UIImage imageNamed:@"tabbarSetupClick"]]]; + } + + self.viewControllers = @[_noteNav, _messageNav, _myNav]; } return self; } @@ -27,6 +42,9 @@ { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. + + [[UITableViewHeaderFooterView appearance] setTintColor:[UIColor clearColor]]; + [[UITabBar appearance] setTintColor:[UIColor blackColor]]; } - (void)didReceiveMemoryWarning diff --git a/Ash_AWord/ViewControllers/Main/MyViewController.h b/Ash_AWord/ViewControllers/Main/MyViewController.h index 85b3e19..cab72e7 100644 --- a/Ash_AWord/ViewControllers/Main/MyViewController.h +++ b/Ash_AWord/ViewControllers/Main/MyViewController.h @@ -8,6 +8,7 @@ #import "ViewController.h" -@interface MyViewController : ViewController +@interface MyViewController : ViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; @end diff --git a/Ash_AWord/ViewControllers/Main/MyViewController.m b/Ash_AWord/ViewControllers/Main/MyViewController.m index 69c3bcb..b75e64c 100644 --- a/Ash_AWord/ViewControllers/Main/MyViewController.m +++ b/Ash_AWord/ViewControllers/Main/MyViewController.m @@ -7,9 +7,12 @@ // #import "MyViewController.h" - +#import "UMSocial.h" +#import "LoginViewModel.h" @interface MyViewController () - +{ + NSArray* cellTitleArr; +} @end @implementation MyViewController @@ -23,12 +26,109 @@ return self; } + - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. + + self.navigationItem.title = @"我的"; + _tableView.delegate = self; + _tableView.dataSource = self; } +#pragma mark UITableViewDelegate +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 5; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 1; +} +-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString* cellIdentifier = @"cell"; + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; + } + switch (indexPath.section) { + case 0: + { + cell.textLabel.text = @"登录"; + } + break; + case 1: + { + cell.textLabel.text = @"我发表的文字"; + } + break; + case 2: + { + cell.textLabel.text = @"我发表的声音"; + } + break; + case 3: + { + cell.textLabel.text = @"清楚缓存"; + } + break; + case 4: + { + cell.textLabel.text = @"推荐给朋友"; + } + break; + default: + break; + } + return cell; +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + switch (indexPath.section) { + case 0: + { + UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToQQ]; + + snsPlatform.loginClickHandler(self,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){ + + // 获取微博用户名、uid、token等 + + if (response.responseCode == UMSResponseCodeSuccess) { + + UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToQQ]; + [MBProgressHUD hudWithView:self.view label:@"登录中"]; + NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL); + [[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToQQ completion:^(UMSocialResponseEntity *response){ + NSLog(@"SnsInformation is %@",response.data); + if (response.data) { + [self loginWithOpenId:[response.data objectForKey:@"openid"] withName:[response.data objectForKey:@"screen_name"] withGender:[response.data objectForKey:@"gender"] withFigureUrl:[response.data objectForKey:@"profile_image_url"]]; + }else{ + [MBProgressHUD errorHudWithView:self.view label:@"信息获取失败,重新授权" hidesAfter:1.0]; + } + }]; + + }}); + } + break; + + default: + break; + } +} + +-(void)loginWithOpenId:(NSString*)openId withName:(NSString*)name withGender:(NSString*)gender withFigureUrl:(NSString*)figureUrl; +{ + PropertyEntity* loginViewModel = [LoginViewModel requireLoginWithOpenId:openId withName:name withGender:gender withFigureUrl:figureUrl]; + [RequireEngine requireWithProperty:loginViewModel completionBlock:^(id viewModel) { + LoginViewModel* loginViewModel = (LoginViewModel*)viewModel; + + } failedBlock:^(NSError *error) { + + }]; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/Ash_AWord/ViewControllers/Main/MyViewController.xib b/Ash_AWord/ViewControllers/Main/MyViewController.xib index c181fe3..69797d9 100644 --- a/Ash_AWord/ViewControllers/Main/MyViewController.xib +++ b/Ash_AWord/ViewControllers/Main/MyViewController.xib @@ -1,11 +1,13 @@ - + - + + + @@ -13,9 +15,24 @@ + + + + + + - - + + + + + + + + + + + diff --git a/Ash_AWord/ViewModels/LoginViewModel.h b/Ash_AWord/ViewModels/LoginViewModel.h index c415805..ab989d7 100644 --- a/Ash_AWord/ViewModels/LoginViewModel.h +++ b/Ash_AWord/ViewModels/LoginViewModel.h @@ -10,4 +10,7 @@ @interface LoginViewModel : BaseViewModel +@property (nonatomic, strong) NSString* uId; //用户id。 + ++ (PropertyEntity *)requireLoginWithOpenId:(NSString*)openId withName:(NSString*)name withGender:(NSString*)gender withFigureUrl:(NSString*)figureUrl; @end diff --git a/Ash_AWord/ViewModels/LoginViewModel.m b/Ash_AWord/ViewModels/LoginViewModel.m index d525806..a963b21 100644 --- a/Ash_AWord/ViewModels/LoginViewModel.m +++ b/Ash_AWord/ViewModels/LoginViewModel.m @@ -10,4 +10,33 @@ @implementation LoginViewModel ++ (NSDictionary *)JSONKeyPathsByPropertyKey { + return @{ + @"uId": @"uid", + }; +} + +- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error { + self = [super initWithDictionary:dictionaryValue error:error]; + if (self == nil) return nil; + + // Store a value that needs to be determined locally upon initialization. + + return self; +} + ++(PropertyEntity*)requireLoginWithOpenId:(NSString *)openId withName:(NSString *)name withGender:(NSString *)gender withFigureUrl:(NSString *)figureUrl +{ + PropertyEntity *pro = [[PropertyEntity alloc] init]; + pro.requireType = HTTPRequestTypeWithPOST; + pro.reqURL = @"rs/login"; + pro.responesOBJ = self.class; + pro.pro = @{@"openid": openId, + @"name": name, + @"gender": gender, + @"figureurl": figureUrl + }; + + return pro; +} @end