├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Demo ├── Demo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── Demo.xcscheme │ │ └── DemoUITests.xcscheme ├── Demo │ ├── .DS_Store │ ├── AppDelegate (1).h │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── SecondViewController (1).h │ ├── SecondViewController.h │ ├── SecondViewController.m │ ├── ViewController.h │ ├── ViewController.m │ ├── dark.jpeg │ ├── light.jpeg │ ├── main.m │ ├── maps_icon (1).png │ └── maps_icon.png └── DemoUITests │ ├── DemoUITests.m │ └── Info.plist ├── FTIndicator.podspec ├── FTIndicator ├── .DS_Store ├── FTIndicator.h ├── FTIndicator.m ├── FTNotificationIndicator │ ├── FTNotificationIndicator.h │ └── FTNotificationIndicator.m ├── FTProgressIndicator │ ├── .DS_Store │ ├── FTProgressIndicator.bundle │ │ ├── ft_failure.png │ │ ├── ft_failure_dark.png │ │ ├── ft_info.png │ │ ├── ft_info_dark.png │ │ ├── ft_success.png │ │ └── ft_success_dark.png │ ├── FTProgressIndicator.h │ └── FTProgressIndicator.m └── FTToastIndicator │ ├── FTToastIndicator.h │ └── FTToastIndicator.m ├── FTNotificationIndicator.podspec ├── FTProgressIndicator.podspec ├── FTToastIndicator.podspec ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | .DS_Store 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # FTIndicator ChangeLog 2 | 3 | | Version | Date | ChangeLog | 4 | | :--------: | :--------: | :-------- | 5 | |1.0.0|2016.07.31|upload to CocoaPods| 6 | |1.0.9|2016.08.02|add status bar frame observe for notification| 7 | |1.1.0|2016-08-12|add notification tap handler thanks to Yuli Chandra| 8 | |1.1.1|2016-08-15|Add notification completion handler thanks to Yuli Chandra| 9 | |1.1.2|2016-08-15|fix bugs when no text| 10 | |1.1.3|2016-08-28|progress hud add user interaction disable| 11 | |1.1.4|2016-09-08|fix a bug where load image from bundle not working| 12 | |1.1.5|2016-09-20|fix: podspec doest not correctly link to "FTToastIndicator"| 13 | |1.1.6|2016-11-22|fix a bug of not dismissing when user back to homescreen,remove subpods| 14 | |1.1.7|2017-01-13|add NotificationIndicator only manually dismiss support| 15 | |1.1.8|2017-02-09|fix: Spinner disappearance stutters| 16 | |1.1.9|2017-03-14|Sorry I forget what it is about.| 17 | |1.2.0|2017-03-14|major fix: progress HUD doesn't show when app starts| 18 | |1.2.1|2017-07-11|fix weak issue| 19 | |1.2.2|2017-08-07|fix syntax error, may cause syntax errors for your projects| 20 | |1.2.3|2017-09-07|bqlin: fix progressView can not didmiss bug,fix issuce #8| 21 | |1.2.4|2017-09-08|bqlin - fix issues #8.| 22 | |1.2.5|2017-09-10|fix keyboard animation| 23 | |1.2.6|2017-10-25|fix not dismiss issue| 24 | |1.2.7|2018-04-10|RealBonus: FTNotification: default dismiss time| 25 | |1.2.8|2018-04-18|fix: keyboard height issue| 26 | |1.2.9|2018-05-14|change animations| 27 | 28 | 29 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5A0F5A1A1D4CAABB00FD0145 /* dark.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 5A0F5A181D4CAABB00FD0145 /* dark.jpeg */; }; 11 | 5A0F5A1B1D4CAABB00FD0145 /* light.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 5A0F5A191D4CAABB00FD0145 /* light.jpeg */; }; 12 | 5A0F5A1E1D4CBD0A00FD0145 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A0F5A1D1D4CBD0A00FD0145 /* SecondViewController.m */; }; 13 | 5A0F5A231D4CC5BD00FD0145 /* maps_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 5A0F5A221D4CC5BD00FD0145 /* maps_icon.png */; }; 14 | 5AC92BE81D4D039200949121 /* FTIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AC92BDD1D4D039200949121 /* FTIndicator.m */; }; 15 | 5AC92BE91D4D039200949121 /* FTNotificationIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AC92BE01D4D039200949121 /* FTNotificationIndicator.m */; }; 16 | 5AC92BEA1D4D039200949121 /* FTProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AC92BE31D4D039200949121 /* FTProgressIndicator.m */; }; 17 | 5AC92BEB1D4D039200949121 /* FTProgressIndicator.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 5AC92BE41D4D039200949121 /* FTProgressIndicator.bundle */; }; 18 | 5AC92BEC1D4D039200949121 /* FTToastIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AC92BE71D4D039200949121 /* FTToastIndicator.m */; }; 19 | 5AF3E7B41D4C733B00AD5EC8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF3E7B31D4C733B00AD5EC8 /* main.m */; }; 20 | 5AF3E7B71D4C733B00AD5EC8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF3E7B61D4C733B00AD5EC8 /* AppDelegate.m */; }; 21 | 5AF3E7BA1D4C733B00AD5EC8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF3E7B91D4C733B00AD5EC8 /* ViewController.m */; }; 22 | 5AF3E7BD1D4C733B00AD5EC8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5AF3E7BB1D4C733B00AD5EC8 /* Main.storyboard */; }; 23 | 5AF3E7BF1D4C733B00AD5EC8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5AF3E7BE1D4C733B00AD5EC8 /* Assets.xcassets */; }; 24 | 5AF3E7C21D4C733B00AD5EC8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5AF3E7C01D4C733B00AD5EC8 /* LaunchScreen.storyboard */; }; 25 | 5AF3E7CD1D4C733B00AD5EC8 /* DemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF3E7CC1D4C733B00AD5EC8 /* DemoUITests.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 5AF3E7C91D4C733B00AD5EC8 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 5AF3E7A71D4C733A00AD5EC8 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 5AF3E7AE1D4C733B00AD5EC8; 34 | remoteInfo = Demo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 5A0F5A181D4CAABB00FD0145 /* dark.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = dark.jpeg; sourceTree = ""; }; 40 | 5A0F5A191D4CAABB00FD0145 /* light.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = light.jpeg; sourceTree = ""; }; 41 | 5A0F5A1C1D4CBD0A00FD0145 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 42 | 5A0F5A1D1D4CBD0A00FD0145 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 43 | 5A0F5A221D4CC5BD00FD0145 /* maps_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = maps_icon.png; sourceTree = ""; }; 44 | 5AC92BDC1D4D039200949121 /* FTIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTIndicator.h; sourceTree = ""; }; 45 | 5AC92BDD1D4D039200949121 /* FTIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FTIndicator.m; sourceTree = ""; }; 46 | 5AC92BDF1D4D039200949121 /* FTNotificationIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTNotificationIndicator.h; sourceTree = ""; }; 47 | 5AC92BE01D4D039200949121 /* FTNotificationIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FTNotificationIndicator.m; sourceTree = ""; }; 48 | 5AC92BE21D4D039200949121 /* FTProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTProgressIndicator.h; sourceTree = ""; }; 49 | 5AC92BE31D4D039200949121 /* FTProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FTProgressIndicator.m; sourceTree = ""; }; 50 | 5AC92BE41D4D039200949121 /* FTProgressIndicator.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = FTProgressIndicator.bundle; sourceTree = ""; }; 51 | 5AC92BE61D4D039200949121 /* FTToastIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTToastIndicator.h; sourceTree = ""; }; 52 | 5AC92BE71D4D039200949121 /* FTToastIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FTToastIndicator.m; sourceTree = ""; }; 53 | 5AF3E7AF1D4C733B00AD5EC8 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 5AF3E7B31D4C733B00AD5EC8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 5AF3E7B51D4C733B00AD5EC8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 56 | 5AF3E7B61D4C733B00AD5EC8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 57 | 5AF3E7B81D4C733B00AD5EC8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 58 | 5AF3E7B91D4C733B00AD5EC8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 59 | 5AF3E7BC1D4C733B00AD5EC8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 60 | 5AF3E7BE1D4C733B00AD5EC8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 61 | 5AF3E7C11D4C733B00AD5EC8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 62 | 5AF3E7C31D4C733B00AD5EC8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 5AF3E7C81D4C733B00AD5EC8 /* DemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 5AF3E7CC1D4C733B00AD5EC8 /* DemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoUITests.m; sourceTree = ""; }; 65 | 5AF3E7CE1D4C733B00AD5EC8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 5AF3E7AC1D4C733B00AD5EC8 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 5AF3E7C51D4C733B00AD5EC8 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 5A0F5A211D4CC5AC00FD0145 /* DemoImages */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 5A0F5A221D4CC5BD00FD0145 /* maps_icon.png */, 90 | 5A0F5A181D4CAABB00FD0145 /* dark.jpeg */, 91 | 5A0F5A191D4CAABB00FD0145 /* light.jpeg */, 92 | ); 93 | name = DemoImages; 94 | sourceTree = ""; 95 | }; 96 | 5AC92BDB1D4D039200949121 /* FTIndicator */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 5AC92BDC1D4D039200949121 /* FTIndicator.h */, 100 | 5AC92BDD1D4D039200949121 /* FTIndicator.m */, 101 | 5AC92BDE1D4D039200949121 /* FTNotificationIndicator */, 102 | 5AC92BE11D4D039200949121 /* FTProgressIndicator */, 103 | 5AC92BE51D4D039200949121 /* FTToastIndicator */, 104 | ); 105 | name = FTIndicator; 106 | path = ../../FTIndicator; 107 | sourceTree = ""; 108 | }; 109 | 5AC92BDE1D4D039200949121 /* FTNotificationIndicator */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 5AC92BDF1D4D039200949121 /* FTNotificationIndicator.h */, 113 | 5AC92BE01D4D039200949121 /* FTNotificationIndicator.m */, 114 | ); 115 | path = FTNotificationIndicator; 116 | sourceTree = ""; 117 | }; 118 | 5AC92BE11D4D039200949121 /* FTProgressIndicator */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 5AC92BE21D4D039200949121 /* FTProgressIndicator.h */, 122 | 5AC92BE31D4D039200949121 /* FTProgressIndicator.m */, 123 | 5AC92BE41D4D039200949121 /* FTProgressIndicator.bundle */, 124 | ); 125 | path = FTProgressIndicator; 126 | sourceTree = ""; 127 | }; 128 | 5AC92BE51D4D039200949121 /* FTToastIndicator */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 5AC92BE61D4D039200949121 /* FTToastIndicator.h */, 132 | 5AC92BE71D4D039200949121 /* FTToastIndicator.m */, 133 | ); 134 | path = FTToastIndicator; 135 | sourceTree = ""; 136 | }; 137 | 5AF3E7A61D4C733A00AD5EC8 = { 138 | isa = PBXGroup; 139 | children = ( 140 | 5AF3E7B11D4C733B00AD5EC8 /* Demo */, 141 | 5AF3E7CB1D4C733B00AD5EC8 /* DemoUITests */, 142 | 5AF3E7B01D4C733B00AD5EC8 /* Products */, 143 | ); 144 | sourceTree = ""; 145 | }; 146 | 5AF3E7B01D4C733B00AD5EC8 /* Products */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 5AF3E7AF1D4C733B00AD5EC8 /* Demo.app */, 150 | 5AF3E7C81D4C733B00AD5EC8 /* DemoUITests.xctest */, 151 | ); 152 | name = Products; 153 | sourceTree = ""; 154 | }; 155 | 5AF3E7B11D4C733B00AD5EC8 /* Demo */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 5AF3E7B51D4C733B00AD5EC8 /* AppDelegate.h */, 159 | 5AF3E7B61D4C733B00AD5EC8 /* AppDelegate.m */, 160 | 5AF3E7B81D4C733B00AD5EC8 /* ViewController.h */, 161 | 5AF3E7B91D4C733B00AD5EC8 /* ViewController.m */, 162 | 5A0F5A1C1D4CBD0A00FD0145 /* SecondViewController.h */, 163 | 5A0F5A1D1D4CBD0A00FD0145 /* SecondViewController.m */, 164 | 5AC92BDB1D4D039200949121 /* FTIndicator */, 165 | 5A0F5A211D4CC5AC00FD0145 /* DemoImages */, 166 | 5AF3E7BB1D4C733B00AD5EC8 /* Main.storyboard */, 167 | 5AF3E7BE1D4C733B00AD5EC8 /* Assets.xcassets */, 168 | 5AF3E7C01D4C733B00AD5EC8 /* LaunchScreen.storyboard */, 169 | 5AF3E7C31D4C733B00AD5EC8 /* Info.plist */, 170 | 5AF3E7B21D4C733B00AD5EC8 /* Supporting Files */, 171 | ); 172 | path = Demo; 173 | sourceTree = ""; 174 | }; 175 | 5AF3E7B21D4C733B00AD5EC8 /* Supporting Files */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 5AF3E7B31D4C733B00AD5EC8 /* main.m */, 179 | ); 180 | name = "Supporting Files"; 181 | sourceTree = ""; 182 | }; 183 | 5AF3E7CB1D4C733B00AD5EC8 /* DemoUITests */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 5AF3E7CC1D4C733B00AD5EC8 /* DemoUITests.m */, 187 | 5AF3E7CE1D4C733B00AD5EC8 /* Info.plist */, 188 | ); 189 | path = DemoUITests; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | 5AF3E7AE1D4C733B00AD5EC8 /* Demo */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 5AF3E7D11D4C733B00AD5EC8 /* Build configuration list for PBXNativeTarget "Demo" */; 198 | buildPhases = ( 199 | 5AF3E7AB1D4C733B00AD5EC8 /* Sources */, 200 | 5AF3E7AC1D4C733B00AD5EC8 /* Frameworks */, 201 | 5AF3E7AD1D4C733B00AD5EC8 /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | ); 207 | name = Demo; 208 | productName = Demo; 209 | productReference = 5AF3E7AF1D4C733B00AD5EC8 /* Demo.app */; 210 | productType = "com.apple.product-type.application"; 211 | }; 212 | 5AF3E7C71D4C733B00AD5EC8 /* DemoUITests */ = { 213 | isa = PBXNativeTarget; 214 | buildConfigurationList = 5AF3E7D41D4C733B00AD5EC8 /* Build configuration list for PBXNativeTarget "DemoUITests" */; 215 | buildPhases = ( 216 | 5AF3E7C41D4C733B00AD5EC8 /* Sources */, 217 | 5AF3E7C51D4C733B00AD5EC8 /* Frameworks */, 218 | 5AF3E7C61D4C733B00AD5EC8 /* Resources */, 219 | ); 220 | buildRules = ( 221 | ); 222 | dependencies = ( 223 | 5AF3E7CA1D4C733B00AD5EC8 /* PBXTargetDependency */, 224 | ); 225 | name = DemoUITests; 226 | productName = DemoUITests; 227 | productReference = 5AF3E7C81D4C733B00AD5EC8 /* DemoUITests.xctest */; 228 | productType = "com.apple.product-type.bundle.ui-testing"; 229 | }; 230 | /* End PBXNativeTarget section */ 231 | 232 | /* Begin PBXProject section */ 233 | 5AF3E7A71D4C733A00AD5EC8 /* Project object */ = { 234 | isa = PBXProject; 235 | attributes = { 236 | LastUpgradeCheck = 0930; 237 | ORGANIZATIONNAME = liufengting; 238 | TargetAttributes = { 239 | 5AF3E7AE1D4C733B00AD5EC8 = { 240 | CreatedOnToolsVersion = 7.3.1; 241 | DevelopmentTeam = E83AC9WR2F; 242 | }; 243 | 5AF3E7C71D4C733B00AD5EC8 = { 244 | CreatedOnToolsVersion = 7.3.1; 245 | TestTargetID = 5AF3E7AE1D4C733B00AD5EC8; 246 | }; 247 | }; 248 | }; 249 | buildConfigurationList = 5AF3E7AA1D4C733A00AD5EC8 /* Build configuration list for PBXProject "Demo" */; 250 | compatibilityVersion = "Xcode 3.2"; 251 | developmentRegion = English; 252 | hasScannedForEncodings = 0; 253 | knownRegions = ( 254 | en, 255 | Base, 256 | ); 257 | mainGroup = 5AF3E7A61D4C733A00AD5EC8; 258 | productRefGroup = 5AF3E7B01D4C733B00AD5EC8 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | 5AF3E7AE1D4C733B00AD5EC8 /* Demo */, 263 | 5AF3E7C71D4C733B00AD5EC8 /* DemoUITests */, 264 | ); 265 | }; 266 | /* End PBXProject section */ 267 | 268 | /* Begin PBXResourcesBuildPhase section */ 269 | 5AF3E7AD1D4C733B00AD5EC8 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 5AF3E7C21D4C733B00AD5EC8 /* LaunchScreen.storyboard in Resources */, 274 | 5AF3E7BF1D4C733B00AD5EC8 /* Assets.xcassets in Resources */, 275 | 5A0F5A1B1D4CAABB00FD0145 /* light.jpeg in Resources */, 276 | 5AC92BEB1D4D039200949121 /* FTProgressIndicator.bundle in Resources */, 277 | 5A0F5A1A1D4CAABB00FD0145 /* dark.jpeg in Resources */, 278 | 5A0F5A231D4CC5BD00FD0145 /* maps_icon.png in Resources */, 279 | 5AF3E7BD1D4C733B00AD5EC8 /* Main.storyboard in Resources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 5AF3E7C61D4C733B00AD5EC8 /* Resources */ = { 284 | isa = PBXResourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXResourcesBuildPhase section */ 291 | 292 | /* Begin PBXSourcesBuildPhase section */ 293 | 5AF3E7AB1D4C733B00AD5EC8 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | 5AC92BE91D4D039200949121 /* FTNotificationIndicator.m in Sources */, 298 | 5AF3E7BA1D4C733B00AD5EC8 /* ViewController.m in Sources */, 299 | 5AC92BE81D4D039200949121 /* FTIndicator.m in Sources */, 300 | 5AF3E7B71D4C733B00AD5EC8 /* AppDelegate.m in Sources */, 301 | 5A0F5A1E1D4CBD0A00FD0145 /* SecondViewController.m in Sources */, 302 | 5AF3E7B41D4C733B00AD5EC8 /* main.m in Sources */, 303 | 5AC92BEA1D4D039200949121 /* FTProgressIndicator.m in Sources */, 304 | 5AC92BEC1D4D039200949121 /* FTToastIndicator.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | 5AF3E7C41D4C733B00AD5EC8 /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 5AF3E7CD1D4C733B00AD5EC8 /* DemoUITests.m in Sources */, 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | }; 316 | /* End PBXSourcesBuildPhase section */ 317 | 318 | /* Begin PBXTargetDependency section */ 319 | 5AF3E7CA1D4C733B00AD5EC8 /* PBXTargetDependency */ = { 320 | isa = PBXTargetDependency; 321 | target = 5AF3E7AE1D4C733B00AD5EC8 /* Demo */; 322 | targetProxy = 5AF3E7C91D4C733B00AD5EC8 /* PBXContainerItemProxy */; 323 | }; 324 | /* End PBXTargetDependency section */ 325 | 326 | /* Begin PBXVariantGroup section */ 327 | 5AF3E7BB1D4C733B00AD5EC8 /* Main.storyboard */ = { 328 | isa = PBXVariantGroup; 329 | children = ( 330 | 5AF3E7BC1D4C733B00AD5EC8 /* Base */, 331 | ); 332 | name = Main.storyboard; 333 | sourceTree = ""; 334 | }; 335 | 5AF3E7C01D4C733B00AD5EC8 /* LaunchScreen.storyboard */ = { 336 | isa = PBXVariantGroup; 337 | children = ( 338 | 5AF3E7C11D4C733B00AD5EC8 /* Base */, 339 | ); 340 | name = LaunchScreen.storyboard; 341 | sourceTree = ""; 342 | }; 343 | /* End PBXVariantGroup section */ 344 | 345 | /* Begin XCBuildConfiguration section */ 346 | 5AF3E7CF1D4C733B00AD5EC8 /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ALWAYS_SEARCH_USER_PATHS = NO; 350 | CLANG_ANALYZER_NONNULL = YES; 351 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 352 | CLANG_CXX_LIBRARY = "libc++"; 353 | CLANG_ENABLE_MODULES = YES; 354 | CLANG_ENABLE_OBJC_ARC = YES; 355 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_COMMA = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 361 | CLANG_WARN_EMPTY_BODY = YES; 362 | CLANG_WARN_ENUM_CONVERSION = YES; 363 | CLANG_WARN_INFINITE_RECURSION = YES; 364 | CLANG_WARN_INT_CONVERSION = YES; 365 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 366 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 367 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 369 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 370 | CLANG_WARN_STRICT_PROTOTYPES = YES; 371 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 372 | CLANG_WARN_UNREACHABLE_CODE = YES; 373 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 374 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 375 | COPY_PHASE_STRIP = NO; 376 | DEBUG_INFORMATION_FORMAT = dwarf; 377 | ENABLE_STRICT_OBJC_MSGSEND = YES; 378 | ENABLE_TESTABILITY = YES; 379 | GCC_C_LANGUAGE_STANDARD = gnu99; 380 | GCC_DYNAMIC_NO_PIC = NO; 381 | GCC_NO_COMMON_BLOCKS = YES; 382 | GCC_OPTIMIZATION_LEVEL = 0; 383 | GCC_PREPROCESSOR_DEFINITIONS = ( 384 | "DEBUG=1", 385 | "$(inherited)", 386 | ); 387 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 389 | GCC_WARN_UNDECLARED_SELECTOR = YES; 390 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 391 | GCC_WARN_UNUSED_FUNCTION = YES; 392 | GCC_WARN_UNUSED_VARIABLE = YES; 393 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 394 | MTL_ENABLE_DEBUG_INFO = YES; 395 | ONLY_ACTIVE_ARCH = YES; 396 | SDKROOT = iphoneos; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | }; 399 | name = Debug; 400 | }; 401 | 5AF3E7D01D4C733B00AD5EC8 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CLANG_ANALYZER_NONNULL = YES; 406 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 407 | CLANG_CXX_LIBRARY = "libc++"; 408 | CLANG_ENABLE_MODULES = YES; 409 | CLANG_ENABLE_OBJC_ARC = YES; 410 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 411 | CLANG_WARN_BOOL_CONVERSION = YES; 412 | CLANG_WARN_COMMA = YES; 413 | CLANG_WARN_CONSTANT_CONVERSION = YES; 414 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 416 | CLANG_WARN_EMPTY_BODY = YES; 417 | CLANG_WARN_ENUM_CONVERSION = YES; 418 | CLANG_WARN_INFINITE_RECURSION = YES; 419 | CLANG_WARN_INT_CONVERSION = YES; 420 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 421 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 422 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 424 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 425 | CLANG_WARN_STRICT_PROTOTYPES = YES; 426 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 427 | CLANG_WARN_UNREACHABLE_CODE = YES; 428 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 429 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 430 | COPY_PHASE_STRIP = NO; 431 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 432 | ENABLE_NS_ASSERTIONS = NO; 433 | ENABLE_STRICT_OBJC_MSGSEND = YES; 434 | GCC_C_LANGUAGE_STANDARD = gnu99; 435 | GCC_NO_COMMON_BLOCKS = YES; 436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 438 | GCC_WARN_UNDECLARED_SELECTOR = YES; 439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 440 | GCC_WARN_UNUSED_FUNCTION = YES; 441 | GCC_WARN_UNUSED_VARIABLE = YES; 442 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 443 | MTL_ENABLE_DEBUG_INFO = NO; 444 | SDKROOT = iphoneos; 445 | TARGETED_DEVICE_FAMILY = "1,2"; 446 | VALIDATE_PRODUCT = YES; 447 | }; 448 | name = Release; 449 | }; 450 | 5AF3E7D21D4C733B00AD5EC8 /* Debug */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 454 | DEVELOPMENT_TEAM = E83AC9WR2F; 455 | INFOPLIST_FILE = Demo/Info.plist; 456 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.liufengting.FTIndicator; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | }; 461 | name = Debug; 462 | }; 463 | 5AF3E7D31D4C733B00AD5EC8 /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 467 | DEVELOPMENT_TEAM = E83AC9WR2F; 468 | INFOPLIST_FILE = Demo/Info.plist; 469 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = com.liufengting.FTIndicator; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | }; 474 | name = Release; 475 | }; 476 | 5AF3E7D51D4C733B00AD5EC8 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | INFOPLIST_FILE = DemoUITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.liufengting.DemoUITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_TARGET_NAME = Demo; 484 | }; 485 | name = Debug; 486 | }; 487 | 5AF3E7D61D4C733B00AD5EC8 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | INFOPLIST_FILE = DemoUITests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.liufengting.DemoUITests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_TARGET_NAME = Demo; 495 | }; 496 | name = Release; 497 | }; 498 | /* End XCBuildConfiguration section */ 499 | 500 | /* Begin XCConfigurationList section */ 501 | 5AF3E7AA1D4C733A00AD5EC8 /* Build configuration list for PBXProject "Demo" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 5AF3E7CF1D4C733B00AD5EC8 /* Debug */, 505 | 5AF3E7D01D4C733B00AD5EC8 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | 5AF3E7D11D4C733B00AD5EC8 /* Build configuration list for PBXNativeTarget "Demo" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | 5AF3E7D21D4C733B00AD5EC8 /* Debug */, 514 | 5AF3E7D31D4C733B00AD5EC8 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | 5AF3E7D41D4C733B00AD5EC8 /* Build configuration list for PBXNativeTarget "DemoUITests" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | 5AF3E7D51D4C733B00AD5EC8 /* Debug */, 523 | 5AF3E7D61D4C733B00AD5EC8 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | /* End XCConfigurationList section */ 529 | }; 530 | rootObject = 5AF3E7A71D4C733A00AD5EC8 /* Project object */; 531 | } 532 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Demo/Demo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/Demo/Demo/.DS_Store -------------------------------------------------------------------------------- /Demo/Demo/AppDelegate (1).h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting. 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 | -------------------------------------------------------------------------------- /Demo/Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). 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 | -------------------------------------------------------------------------------- /Demo/Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demo/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /Demo/Demo/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 | -------------------------------------------------------------------------------- /Demo/Demo/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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /Demo/Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | FTIndicator 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0.9 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarStyle 34 | UIStatusBarStyleLightContent 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeRight 39 | UIInterfaceOrientationLandscapeLeft 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Demo/Demo/SecondViewController (1).h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/Demo/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/Demo/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | 11 | #import "FTProgressIndicator.h" 12 | #import "FTToastIndicator.h" 13 | 14 | @interface SecondViewController () 15 | 16 | @end 17 | 18 | @implementation SecondViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | [FTProgressIndicator showProgressWithMessage:nil]; 24 | 25 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 26 | 27 | for (NSInteger i = 0; i < 1000; i++) { 28 | NSLog(@"print out %ld",i); 29 | } 30 | 31 | // sleep(3); 32 | 33 | dispatch_async(dispatch_get_main_queue(), ^{ 34 | [FTProgressIndicator dismiss]; 35 | }); 36 | }); 37 | } 38 | 39 | - (IBAction)addButtonTapped:(UIBarButtonItem *)sender 40 | { 41 | 42 | // do any test you want 43 | 44 | [FTProgressIndicator showProgressWithMessage:@"Uploading..." userInteractionEnable:YES]; 45 | 46 | [self.view endEditing:YES]; 47 | 48 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 49 | 50 | [FTProgressIndicator showSuccessWithMessage:@"Upload succeeded."]; 51 | 52 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 53 | 54 | [self.navigationController popViewControllerAnimated:YES]; 55 | 56 | }); 57 | }); 58 | 59 | } 60 | 61 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 62 | { 63 | [self.view endEditing:YES]; 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Demo/Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UITableViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo/Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/21. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "FTIndicator.h" 11 | 12 | #import "FTToastIndicator.h" 13 | #import "FTProgressIndicator.h" 14 | #import "FTNotificationIndicator.h" 15 | 16 | 17 | 18 | @interface ViewController () 19 | 20 | @property (weak, nonatomic) IBOutlet UISwitch *switcher; 21 | @property (nonatomic, strong)UIImageView *backgroudImage; 22 | @property (nonatomic, strong)UIColor *themeColor; 23 | 24 | @end 25 | 26 | @implementation ViewController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | 31 | [self.navigationController.navigationBar setTranslucent:YES]; 32 | [self.navigationController.navigationBar setShadowImage:[UIImage new]]; 33 | [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 34 | 35 | [self.tableView setBackgroundView:self.backgroudImage]; 36 | 37 | [self showAnotherTheme:YES]; 38 | } 39 | 40 | 41 | - (IBAction)switchChanged:(UISwitch *)sender 42 | { 43 | [self showAnotherTheme:sender.isOn]; 44 | } 45 | 46 | 47 | - (void)showAnotherTheme:(BOOL)isLight 48 | { 49 | self.themeColor = isLight ? [UIColor blackColor] : [UIColor whiteColor]; 50 | 51 | self.backgroudImage.image = [UIImage imageNamed:isLight ? @"light.jpeg" : @"dark.jpeg"]; 52 | 53 | self.tableView.separatorColor = self.themeColor; 54 | 55 | [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:self.themeColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:19]}]; 56 | 57 | [self.navigationController.navigationBar setTintColor:self.themeColor]; 58 | 59 | [UIApplication sharedApplication].statusBarStyle = isLight ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent; 60 | 61 | [self.tableView reloadData]; 62 | 63 | 64 | [FTIndicator setIndicatorStyle:isLight ? UIBlurEffectStyleLight : UIBlurEffectStyleDark]; 65 | 66 | [FTIndicator showInfoWithMessage:isLight ? @"Daylight Version on." : @"Night Version on."]; 67 | } 68 | 69 | 70 | 71 | - (UIImageView *)backgroudImage 72 | { 73 | if (!_backgroudImage) { 74 | _backgroudImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"light.jpeg"]]; 75 | _backgroudImage.contentMode = UIViewContentModeScaleAspectFill; 76 | } 77 | return _backgroudImage; 78 | } 79 | - (UIColor *)themeColor 80 | { 81 | if (!_themeColor) { 82 | _themeColor = [UIColor blackColor]; 83 | } 84 | return _themeColor; 85 | } 86 | 87 | 88 | - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(nonnull UIView *)view forSection:(NSInteger)section 89 | { 90 | [((UITableViewHeaderFooterView *) view).textLabel setTextColor:self.themeColor]; 91 | } 92 | - (void)tableView:(UITableView *)tableView willDisplayCell:(nonnull UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath 93 | { 94 | [cell setBackgroundColor:[self.themeColor colorWithAlphaComponent:0.1]]; 95 | [cell.textLabel setTextColor:self.themeColor]; 96 | } 97 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 98 | { 99 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 100 | 101 | 102 | switch (indexPath.section) { 103 | case 0: 104 | switch (indexPath.row) { 105 | case 0: 106 | [FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 107 | title:@"Here is a notification title." 108 | message:@"Here is a notification message. Try to swipe it up or tap at 'Dismiss Notification' cell"]; 109 | break; 110 | case 1: 111 | [FTIndicator showNotificationWithTitle:@"Here is a notification title." 112 | message:@"Here is a notification message. Try to swipe it up or tap at 'Dismiss Notification' cell"]; 113 | break; 114 | case 2: 115 | [FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 116 | title:@"Here is a notification title." 117 | message:@"Here is a notification message. Try to tap and see tap handling or do nothing to see completion" 118 | tapHandler:^{ 119 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Tap Handling" 120 | message:@"This happen when you tap notification" 121 | delegate:nil 122 | cancelButtonTitle:@"OK" 123 | otherButtonTitles:nil]; 124 | [alertView show]; 125 | } completion:^{ 126 | [FTIndicator showInfoWithMessage:@"Notification dismissed"]; 127 | }]; 128 | break; 129 | case 3: 130 | [FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 131 | title:@"Here is a notification title. Special." 132 | message:@"Here is a notification message. Only if user tap or swipe, will I dismiss." 133 | autoDismiss:NO 134 | tapHandler:^{ 135 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Tap Handling" 136 | message:@"This happen when you tap notification" 137 | delegate:nil 138 | cancelButtonTitle:@"OK" 139 | otherButtonTitles:nil]; 140 | [alertView show]; 141 | } completion:^{ 142 | [FTIndicator showInfoWithMessage:@"Notification dismissed"]; 143 | }]; 144 | break; 145 | case 4: 146 | [FTIndicator dismissNotification]; 147 | break; 148 | default: 149 | break; 150 | } 151 | break; 152 | case 1: 153 | switch (indexPath.row) { 154 | case 0: 155 | [FTIndicator showProgressWithMessage:nil userInteractionEnable:YES]; 156 | break; 157 | case 1: 158 | [FTIndicator showSuccessWithMessage:@"Here is a progress title. This means nothing at all."]; 159 | break; 160 | case 2: 161 | [FTIndicator showInfoWithMessage:@"When this is showing, userInteraction not enabled." userInteractionEnable:NO]; 162 | break; 163 | case 3: 164 | // [FTIndicator showErrorWithMessage:@"Here is a progress title. This means nothing at all."]; 165 | [FTIndicator showErrorWithMessage:@"Here is a error message, with custom image support." 166 | image:[UIImage imageNamed:@"maps_icon"] 167 | userInteractionEnable:YES]; 168 | break; 169 | case 4: 170 | [FTIndicator dismissProgress]; 171 | break; 172 | default: 173 | break; 174 | } 175 | break; 176 | case 2: 177 | switch (indexPath.row) { 178 | case 0: 179 | [FTIndicator showToastMessage:@"Short Toast."]; 180 | break; 181 | case 1: 182 | [FTIndicator showToastMessage:@"Here is a long long toast message, see if it can break lines."]; 183 | break; 184 | case 2: 185 | [FTIndicator dismissToast]; 186 | break; 187 | default: 188 | break; 189 | } 190 | break; 191 | default: 192 | break; 193 | } 194 | } 195 | 196 | 197 | 198 | @end 199 | -------------------------------------------------------------------------------- /Demo/Demo/dark.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/Demo/Demo/dark.jpeg -------------------------------------------------------------------------------- /Demo/Demo/light.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/Demo/Demo/light.jpeg -------------------------------------------------------------------------------- /Demo/Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). 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 | -------------------------------------------------------------------------------- /Demo/Demo/maps_icon (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/Demo/Demo/maps_icon (1).png -------------------------------------------------------------------------------- /Demo/Demo/maps_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/Demo/Demo/maps_icon.png -------------------------------------------------------------------------------- /Demo/DemoUITests/DemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoUITests.m 3 | // DemoUITests 4 | // 5 | // Created by liufengting on 16/7/30. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // 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. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/DemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /FTIndicator.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "FTIndicator" 4 | s.version = "1.2.9" 5 | s.summary = "A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support." 6 | s.description = <<-DESC 7 | A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support. Inspried by Apple's process indicator and notifications. 8 | DESC 9 | s.author = { "liufengting" => "wo157121900@me.com" } 10 | s.homepage = "https://github.com/liufengting/FTIndicator" 11 | s.license = { :type => "MIT", :file => "LICENSE" } 12 | s.social_media_url = "https://twitter.com/liufengting" 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/liufengting/FTIndicator.git", :tag => "#{s.version}" } 15 | s.source_files = "FTIndicator", "FTIndicator/**/*.{h,m}" 16 | s.resources = "FTIndicator/**/*.{bundle}" 17 | s.requires_arc = true 18 | 19 | s.subspec 'FTNotificationIndicator' do |bs| 20 | bs.source_files = "FTNotificationIndicator", "FTIndicator/FTNotificationIndicator/*.{h,m}" 21 | end 22 | 23 | s.subspec 'FTProgressIndicator' do |bs| 24 | bs.source_files = "FTProgressIndicator", "FTIndicator/FTProgressIndicator/*.{h,m}" 25 | bs.resources = "FTIndicator/FTProgressIndicator/*.{bundle}" 26 | end 27 | 28 | s.subspec 'FTToastIndicator' do |bs| 29 | bs.source_files = "FTToastIndicator", "FTIndicator/FTToastIndicator/**/*.{h,m}" 30 | end 31 | 32 | end 33 | -------------------------------------------------------------------------------- /FTIndicator/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/.DS_Store -------------------------------------------------------------------------------- /FTIndicator/FTIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FTIndicator.h 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/21. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FTToastIndicator.h" 11 | #import "FTProgressIndicator.h" 12 | #import "FTNotificationIndicator.h" 13 | 14 | #pragma mark - FTIndicator 15 | /** 16 | * FTIndicator 17 | */ 18 | @interface FTIndicator : NSObject 19 | 20 | /** 21 | * set Style 22 | */ 23 | #pragma mark - set theme style 24 | /** 25 | * setIndicatorStyleToDefaultStyle 26 | */ 27 | + (void)setIndicatorStyleToDefaultStyle; 28 | /** 29 | * setIndicatorStyle 30 | * 31 | * @param style UIBlurEffectStyle style 32 | */ 33 | + (void)setIndicatorStyle:(UIBlurEffectStyle)style; 34 | 35 | /** 36 | * FTToastIndicator 37 | */ 38 | #pragma mark - FTToastIndicator 39 | 40 | /** 41 | * showToastMessage 42 | * 43 | * @param toastMessage NSString toastMessage 44 | */ 45 | + (void)showToastMessage:(NSString *)toastMessage; 46 | 47 | /** 48 | * dismissToast 49 | */ 50 | + (void)dismissToast; 51 | 52 | /** 53 | * FTProgressIndicator 54 | */ 55 | #pragma mark - FTProgressIndicator 56 | /** 57 | * showProgressWithMessage 58 | * 59 | * @param message message 60 | */ 61 | + (void)showProgressWithMessage:(NSString *)message; 62 | 63 | /** 64 | * showProgressWithMessage userInteractionEnable 65 | * 66 | * @param message message 67 | * @param userInteractionEnable userInteractionEnable 68 | */ 69 | + (void)showProgressWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 70 | 71 | /** 72 | * showInfoWithMessage 73 | * 74 | * @param message NSString message 75 | */ 76 | + (void)showInfoWithMessage:(NSString *)message; 77 | 78 | /** 79 | * showInfoWithMessage userInteractionEnable 80 | * 81 | * @param message message 82 | * @param userInteractionEnable userInteractionEnable 83 | */ 84 | + (void)showInfoWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 85 | 86 | /** 87 | showInfoWithMessage image userInteractionEnable 88 | 89 | @param message message 90 | @param image image 91 | @param userInteractionEnable userInteractionEnable 92 | */ 93 | + (void)showInfoWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 94 | 95 | /** 96 | * showSuccessWithMessage 97 | * 98 | * @param message NSString message 99 | */ 100 | + (void)showSuccessWithMessage:(NSString *)message; 101 | 102 | /** 103 | * showSuccessWithMessage userInteractionEnable 104 | * 105 | * @param message message 106 | * @param userInteractionEnable userInteractionEnable 107 | */ 108 | + (void)showSuccessWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 109 | 110 | /** 111 | showSuccessWithMessage image userInteractionEnable 112 | 113 | @param message message 114 | @param image image 115 | @param userInteractionEnable userInteractionEnable 116 | */ 117 | + (void)showSuccessWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 118 | 119 | /** 120 | * showErrorWithMessage 121 | * 122 | * @param message NSString message 123 | */ 124 | + (void)showErrorWithMessage:(NSString *)message; 125 | 126 | /** 127 | * showErrorWithMessage userInteractionEnable 128 | * 129 | * @param message message 130 | * @param userInteractionEnable userInteractionEnable 131 | */ 132 | + (void)showErrorWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 133 | 134 | /** 135 | showErrorWithMessage image userInteractionEnable 136 | 137 | @param message message 138 | @param image image 139 | @param userInteractionEnable userInteractionEnable 140 | */ 141 | + (void)showErrorWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 142 | 143 | /** 144 | * dismissProgress 145 | */ 146 | + (void)dismissProgress; 147 | 148 | /** 149 | * FTNotificationIndicator 150 | */ 151 | #pragma mark - FTNotificationIndicator 152 | /** 153 | * showNotificationWithTitle 154 | * 155 | * @param title title 156 | * @param message message 157 | */ 158 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message; 159 | /** 160 | * showNotificationWithTitle message tapHandler 161 | * 162 | * @param title title 163 | * @param message message 164 | * @param tapHandler tapHandler 165 | */ 166 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler; 167 | /** 168 | * showNotificationWithTitle message tapHandler completion 169 | * 170 | * @param title title 171 | * @param message message 172 | * @param tapHandler tapHandler 173 | */ 174 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 175 | /** 176 | * showNotificationWithImage title message 177 | * 178 | * @param image image 179 | * @param title title 180 | * @param message message 181 | */ 182 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message; 183 | /** 184 | * showNotificationWithImage title message tapHandler 185 | * 186 | * @param image image 187 | * @param title title 188 | * @param message message 189 | * @param tapHandler tapHandler 190 | */ 191 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler; 192 | /** 193 | * showNotificationWithImage title message tapHandler completion 194 | * 195 | * @param image image 196 | * @param title title 197 | * @param message message 198 | * @param tapHandler tapHandler 199 | */ 200 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 201 | /** 202 | showNotificationWithImage title message autoDismiss tapHandler completion 203 | 204 | !!!!!!!!! Only this method suports not dismiss automatically, user has to tap or swipe to dismiss. 205 | 206 | @param image image 207 | @param title title 208 | @param message message 209 | @param autoDismiss autoDismiss 210 | @param tapHandler tapHandler 211 | @param completion completion 212 | */ 213 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message autoDismiss:(BOOL)autoDismiss tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 214 | /** 215 | * dismissNotification 216 | */ 217 | + (void)dismissNotification; 218 | 219 | @end 220 | -------------------------------------------------------------------------------- /FTIndicator/FTIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // FTIndicator.m 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/21. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "FTIndicator.h" 10 | 11 | @interface FTIndicator () 12 | 13 | @end 14 | 15 | @implementation FTIndicator 16 | 17 | + (void)setIndicatorStyleToDefaultStyle 18 | { 19 | [self setIndicatorStyle:UIBlurEffectStyleLight]; 20 | } 21 | 22 | + (void)setIndicatorStyle:(UIBlurEffectStyle)style 23 | { 24 | [FTToastIndicator setToastIndicatorStyle:style]; 25 | [FTProgressIndicator setProgressIndicatorStyle:style]; 26 | [FTNotificationIndicator setNotificationIndicatorStyle:style]; 27 | } 28 | 29 | #pragma mark - FTToastIndicator 30 | /** 31 | * FTToastIndicator 32 | */ 33 | + (void)showToastMessage:(NSString *)toastMessage 34 | { 35 | [FTToastIndicator showToastMessage:toastMessage]; 36 | } 37 | 38 | + (void)dismissToast 39 | { 40 | [FTToastIndicator dismiss]; 41 | } 42 | 43 | 44 | #pragma mark - FTProgressIndicator 45 | /** 46 | * FTProgressIndicator 47 | */ 48 | + (void)showProgressWithMessage:(NSString *)message 49 | { 50 | [self showProgressWithMessage:message userInteractionEnable:YES]; 51 | } 52 | + (void)showProgressWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 53 | { 54 | [FTProgressIndicator showProgressWithMessage:message userInteractionEnable:userInteractionEnable]; 55 | } 56 | 57 | 58 | + (void)showInfoWithMessage:(NSString *)message 59 | { 60 | [self showInfoWithMessage:message image:nil userInteractionEnable:YES]; 61 | } 62 | + (void)showInfoWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 63 | { 64 | [self showInfoWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 65 | } 66 | + (void)showInfoWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 67 | { 68 | [FTProgressIndicator showInfoWithMessage:message image:image userInteractionEnable:userInteractionEnable]; 69 | } 70 | 71 | 72 | + (void)showSuccessWithMessage:(NSString *)message 73 | { 74 | [self showSuccessWithMessage:message image:nil userInteractionEnable:YES]; 75 | } 76 | + (void)showSuccessWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 77 | { 78 | [self showSuccessWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 79 | } 80 | + (void)showSuccessWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 81 | { 82 | [FTProgressIndicator showSuccessWithMessage:message image:image userInteractionEnable:userInteractionEnable]; 83 | } 84 | 85 | 86 | + (void)showErrorWithMessage:(NSString *)message 87 | { 88 | [self showErrorWithMessage:message image:nil userInteractionEnable:YES]; 89 | } 90 | + (void)showErrorWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 91 | { 92 | [self showErrorWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 93 | } 94 | + (void)showErrorWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 95 | { 96 | [FTProgressIndicator showErrorWithMessage:message image:image userInteractionEnable:userInteractionEnable]; 97 | } 98 | 99 | 100 | + (void)dismissProgress 101 | { 102 | [FTProgressIndicator dismiss]; 103 | } 104 | 105 | #pragma mark - FTNotificationIndicator 106 | /** 107 | * FTNotificationIndicator 108 | */ 109 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message 110 | { 111 | [self showNotificationWithImage:nil title:title message:message autoDismiss:YES tapHandler:nil completion:nil]; 112 | } 113 | 114 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler 115 | { 116 | [self showNotificationWithImage:nil title:title message:message autoDismiss:YES tapHandler:tapHandler completion:nil]; 117 | } 118 | 119 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 120 | { 121 | [self showNotificationWithImage:nil title:title message:message autoDismiss:YES tapHandler:tapHandler completion:completion]; 122 | } 123 | 124 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message 125 | { 126 | [self showNotificationWithImage:image title:title message:message autoDismiss:YES tapHandler:nil completion:nil]; 127 | } 128 | 129 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler 130 | { 131 | [self showNotificationWithImage:image title:title message:message autoDismiss:YES tapHandler:tapHandler completion:nil]; 132 | } 133 | 134 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 135 | { 136 | [self showNotificationWithImage:image title:title message:message autoDismiss:YES tapHandler:tapHandler completion:completion]; 137 | } 138 | 139 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message autoDismiss:(BOOL)autoDismiss tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 140 | { 141 | [FTNotificationIndicator showNotificationWithImage:image title:title message:message autoDismiss:autoDismiss tapHandler:tapHandler completion:completion]; 142 | } 143 | 144 | + (void)dismissNotification 145 | { 146 | [FTNotificationIndicator dismiss]; 147 | } 148 | 149 | @end 150 | -------------------------------------------------------------------------------- /FTIndicator/FTNotificationIndicator/FTNotificationIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FTNotificationIndicator.h 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/26. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #pragma mark - FTNotificationIndicator 12 | 13 | typedef void (^FTNotificationTapHandler)(void); 14 | typedef void (^FTNotificationCompletion)(void); 15 | 16 | /** 17 | FTNotificationIndicator 18 | */ 19 | @interface FTNotificationIndicator : NSObject 20 | 21 | /** 22 | setIndicatorStyleToDefaultStyle 23 | */ 24 | + (void)setNotificationIndicatorStyleToDefaultStyle; 25 | /** 26 | setIndicatorStyle 27 | 28 | @param style style 29 | */ 30 | + (void)setNotificationIndicatorStyle:(UIBlurEffectStyle)style; 31 | /** 32 | showNotificationWithTitle message 33 | 34 | @param title title 35 | @param message message 36 | */ 37 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message; 38 | /** 39 | showNotificationWithTitle message tapHandler 40 | 41 | @param title title 42 | @param message message 43 | @param tapHandler tapHandler 44 | */ 45 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler; 46 | /** 47 | showNotificationWithTitle message tapHandler completion 48 | 49 | @param title title 50 | @param message message 51 | @param tapHandler tapHandler 52 | @param completion completion 53 | */ 54 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 55 | /** 56 | showNotificationWithImage title message 57 | 58 | @param image image 59 | @param title title 60 | @param message message 61 | */ 62 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message; 63 | /** 64 | showNotificationWithImage title message tapHandler 65 | 66 | @param image image 67 | @param title title 68 | @param message message 69 | @param tapHandler tapHandler 70 | */ 71 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler; 72 | /** 73 | showNotificationWithImage title message tapHandler completion 74 | 75 | 76 | @param image image 77 | @param title title 78 | @param message message 79 | @param tapHandler tapHandler 80 | @param completion completion 81 | */ 82 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 83 | 84 | 85 | /** 86 | showNotificationWithImage title message autoDismiss tapHandler completion 87 | 88 | !!!!!!!!! Only this method suports not dismiss automatically, user has to tap or swipe to dismiss. 89 | 90 | @param image image 91 | @param title title 92 | @param message message 93 | @param autoDismiss autoDismiss 94 | @param tapHandler tapHandler 95 | @param completion completion 96 | */ 97 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message autoDismiss:(BOOL)autoDismiss tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion; 98 | /** 99 | dismiss 100 | */ 101 | + (void)dismiss; 102 | 103 | 104 | /** 105 | Default delay until dismiss notification 106 | 107 | @param time Delay in seconds 108 | */ 109 | + (void)setDefaultDismissTime:(NSTimeInterval)time; 110 | 111 | 112 | /** 113 | Default delay until dismiss notification 114 | 115 | @return Delay in seconds 116 | */ 117 | + (NSTimeInterval)defaultDismissTime; 118 | 119 | @end 120 | 121 | #pragma mark - FTNotificationIndicatorView 122 | 123 | /** 124 | FTNotificationIndicatorView 125 | */ 126 | @interface FTNotificationIndicatorView : UIVisualEffectView 127 | /** 128 | showWithImage 129 | 130 | @param image image 131 | @param title title 132 | @param message message 133 | @param style style 134 | */ 135 | - (void)showWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message style:(UIBlurEffectStyle)style; 136 | /** 137 | getFrameForNotificationViewWithImage 138 | 139 | @param image image 140 | @param notificationMessage message 141 | @return CGSize 142 | */ 143 | - (CGSize )getFrameForNotificationViewWithImage:(UIImage *)image message:(NSString *)notificationMessage; 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /FTIndicator/FTNotificationIndicator/FTNotificationIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // FTNotificationIndicator.m 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/26. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "FTNotificationIndicator.h" 10 | 11 | #pragma mark - Defines 12 | 13 | #define kFTNotificationMaxHeight (200.f) 14 | #define kFTNotificationTitleHeight (24.f) 15 | #define kFTNotificationMargin_X (10.f) 16 | #define kFTNotificationMargin_Y (10.f) 17 | #define kFTNotificationImageSize (30.f) 18 | #define kFTNotificationStatusBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height) 19 | #define kFTNotificationDefaultAnimationDuration (0.2f) 20 | #define kFTNotificationDefaultTitleFont [UIFont boldSystemFontOfSize:15] 21 | #define kFTNotificationDefaultMessageFont [UIFont systemFontOfSize:13] 22 | #define kFTNotificationDefaultTextColor [UIColor blackColor] 23 | #define kFTNotificationDefaultTextColor_ForDarkStyle [UIColor whiteColor] 24 | #define kFTNotificationDefaultDismissTime (2.0f) 25 | 26 | #define kFTScreenWidth [UIScreen mainScreen].bounds.size.width 27 | #define kFTScreenHeight [UIScreen mainScreen].bounds.size.height 28 | 29 | #pragma mark - FTNotificationIndicator 30 | 31 | @interface FTNotificationIndicator () 32 | 33 | @property (nonatomic, strong)UIWindow *backgroundWindow; 34 | @property (nonatomic, strong)FTNotificationIndicatorView *notificationView; 35 | @property (nonatomic, assign)UIBlurEffectStyle indicatorStyle; 36 | @property (nonatomic, strong)UIImage *notificationImage; 37 | @property (nonatomic, strong)NSString *notificationTitle; 38 | @property (nonatomic, strong)NSString *notificationMessage; 39 | @property (nonatomic, strong)NSTimer *dismissTimer; 40 | @property (nonatomic, assign)BOOL isCurrentlyOnScreen; 41 | @property (nonatomic, assign)BOOL shouldAutoDismiss; 42 | @property (nonatomic, copy, nullable) FTNotificationTapHandler tapHandler; 43 | @property (nonatomic, copy, nullable) FTNotificationCompletion completion; 44 | @property (nonatomic, assign)NSTimeInterval dismissTime; 45 | 46 | @end 47 | 48 | @implementation FTNotificationIndicator 49 | 50 | #pragma mark - class methods 51 | 52 | + (FTNotificationIndicator *)sharedInstance 53 | { 54 | static FTNotificationIndicator *shared; 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | shared = [[FTNotificationIndicator alloc] init]; 58 | }); 59 | return shared; 60 | } 61 | 62 | + (void)setNotificationIndicatorStyleToDefaultStyle 63 | { 64 | [self sharedInstance].indicatorStyle = UIBlurEffectStyleLight; 65 | } 66 | 67 | + (void)setNotificationIndicatorStyle:(UIBlurEffectStyle)style 68 | { 69 | [self sharedInstance].indicatorStyle = style; 70 | } 71 | 72 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message 73 | { 74 | [self showNotificationWithImage:nil title:title message:message tapHandler:nil completion:nil]; 75 | } 76 | 77 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler 78 | { 79 | [self showNotificationWithImage:nil title:title message:message tapHandler:tapHandler completion:nil]; 80 | } 81 | 82 | + (void)showNotificationWithTitle:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 83 | { 84 | [self showNotificationWithImage:nil title:title message:message tapHandler:tapHandler completion:completion]; 85 | } 86 | 87 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message 88 | { 89 | [self showNotificationWithImage:image title:title message:message tapHandler:nil completion:nil]; 90 | } 91 | 92 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler 93 | { 94 | [self showNotificationWithImage:image title:title message:message tapHandler:tapHandler completion:nil]; 95 | } 96 | 97 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 98 | { 99 | [[self sharedInstance] showNotificationWithImage:image title:title message:message autoDismiss:YES tapHandler:tapHandler completion:completion]; 100 | } 101 | 102 | 103 | + (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message autoDismiss:(BOOL)autoDismiss tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 104 | { 105 | [[self sharedInstance] showNotificationWithImage:image title:title message:message autoDismiss:autoDismiss tapHandler:tapHandler completion:completion]; 106 | } 107 | 108 | + (void)dismiss 109 | { 110 | [[self sharedInstance] dismiss]; 111 | } 112 | 113 | #pragma mark - Timer 114 | 115 | + (void)setDefaultDismissTime:(NSTimeInterval)time 116 | { 117 | [[self sharedInstance] setDismissTime: time]; 118 | } 119 | 120 | + (NSTimeInterval)defaultDismissTime 121 | { 122 | return [[self sharedInstance] dismissTime]; 123 | } 124 | 125 | #pragma mark - instance methods 126 | 127 | - (instancetype)init 128 | { 129 | self = [super init]; 130 | if (self) { 131 | [[NSNotificationCenter defaultCenter] addObserver:self 132 | selector:@selector(onChangeStatusBarOrientationNotification:) 133 | name:UIApplicationDidChangeStatusBarOrientationNotification 134 | object:nil]; 135 | self.dismissTime = kFTNotificationDefaultDismissTime; 136 | } 137 | return self; 138 | } 139 | 140 | - (UIWindow *)backgroundWindow 141 | { 142 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 143 | id delegate = [[UIApplication sharedApplication] delegate]; 144 | if (window == nil && [delegate respondsToSelector:@selector(window)]){ 145 | window = [delegate performSelector:@selector(window)]; 146 | } 147 | return window; 148 | } 149 | 150 | - (FTNotificationIndicatorView *)notificationView 151 | { 152 | if (!_notificationView) { 153 | _notificationView = [[FTNotificationIndicatorView alloc] initWithFrame:CGRectZero]; 154 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onPanGuestureRecognized:)]; 155 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapGestureRecognized:)]; 156 | [_notificationView addGestureRecognizer:pan]; 157 | [_notificationView addGestureRecognizer:tap]; 158 | } 159 | return _notificationView; 160 | } 161 | 162 | - (void)onPanGuestureRecognized:(UIPanGestureRecognizer *)sender 163 | { 164 | if (self.isCurrentlyOnScreen) { 165 | CGPoint translation = [sender translationInView:[[UIApplication sharedApplication] keyWindow]]; 166 | switch (sender.state) { 167 | case UIGestureRecognizerStateBegan: case UIGestureRecognizerStateChanged: 168 | if (translation.y < 0) { 169 | [self.notificationView setFrame:CGRectMake(0,translation.y,kFTScreenWidth,self.notificationView.frame.size.height)]; 170 | } 171 | break; 172 | case UIGestureRecognizerStateEnded: 173 | [self dismiss]; 174 | break; 175 | default: 176 | break; 177 | } 178 | } 179 | } 180 | 181 | - (void)onTapGestureRecognized:(UITapGestureRecognizer*)sender{ 182 | if(self.isCurrentlyOnScreen){ 183 | switch (sender.state) { 184 | case UIGestureRecognizerStateEnded: 185 | [self dismissOnTapped:YES]; 186 | if(self.tapHandler){ 187 | self.tapHandler(); 188 | } 189 | break; 190 | default: 191 | break; 192 | } 193 | } 194 | } 195 | 196 | - (void)showNotificationWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message autoDismiss:(BOOL)autoDismiss tapHandler:(FTNotificationTapHandler)tapHandler completion:(FTNotificationCompletion)completion 197 | { 198 | dispatch_async(dispatch_get_main_queue(), ^{ 199 | self.notificationImage = image; 200 | self.notificationTitle = title; 201 | self.notificationMessage = message; 202 | self.isCurrentlyOnScreen = NO; 203 | self.shouldAutoDismiss = autoDismiss; 204 | self.tapHandler = tapHandler; 205 | self.completion = completion; 206 | 207 | [self stopDismissTimer]; 208 | [self adjustIndicatorFrame]; 209 | }); 210 | } 211 | 212 | - (void)dismiss{ 213 | [self dismissOnTapped:NO]; 214 | } 215 | 216 | - (void)dismissOnTapped:(BOOL)tapped 217 | { 218 | [self stopDismissTimer]; 219 | [self dismissingNotificationtViewByTap:tapped]; 220 | } 221 | 222 | - (void)adjustIndicatorFrame 223 | { 224 | CGSize notificationSize = [self.notificationView getFrameForNotificationViewWithImage:self.notificationImage message:self.notificationMessage]; 225 | 226 | [self.notificationView setFrame:CGRectMake(0,- (notificationSize.height),kFTScreenWidth,notificationSize.height)]; 227 | 228 | [self.notificationView showWithImage:self.notificationImage title:self.notificationTitle message:self.notificationMessage style:self.indicatorStyle]; 229 | 230 | [self.backgroundWindow addSubview:self.notificationView]; 231 | 232 | [self startShowingNotificationView]; 233 | } 234 | 235 | - (void)onChangeStatusBarOrientationNotification:(NSNotification *)notification 236 | { 237 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 238 | if (self.isCurrentlyOnScreen) { 239 | [self adjustIndicatorFrame]; 240 | } 241 | }); 242 | } 243 | 244 | - (void)startDismissTimer 245 | { 246 | [self stopDismissTimer]; 247 | if (!self.shouldAutoDismiss) { 248 | return; 249 | } 250 | CGFloat timeInterval = MAX(self.notificationMessage.length * 0.04 + 0.5, _dismissTime); 251 | _dismissTimer = [NSTimer scheduledTimerWithTimeInterval:timeInterval 252 | target:self 253 | selector:@selector(dismissingNotificationtView) 254 | userInfo:nil 255 | repeats:NO]; 256 | } 257 | 258 | - (void)stopDismissTimer 259 | { 260 | if (_dismissTimer) { 261 | [_dismissTimer invalidate]; 262 | _dismissTimer = nil; 263 | } 264 | } 265 | 266 | - (void)startShowingNotificationView 267 | { 268 | // [UIView animateWithDuration:kFTNotificationDefaultAnimationDuration 269 | // delay:0 270 | // usingSpringWithDamping:0.5 271 | // initialSpringVelocity:0 272 | // options:UIViewAnimationOptionCurveEaseIn 273 | // animations:^{ 274 | // [self.notificationView setFrame:CGRectMake(0,0,kFTScreenWidth,self.notificationView.frame.size.height)]; 275 | // } completion:^(BOOL finished) { 276 | // if (!self.isCurrentlyOnScreen) { 277 | // [self startDismissTimer]; 278 | // } 279 | // self.isCurrentlyOnScreen = YES; 280 | // }]; 281 | [UIView animateWithDuration:kFTNotificationDefaultAnimationDuration 282 | delay:0 283 | options:UIViewAnimationOptionCurveEaseOut 284 | animations:^{ 285 | [self.notificationView setFrame:CGRectMake(0,0,kFTScreenWidth,self.notificationView.frame.size.height)]; 286 | } completion:^(BOOL finished) { 287 | if (!self.isCurrentlyOnScreen) { 288 | [self startDismissTimer]; 289 | } 290 | self.isCurrentlyOnScreen = YES; 291 | }]; 292 | } 293 | 294 | - (void)dismissingNotificationtView{ 295 | [self dismissingNotificationtViewByTap:NO]; 296 | } 297 | 298 | - (void)dismissingNotificationtViewByTap:(BOOL)tap 299 | { 300 | [self.notificationView.layer removeAllAnimations]; 301 | [UIView animateWithDuration:kFTNotificationDefaultAnimationDuration 302 | delay:0 303 | options:(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction) 304 | animations:^{ 305 | [self.notificationView setFrame:CGRectMake(0,- (self.notificationView.frame.size.height),kFTScreenWidth,(self.notificationView.frame.size.height))]; 306 | } completion:^(BOOL finished) { 307 | self.isCurrentlyOnScreen = NO; 308 | [self.notificationView removeFromSuperview]; 309 | if(self.completion && !tap){ 310 | self.completion(); 311 | } 312 | }]; 313 | } 314 | 315 | @end 316 | 317 | #pragma mark - FTNotificationIndicatorView 318 | 319 | @interface FTNotificationIndicatorView () 320 | 321 | @property (strong, nonatomic) NSString *message; 322 | 323 | @property (strong, nonatomic) UIImageView *iconImageView; 324 | @property (strong, nonatomic) UILabel *titleLabel; 325 | @property (strong, nonatomic) UILabel *messageLabel; 326 | 327 | @end 328 | 329 | @implementation FTNotificationIndicatorView 330 | 331 | - (instancetype)initWithFrame:(CGRect)frame 332 | { 333 | self = [super initWithFrame:frame]; 334 | if (self) { 335 | self.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 336 | } 337 | return self; 338 | } 339 | 340 | #pragma mark - getters 341 | 342 | - (UIImageView *)iconImageView 343 | { 344 | if (!_iconImageView) { 345 | _iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kFTNotificationMargin_X, kFTNotificationStatusBarHeight + kFTNotificationMargin_Y, kFTNotificationImageSize, kFTNotificationImageSize)]; 346 | _iconImageView.contentMode = UIViewContentModeScaleAspectFit; 347 | _iconImageView.backgroundColor = [UIColor clearColor]; 348 | [self.contentView addSubview:_iconImageView]; 349 | } 350 | return _iconImageView; 351 | } 352 | 353 | - (UILabel *)titleLabel 354 | { 355 | if (!_titleLabel) { 356 | _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kFTNotificationMargin_X*2 + kFTNotificationImageSize, kFTNotificationStatusBarHeight, kFTScreenWidth - kFTNotificationMargin_X*2 - kFTNotificationImageSize, kFTNotificationTitleHeight)]; 357 | _titleLabel.font = kFTNotificationDefaultTitleFont; 358 | _titleLabel.textColor = kFTNotificationDefaultTextColor; 359 | [self.contentView addSubview:_titleLabel]; 360 | } 361 | return _titleLabel; 362 | } 363 | 364 | - (UILabel *)messageLabel 365 | { 366 | if (!_messageLabel) { 367 | _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(kFTNotificationMargin_X*2 + kFTNotificationImageSize, kFTNotificationStatusBarHeight+kFTNotificationTitleHeight, kFTScreenWidth - kFTNotificationMargin_X*2 - kFTNotificationImageSize, 40)]; 368 | _messageLabel.textColor = kFTNotificationDefaultTextColor; 369 | _messageLabel.font = kFTNotificationDefaultMessageFont; 370 | _messageLabel.numberOfLines = 0; 371 | [self.contentView addSubview:_messageLabel]; 372 | } 373 | return _messageLabel; 374 | } 375 | 376 | - (UIColor *)getTextColorWithStyle:(UIBlurEffectStyle)style 377 | { 378 | switch (style) { 379 | case UIBlurEffectStyleDark: 380 | return kFTNotificationDefaultTextColor_ForDarkStyle; 381 | break; 382 | default: 383 | return kFTNotificationDefaultTextColor; 384 | break; 385 | } 386 | } 387 | 388 | #pragma mark - main methods 389 | 390 | - (void)showWithImage:(UIImage *)image title:(NSString *)title message:(NSString *)message style:(UIBlurEffectStyle)style 391 | { 392 | self.effect = [UIBlurEffect effectWithStyle:style]; 393 | 394 | if (image) { 395 | self.iconImageView.image = image; 396 | } 397 | self.iconImageView.hidden = !(image); 398 | self.titleLabel.text = title; 399 | self.messageLabel.text = message; 400 | self.titleLabel.textColor = [self getTextColorWithStyle:style]; 401 | self.messageLabel.textColor = [self getTextColorWithStyle:style]; 402 | 403 | 404 | CGSize messageSize = [self getFrameForNotificationMessageLabelWithImage:self.iconImageView.image message:message]; 405 | 406 | CGFloat text_X = image ? kFTNotificationMargin_X*2 + kFTNotificationImageSize : kFTNotificationMargin_X; 407 | 408 | _iconImageView.frame = CGRectMake(kFTNotificationMargin_X, kFTNotificationStatusBarHeight + kFTNotificationMargin_Y, kFTNotificationImageSize, kFTNotificationImageSize); 409 | 410 | self.titleLabel.frame = CGRectMake(text_X, kFTNotificationStatusBarHeight, kFTScreenWidth - kFTNotificationMargin_X - text_X, kFTNotificationTitleHeight); 411 | self.messageLabel.frame = CGRectMake(text_X, kFTNotificationStatusBarHeight+kFTNotificationTitleHeight, kFTScreenWidth - kFTNotificationMargin_X - text_X, messageSize.height); 412 | } 413 | 414 | #pragma mark - getFrameForNotificationMessageLabelWithImage 415 | 416 | - (CGSize )getFrameForNotificationMessageLabelWithImage:(UIImage *)image message:(NSString *)notificationMessage 417 | { 418 | CGFloat textWidth = image ? (kFTScreenWidth - kFTNotificationMargin_X*3 - kFTNotificationImageSize) : (kFTScreenWidth - kFTNotificationMargin_X*2); 419 | CGRect textSize = [notificationMessage boundingRectWithSize:CGSizeMake(textWidth, MAXFLOAT) 420 | options:(NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin) 421 | attributes:@{NSFontAttributeName : kFTNotificationDefaultMessageFont} 422 | context:nil]; 423 | CGSize size = CGSizeMake(textSize.size.width, MIN(textSize.size.height ,kFTNotificationMaxHeight - kFTNotificationTitleHeight - kFTNotificationStatusBarHeight - kFTNotificationMargin_Y)); 424 | return size; 425 | } 426 | 427 | #pragma mark - getFrameForNotificationViewWithImage 428 | 429 | - (CGSize )getFrameForNotificationViewWithImage:(UIImage *)image message:(NSString *)notificationMessage 430 | { 431 | CGSize textSize = [self getFrameForNotificationMessageLabelWithImage:image message:notificationMessage]; 432 | CGSize size = CGSizeMake(kFTScreenWidth, MAX(MIN(textSize.height + kFTNotificationMargin_Y + kFTNotificationTitleHeight + kFTNotificationStatusBarHeight,kFTNotificationMaxHeight), kFTNotificationStatusBarHeight + kFTNotificationMargin_Y*2 + kFTNotificationImageSize)); 433 | return size; 434 | } 435 | 436 | @end 437 | -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/.DS_Store -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_failure.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_failure_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_failure_dark.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_info.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_info_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_info_dark.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_success.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_success_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liufengting/FTIndicator/1a1b946e2ae74f74cef93b32ef6e03582998fa23/FTIndicator/FTProgressIndicator/FTProgressIndicator.bundle/ft_success_dark.png -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FTProgressIndicator.h 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/26. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #pragma mark - FTProgressIndicatorMessageType 12 | 13 | /** 14 | FTProgressIndicatorMessageType 15 | 16 | - FTProgressIndicatorMessageTypeInfo: FTProgressIndicatorMessageTypeInfo 17 | - FTProgressIndicatorMessageTypeSuccess: FTProgressIndicatorMessageTypeSuccess 18 | - FTProgressIndicatorMessageTypeError: FTProgressIndicatorMessageTypeError 19 | - FTProgressIndicatorMessageTypeProgress: FTProgressIndicatorMessageTypeProgress 20 | */ 21 | typedef NS_ENUM(NSUInteger, FTProgressIndicatorMessageType) { 22 | FTProgressIndicatorMessageTypeInfo, 23 | FTProgressIndicatorMessageTypeSuccess, 24 | FTProgressIndicatorMessageTypeError, 25 | FTProgressIndicatorMessageTypeProgress 26 | }; 27 | 28 | #pragma mark - FTProgressIndicator 29 | /** 30 | FTProgressIndicator 31 | */ 32 | @interface FTProgressIndicator : NSObject 33 | 34 | /** 35 | showProgressWithMessage 36 | 37 | @param message message 38 | */ 39 | + (void)showProgressWithMessage:(NSString *)message; 40 | 41 | /** 42 | showProgressWithMessage userInteractionEnable 43 | 44 | @param message message 45 | @param userInteractionEnable userInteractionEnable 46 | */ 47 | + (void)showProgressWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 48 | 49 | /** 50 | showInfoWithMessage 51 | 52 | @param message message 53 | */ 54 | + (void)showInfoWithMessage:(NSString *)message; 55 | 56 | /** 57 | showInfoWithMessage userInteractionEnable 58 | 59 | @param message message 60 | @param userInteractionEnable userInteractionEnable 61 | */ 62 | + (void)showInfoWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 63 | 64 | /** 65 | showInfoWithMessage image userInteractionEnable 66 | 67 | @param message message 68 | @param image image 69 | @param userInteractionEnable userInteractionEnable 70 | */ 71 | + (void)showInfoWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 72 | 73 | /** 74 | showSuccessWithMessage 75 | 76 | @param message message 77 | */ 78 | + (void)showSuccessWithMessage:(NSString *)message; 79 | 80 | /** 81 | showSuccessWithMessage userInteractionEnable 82 | 83 | @param message message 84 | @param userInteractionEnable userInteractionEnable 85 | */ 86 | + (void)showSuccessWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 87 | 88 | /** 89 | showSuccessWithMessage image userInteractionEnable 90 | 91 | @param message message 92 | @param image image 93 | @param userInteractionEnable userInteractionEnable 94 | */ 95 | + (void)showSuccessWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 96 | 97 | /** 98 | showErrorWithMessage 99 | 100 | @param message message 101 | */ 102 | + (void)showErrorWithMessage:(NSString *)message; 103 | 104 | /** 105 | showErrorWithMessage userInteractionEnable 106 | 107 | @param message message 108 | @param userInteractionEnable userInteractionEnable 109 | */ 110 | + (void)showErrorWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable; 111 | 112 | /** 113 | showErrorWithMessage image userInteractionEnable 114 | 115 | @param message message 116 | @param image image 117 | @param userInteractionEnable userInteractionEnable 118 | */ 119 | + (void)showErrorWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable; 120 | 121 | /** 122 | dismiss 123 | */ 124 | + (void)dismiss; 125 | 126 | /** 127 | setProgressIndicatorStyleToDefaultStyle 128 | */ 129 | + (void)setProgressIndicatorStyleToDefaultStyle; 130 | 131 | /** 132 | setProgressIndicatorStyle 133 | 134 | @param style style 135 | */ 136 | + (void)setProgressIndicatorStyle:(UIBlurEffectStyle)style; 137 | 138 | @end 139 | 140 | #pragma mark - FTProgressIndicatorView 141 | 142 | /** 143 | FTProgressIndicatorView 144 | */ 145 | @interface FTProgressIndicatorView : UIVisualEffectView 146 | 147 | /** 148 | userInteractionEnable, if allows user touches at view 149 | */ 150 | @property (assign, nonatomic) BOOL userInteractionEnable; 151 | 152 | /** 153 | showProgressWithType 154 | 155 | @param type type 156 | @param message message 157 | @param image custom image 158 | @param style style 159 | @param userInteractionEnable userInteractionEnable 160 | */ 161 | - (void)showProgressWithType:(FTProgressIndicatorMessageType )type message:(NSString *)message image:(UIImage *)image style:(UIBlurEffectStyle)style userInteractionEnable:(BOOL)userInteractionEnable; 162 | 163 | /** 164 | getFrameForProgressViewWithMessage 165 | 166 | @param progressMessage progressMessage 167 | @return CGSize 168 | */ 169 | - (CGSize )getFrameForProgressViewWithMessage:(NSString *)progressMessage; 170 | 171 | @end 172 | -------------------------------------------------------------------------------- /FTIndicator/FTProgressIndicator/FTProgressIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // FTProgressIndicator.m 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/26. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "FTProgressIndicator.h" 10 | 11 | #pragma mark - Defines 12 | 13 | #define kFTProgressMaxWidth (240.f) 14 | #define kFTProgressMargin_X (20.f) 15 | #define kFTProgressMargin_Y (20.f) 16 | #define kFTProgressImageSize (30.f) 17 | #define kFTProgressImageToLabel (15.f) 18 | #define kFTProgressCornerRadius (10.f) 19 | #define kFTProgressDefaultAnimationDuration (0.2f) 20 | #define kFTProgressDefaultFont [UIFont systemFontOfSize:15] 21 | #define kFTProgressDefaultTextColor [UIColor blackColor] 22 | #define kFTProgressDefaultTextColor_ForDarkStyle [UIColor whiteColor] 23 | #define kFTProgressDefaultBackgroundColor [UIColor clearColor] 24 | 25 | #define kFTScreenWidth [UIScreen mainScreen].bounds.size.width 26 | #define kFTScreenHeight [UIScreen mainScreen].bounds.size.height 27 | 28 | #pragma mark - FTProgressIndicator 29 | 30 | @interface FTProgressIndicator () 31 | 32 | @property (nonatomic, strong) UIWindow *backgroundWindow; 33 | @property (nonatomic, strong) FTProgressIndicatorView *progressView; 34 | @property (nonatomic, assign) UIBlurEffectStyle indicatorStyle; 35 | @property (nonatomic, strong) NSString *progressMessage; 36 | @property (nonatomic, strong) UIImage *customImage; 37 | @property (nonatomic, strong) NSTimer *dismissTimer; 38 | @property (nonatomic, assign) FTProgressIndicatorMessageType messageType; 39 | @property (nonatomic, assign) BOOL isDuringAnimation; 40 | @property (nonatomic, assign) BOOL isCurrentlyOnScreen; 41 | @property (nonatomic, assign) BOOL userInteractionEnable; 42 | 43 | @end 44 | 45 | @implementation FTProgressIndicator 46 | 47 | #pragma mark - class methods 48 | 49 | + (FTProgressIndicator *)sharedInstance 50 | { 51 | static FTProgressIndicator *shared; 52 | static dispatch_once_t onceToken; 53 | dispatch_once(&onceToken, ^{ 54 | shared = [[FTProgressIndicator alloc] init]; 55 | }); 56 | return shared; 57 | } 58 | 59 | + (void)setProgressIndicatorStyleToDefaultStyle 60 | { 61 | [self sharedInstance].indicatorStyle = UIBlurEffectStyleLight; 62 | } 63 | + (void)setProgressIndicatorStyle:(UIBlurEffectStyle)style 64 | { 65 | [self sharedInstance].indicatorStyle = style; 66 | } 67 | + (void)showProgressWithMessage:(NSString *)message 68 | { 69 | [self showProgressWithMessage:message userInteractionEnable:YES]; 70 | } 71 | + (void)showProgressWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 72 | { 73 | [[self sharedInstance] showProgressWithType:FTProgressIndicatorMessageTypeProgress message:message image:nil userInteractionEnable:userInteractionEnable]; 74 | } 75 | + (void)showInfoWithMessage:(NSString *)message 76 | { 77 | [self showInfoWithMessage:message image:nil userInteractionEnable:YES]; 78 | } 79 | + (void)showInfoWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 80 | { 81 | [self showInfoWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 82 | } 83 | + (void)showInfoWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 84 | { 85 | [[self sharedInstance] showProgressWithType:FTProgressIndicatorMessageTypeInfo message:message image:image userInteractionEnable:userInteractionEnable]; 86 | } 87 | + (void)showSuccessWithMessage:(NSString *)message 88 | { 89 | [self showSuccessWithMessage:message image:nil userInteractionEnable:YES]; 90 | } 91 | + (void)showSuccessWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 92 | { 93 | [self showSuccessWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 94 | } 95 | + (void)showSuccessWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 96 | { 97 | [[self sharedInstance] showProgressWithType:FTProgressIndicatorMessageTypeSuccess message:message image:image userInteractionEnable:userInteractionEnable]; 98 | } 99 | + (void)showErrorWithMessage:(NSString *)message 100 | { 101 | [self showErrorWithMessage:message image:nil userInteractionEnable:YES]; 102 | } 103 | + (void)showErrorWithMessage:(NSString *)message userInteractionEnable:(BOOL)userInteractionEnable 104 | { 105 | [self showErrorWithMessage:message image:nil userInteractionEnable:userInteractionEnable]; 106 | } 107 | + (void)showErrorWithMessage:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 108 | { 109 | [[self sharedInstance] showProgressWithType:FTProgressIndicatorMessageTypeError message:message image:image userInteractionEnable:userInteractionEnable]; 110 | } 111 | + (void)dismiss 112 | { 113 | [[self sharedInstance] dismiss]; 114 | } 115 | 116 | #pragma mark - instance methods 117 | 118 | - (instancetype)init 119 | { 120 | self = [super init]; 121 | if (self) { 122 | [[NSNotificationCenter defaultCenter] addObserver:self 123 | selector:@selector(onChangeStatusBarOrientationNotification:) 124 | name:UIApplicationDidChangeStatusBarOrientationNotification 125 | object:nil]; 126 | [[NSNotificationCenter defaultCenter] addObserver:self 127 | selector:@selector(onKeyboardDidChangeFrame:) 128 | name:UIKeyboardWillChangeFrameNotification 129 | object:nil]; 130 | } 131 | return self; 132 | } 133 | 134 | - (UIWindow *)backgroundWindow 135 | { 136 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 137 | id delegate = [[UIApplication sharedApplication] delegate]; 138 | if (window == nil && [delegate respondsToSelector:@selector(window)]){ 139 | window = [delegate performSelector:@selector(window)]; 140 | } 141 | return window; 142 | } 143 | 144 | - (FTProgressIndicatorView *)progressView 145 | { 146 | if (!_progressView) { 147 | _progressView = [[FTProgressIndicatorView alloc] initWithFrame:CGRectZero]; 148 | } 149 | return _progressView; 150 | } 151 | 152 | - (void)setUserInteractionEnable:(BOOL)userInteractionEnable 153 | { 154 | self.progressView.userInteractionEnable = userInteractionEnable; 155 | _userInteractionEnable = userInteractionEnable; 156 | } 157 | 158 | - (void)showProgressWithType:(FTProgressIndicatorMessageType )type message:(NSString *)message image:(UIImage *)image userInteractionEnable:(BOOL)userInteractionEnable 159 | { 160 | dispatch_async(dispatch_get_main_queue(), ^{ 161 | self.messageType = type; 162 | self.progressMessage = message; 163 | self.customImage = image; 164 | self.userInteractionEnable = userInteractionEnable; 165 | self.isCurrentlyOnScreen = NO; 166 | 167 | [self stopDismissTimer]; 168 | 169 | if (self.isDuringAnimation) { 170 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kFTProgressDefaultAnimationDuration * 2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 171 | [self adjustIndicatorFrame]; 172 | }); 173 | }else{ 174 | [self adjustIndicatorFrame]; 175 | } 176 | }); 177 | } 178 | - (void)dismiss 179 | { 180 | [self stopDismissTimer]; 181 | [self dismissingProgressView]; 182 | } 183 | 184 | - (void)adjustIndicatorFrame 185 | { 186 | self.progressView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); 187 | 188 | CGSize progressSize = [self.progressView getFrameForProgressViewWithMessage:self.progressMessage]; 189 | 190 | [self.progressView setFrame:CGRectMake((kFTScreenWidth - progressSize.width)/2, (kFTScreenHeight - [self keyboardHeight] - progressSize.height)/2, progressSize.width, progressSize.height)]; 191 | 192 | [self.progressView showProgressWithType:self.messageType message:self.progressMessage image:self.customImage style:self.indicatorStyle userInteractionEnable:self.userInteractionEnable]; 193 | 194 | [self.backgroundWindow addSubview:self.progressView]; 195 | 196 | [self startShowingProgressView]; 197 | } 198 | 199 | - (void)onChangeStatusBarOrientationNotification:(NSNotification *)notification 200 | { 201 | if (self.isCurrentlyOnScreen) { 202 | [self adjustIndicatorFrame]; 203 | } 204 | } 205 | - (void)onKeyboardDidChangeFrame:(NSNotification *)notification 206 | { 207 | 208 | NSDictionary *userInfo = [notification userInfo]; 209 | CGRect keyboardRect = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; 210 | NSTimeInterval animationDuration; 211 | [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; 212 | CGRect originRect = self.progressView.frame; 213 | originRect.origin.y = ((MIN(kFTScreenHeight, keyboardRect.origin.y)) - originRect.size.height)/2; 214 | [UIView animateWithDuration:animationDuration 215 | delay:0 216 | options:(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction) 217 | animations:^{ 218 | [self.progressView setFrame:originRect]; 219 | }completion:^(BOOL finished) { 220 | 221 | }]; 222 | } 223 | 224 | - (CGFloat)keyboardHeight 225 | { 226 | for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]){ 227 | if ([[testWindow class] isEqual:[UIWindow class]] == NO){ 228 | for (UIView *possibleKeyboard in [testWindow subviews]){ 229 | if ([[possibleKeyboard description] hasPrefix:@" 10 | 11 | #pragma mark - FTToastIndicator 12 | /** 13 | FTToastIndicator 14 | */ 15 | @interface FTToastIndicator : NSObject 16 | /** 17 | setIndicatorStyleToDefaultStyle 18 | */ 19 | + (void)setToastIndicatorStyleToDefaultStyle; 20 | /** 21 | setIndicatorStyle 22 | 23 | @param style style 24 | */ 25 | + (void)setToastIndicatorStyle:(UIBlurEffectStyle)style; 26 | /** 27 | showToastMessage 28 | 29 | @param toastMessage toastMessage 30 | */ 31 | + (void)showToastMessage:(NSString *)toastMessage; 32 | 33 | /** 34 | dismiss 35 | */ 36 | + (void)dismiss; 37 | 38 | @end 39 | 40 | #pragma mark - FTToastIndicatorView 41 | 42 | /** 43 | FTToastIndicatorView 44 | */ 45 | @interface FTToastIndicatorView : UIVisualEffectView 46 | /** 47 | showToastMessage 48 | 49 | @param toastMessage toastMessage 50 | @param style style 51 | */ 52 | - (void)showToastMessage:(NSString *)toastMessage withStyle:(UIBlurEffectStyle)style; 53 | /** 54 | getFrameForToastViewWithMessage 55 | 56 | @param toastMessage toastMessage 57 | @return CGSize 58 | */ 59 | - (CGSize )getFrameForToastViewWithMessage:(NSString *)toastMessage; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /FTIndicator/FTToastIndicator/FTToastIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // FTToastIndicator.m 3 | // FTIndicator 4 | // 5 | // Created by liufengting on 16/7/26. 6 | // Copyright © 2016年 liufengting ( https://github.com/liufengting ). All rights reserved. 7 | // 8 | 9 | #import "FTToastIndicator.h" 10 | 11 | #pragma mark - Defines 12 | 13 | #define kFTToastMaxWidth (kFTScreenWidth*0.7) 14 | #define kFTToastMaxHeight (100.f) 15 | #define kFTToastMargin_X (20.f) 16 | #define kFTToastMargin_Y (10.f) 17 | #define kFTToastToBottom (20.f) 18 | #define kFTToastCornerRadius (8.f) 19 | #define kFTToastDefaultAnimationDuration (0.2f) 20 | #define kFTToastDefaultFont [UIFont systemFontOfSize:15] 21 | #define kFTToastDefaultTextColor [UIColor blackColor] 22 | #define kFTToastDefaultTextColor_ForDarkStyle [UIColor whiteColor] 23 | 24 | #define kFTScreenWidth [UIScreen mainScreen].bounds.size.width 25 | #define kFTScreenHeight [UIScreen mainScreen].bounds.size.height 26 | 27 | #pragma mark - FTToastIndicator 28 | 29 | @interface FTToastIndicator () 30 | 31 | @property (nonatomic, strong)UIWindow *backgroundWindow; 32 | @property (nonatomic, strong)FTToastIndicatorView *toastView; 33 | @property (nonatomic, assign)UIBlurEffectStyle indicatorStyle; 34 | @property (nonatomic, strong)NSString *toastMessage; 35 | @property (nonatomic, strong)NSTimer *dismissTimer; 36 | @property (nonatomic, assign)BOOL isDuringAnimation; 37 | @property (nonatomic, assign)BOOL isCurrentlyOnScreen; 38 | 39 | @end 40 | 41 | @implementation FTToastIndicator 42 | 43 | #pragma mark - class methods 44 | 45 | + (FTToastIndicator *)sharedInstance 46 | { 47 | static FTToastIndicator *shared; 48 | static dispatch_once_t onceToken; 49 | dispatch_once(&onceToken, ^{ 50 | shared = [[FTToastIndicator alloc] init]; 51 | }); 52 | return shared; 53 | } 54 | 55 | + (void)setToastIndicatorStyleToDefaultStyle 56 | { 57 | [self sharedInstance].indicatorStyle = UIBlurEffectStyleLight; 58 | } 59 | 60 | + (void)setToastIndicatorStyle:(UIBlurEffectStyle)style 61 | { 62 | [self sharedInstance].indicatorStyle = style; 63 | } 64 | 65 | + (void)showToastMessage:(NSString *)toastMessage 66 | { 67 | [[self sharedInstance] showToastMessage:toastMessage]; 68 | } 69 | 70 | + (void)dismiss 71 | { 72 | [[self sharedInstance] dismiss]; 73 | } 74 | 75 | #pragma mark - instance methods 76 | 77 | - (instancetype)init 78 | { 79 | self = [super init]; 80 | if (self) { 81 | [[NSNotificationCenter defaultCenter] addObserver:self 82 | selector:@selector(onChangeStatusBarOrientationNotification:) 83 | name:UIApplicationDidChangeStatusBarOrientationNotification 84 | object:nil]; 85 | [[NSNotificationCenter defaultCenter] addObserver:self 86 | selector:@selector(onKeyboardWillChangeFrame:) 87 | name:UIKeyboardWillChangeFrameNotification 88 | object:nil]; 89 | } 90 | return self; 91 | } 92 | 93 | - (UIWindow *)backgroundWindow 94 | { 95 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 96 | id delegate = [[UIApplication sharedApplication] delegate]; 97 | if (window == nil && [delegate respondsToSelector:@selector(window)]){ 98 | window = [delegate performSelector:@selector(window)]; 99 | } 100 | return window; 101 | } 102 | 103 | - (FTToastIndicatorView *)toastView 104 | { 105 | if (!_toastView) { 106 | _toastView = [[FTToastIndicatorView alloc] initWithFrame:CGRectZero]; 107 | } 108 | return _toastView; 109 | } 110 | 111 | - (void)showToastMessage:(NSString *)toastMessage 112 | { 113 | dispatch_async(dispatch_get_main_queue(), ^{ 114 | self.toastMessage = toastMessage; 115 | self.isCurrentlyOnScreen = NO; 116 | 117 | [self stopDismissTimer]; 118 | 119 | if (self.isDuringAnimation) { 120 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kFTToastDefaultAnimationDuration * 2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 121 | [self adjustIndicatorFrame]; 122 | }); 123 | }else{ 124 | [self adjustIndicatorFrame]; 125 | } 126 | }); 127 | } 128 | 129 | - (void)dismiss 130 | { 131 | [self stopDismissTimer]; 132 | [self dismissingToastView]; 133 | } 134 | 135 | - (void)adjustIndicatorFrame 136 | { 137 | self.toastView.alpha = 1; 138 | self.toastView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); 139 | 140 | CGSize toastSize = [self.toastView getFrameForToastViewWithMessage:self.toastMessage]; 141 | 142 | [self.toastView setFrame:CGRectMake((kFTScreenWidth - toastSize.width)/2, kFTScreenHeight - [self keyboardHeight] - kFTToastToBottom - toastSize.height, toastSize.width, toastSize.height)]; 143 | [self.toastView showToastMessage:self.toastMessage withStyle:self.indicatorStyle]; 144 | 145 | [self.backgroundWindow addSubview:self.toastView]; 146 | 147 | self.toastView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.2, 0.2); 148 | 149 | [self startShowingToastView]; 150 | } 151 | 152 | - (void)onChangeStatusBarOrientationNotification:(NSNotification *)notification 153 | { 154 | if (self.isCurrentlyOnScreen) { 155 | [self adjustIndicatorFrame]; 156 | } 157 | } 158 | 159 | - (void)onKeyboardWillChangeFrame:(NSNotification *)notification 160 | { 161 | NSDictionary *userInfo = [notification userInfo]; 162 | CGRect keyboardRect = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; 163 | NSTimeInterval animationDuration; 164 | [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; 165 | CGRect originRect = self.toastView.frame; 166 | CGFloat y = MIN(kFTScreenHeight, keyboardRect.origin.y) - kFTToastToBottom - originRect.size.height; 167 | [UIView animateWithDuration:animationDuration 168 | delay:0 169 | options:UIViewAnimationOptionCurveEaseIn 170 | animations:^{ 171 | [self.toastView setFrame:CGRectMake(originRect.origin.x, y, originRect.size.width, originRect.size.height)]; 172 | }completion:^(BOOL finished) { 173 | 174 | }]; 175 | } 176 | 177 | - (CGFloat)keyboardHeight 178 | { 179 | for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]){ 180 | if ([[testWindow class] isEqual:[UIWindow class]] == NO){ 181 | for (UIView *possibleKeyboard in [testWindow subviews]){ 182 | if ([[possibleKeyboard description] hasPrefix:@" "wo157121900@me.com" } 10 | s.homepage = "https://github.com/liufengting/FTIndicator" 11 | s.license = { :type => "MIT", :file => "LICENSE" } 12 | s.social_media_url = "https://twitter.com/liufengting" 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/liufengting/FTIndicator.git", :tag => "#{s.version}" } 15 | s.source_files = "FTNotificationIndicator", "FTIndicator/FTNotificationIndicator/*.{h,m}" 16 | s.requires_arc = true 17 | 18 | end 19 | -------------------------------------------------------------------------------- /FTProgressIndicator.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "FTProgressIndicator" 4 | s.version = "1.2.9" 5 | s.summary = "A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support." 6 | s.description = <<-DESC 7 | A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support. Inspried by Apple's process indicator and notifications. 8 | DESC 9 | s.author = { "liufengting" => "wo157121900@me.com" } 10 | s.homepage = "https://github.com/liufengting/FTIndicator" 11 | s.license = { :type => "MIT", :file => "LICENSE" } 12 | s.social_media_url = "https://twitter.com/liufengting" 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/liufengting/FTIndicator.git", :tag => "#{s.version}" } 15 | s.source_files = "FTProgressIndicator", "FTIndicator/FTProgressIndicator/*.{h,m}" 16 | s.resources = "FTIndicator/FTProgressIndicator/*.{bundle}" 17 | s.requires_arc = true 18 | 19 | end 20 | -------------------------------------------------------------------------------- /FTToastIndicator.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "FTToastIndicator" 4 | s.version = "1.2.9" 5 | s.summary = "A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support." 6 | s.description = <<-DESC 7 | A lightwight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes Support. Inspried by Apple's process indicator and notifications. 8 | DESC 9 | s.author = { "liufengting" => "wo157121900@me.com" } 10 | s.homepage = "https://github.com/liufengting/FTIndicator" 11 | s.license = { :type => "MIT", :file => "LICENSE" } 12 | s.social_media_url = "https://twitter.com/liufengting" 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/liufengting/FTIndicator.git", :tag => "#{s.version}" } 15 | s.source_files = "FTToastIndicator", "FTIndicator/FTToastIndicator/**/*.{h,m}" 16 | s.requires_arc = true 17 | 18 | end 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Liu Fengting 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![FTIndicator](https://raw.githubusercontent.com/liufengting/FTResourceRepo/master/Resource/FTIndicator/FTIndicator.jpg) 2 | 3 | # FTIndicator 4 | 5 | [![Twitter](https://img.shields.io/badge/twitter-@liufengting-blue.svg?style=flat)](http://twitter.com/liufengting) 6 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/liufengting/FTIndicator/master/LICENSE) 7 | [![Version](https://img.shields.io/cocoapods/v/FTIndicator.svg?style=flat)](http://cocoapods.org/pods/FTIndicator) 8 | [![Platform](https://img.shields.io/cocoapods/p/FTIndicator.svg?style=flat)](http://cocoapods.org/pods/FTIndicator) 9 | [![Download](https://img.shields.io/cocoapods/dt/FTIndicator.svg?maxAge=2592000)](http://cocoapods.org/pods/FTIndicator) 10 | [![CocoaPods](https://img.shields.io/cocoapods/at/FTIndicator.svg?maxAge=2592000)](http://cocoapods.org/pods/FTIndicator) 11 | [![CocoaPods](https://img.shields.io/cocoapods/metrics/doc-percent/FTIndicator.svg?maxAge=2592000)](http://cocoapods.org/pods/FTIndicator) 12 | [![CI Status](http://img.shields.io/travis/liufengting/FTIndicator.svg?style=flat)](https://travis-ci.org/liufengting/FTIndicator) 13 | [![GitHub stars](https://img.shields.io/github/stars/liufengting/FTIndicator.svg)](https://github.com/liufengting/FTIndicator/stargazers) 14 | 15 | 16 | A light wight UI package contains local notification, progress HUD, toast, with `blur effect`, `elegant API` and `themes Support` for iOS. Inspired by Apple's process HUD, notifications and Android's toast. 17 | 18 | 19 | # 3 IN 1 20 | 21 | * If you want use all three of the indicators, use `FTIndicator` . 22 | * Also, `FTNotificationIndicator`, `FTProgressIndicator` and `FTToastIndicator` are able to work separately. Use them all your will. 23 | 24 | --- 25 | 26 | > `FTIndicator` 27 | >> `FTNotificationIndicator` 28 | >> `FTProgressIndicator` 29 | >> `FTToastIndicator` 30 | 31 | --- 32 | 33 | 34 | 35 | # ScreenShots 36 | 37 | ## Portrait 38 | 39 | | Style | Light | Dark | 40 | |:-------------:|:-------------:|:-------------:| 41 | | Notification | | | 42 | | Progress | | | 43 | | Toast | | | 44 | 45 | ## Landscape 46 | 47 | | Style | Light | Dark | 48 | |:-------------:|:-------------:|:-------------:| 49 | | Notification | | | 50 | | Progress | | | 51 | | Toast | | | 52 | 53 | 54 | 55 | 56 | # Installation 57 | 58 | ## Manually 59 | 60 | * clone this repo. 61 | * Simply drop the '/FTIndicator' folder into your project. 62 | * import 'FTIndicator.h' 63 | 64 | ## CocoaPods 65 | 66 | `FTIndicator` is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: 67 | 68 | 69 | ⚠️ Notice: 70 | 71 | Syntax error fix in 1.2.2: Syntax error fixed. May cause error to your projects, update it carefully. 72 | 73 | 74 | ⚠️ Notice: 75 | 76 | major fix in 1.2.0: progress HUD doesn't show when app starts 77 | 78 | `FTNotificationIndicator`, `FTProgressIndicator` and `FTToastIndicator` podfile stopped updating after v1.1.5. If you wanna use them separately, you should use them like this in your Podfile as a subPod: 79 | 80 | ```ruby 81 | pod 'FTIndicator/FTNotificationIndicator' 82 | pod 'FTIndicator/FTProgressIndicator' 83 | pod 'FTIndicator/FTToastIndicator' 84 | ``` 85 | 86 | 87 | ### Use FTIndicator, all three of them 88 | 89 | * FTIndicator, 3 in 1 90 | 91 | ```ruby 92 | pod 'FTIndicator' 93 | ``` 94 | 95 | ### Use separately 96 | 97 | * FTNotificationIndicator 98 | 99 | ~~pod 'FTNotificationIndicator~~ is not available anymore, use this: 100 | 101 | ```ruby 102 | 103 | # use as a subPod 104 | 105 | pod 'FTIndicator/FTNotificationIndicator' 106 | 107 | ``` 108 | 109 | * FTProgressIndicator 110 | 111 | ~~pod "FTProgressIndicator"~~ is not available anymore, use this: 112 | 113 | 114 | ```ruby 115 | 116 | # use as a subPod 117 | 118 | pod 'FTIndicator/FTProgressIndicator' 119 | 120 | ``` 121 | 122 | * FTToastIndicator 123 | 124 | ~~pod 'FTToastIndicator'~~ is not available anymore, use this: 125 | 126 | ```ruby 127 | 128 | # use as a subPod 129 | 130 | pod 'FTIndicator/FTToastIndicator' 131 | 132 | ``` 133 | 134 | # Usage 135 | 136 | ## Use `FTIndicator` 137 | 138 | ### Notification 139 | 140 | * show without image 141 | 142 | ```objective-c 143 | [FTIndicator showNotificationWithTitle:@"Here is a notification title." 144 | message:@"Here is a notification message."]; 145 | ``` 146 | 147 | * show with image 148 | 149 | ```objective-c 150 | [FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 151 | title:@"Here is a notification title." 152 | message:@"Here is a notification message."]; 153 | ``` 154 | 155 | * show with image, with tap handler and completion handler 156 | 157 | ```objective-c 158 | [FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 159 | title:@"Here is a notification title." 160 | message:@"Here is a notification message. Try to tap and see tap handling or do nothing to see completion" 161 | tapHandler:^{ 162 | // handle user tap 163 | } completion:^{ 164 | // handle completion 165 | }]; 166 | ``` 167 | 168 | 169 | * dismiss manually 170 | 171 | ```objective-c 172 | [FTIndicator dismissNotification]; 173 | ``` 174 | 175 | ### Progress 176 | 177 | * show progress 178 | 179 | ```objective-c 180 | 181 | [FTIndicator showProgressWithMessage:@"Here is a progress message."]; 182 | 183 | ``` 184 | 185 | ```objective-c 186 | 187 | // or disable user interactions 188 | 189 | [FTIndicator showProgressWithMessage:@"Here is a progress message." userInteractionEnable:NO]; 190 | 191 | ``` 192 | 193 | * show success 194 | 195 | ```objective-c 196 | 197 | [FTIndicator showSuccessWithMessage:@"Here is a success message."]; 198 | 199 | ``` 200 | 201 | ```objective-c 202 | 203 | // or disable user interactions 204 | 205 | [FTIndicator showSuccessWithMessage:@"Here is a success message." userInteractionEnable:NO]; 206 | 207 | ``` 208 | 209 | * show info 210 | 211 | ```objective-c 212 | 213 | [FTIndicator showInfoWithMessage:@"Here is a info message."]; 214 | 215 | ``` 216 | 217 | ```objective-c 218 | 219 | // or disable user interactions 220 | 221 | [FTIndicator showInfoWithMessage:@"Here is a info message." userInteractionEnable:NO]; 222 | 223 | ``` 224 | 225 | * show error 226 | 227 | ```objective-c 228 | 229 | [FTIndicator showErrorWithMessage:@"Here is a error message."]; 230 | 231 | ``` 232 | 233 | ```objective-c 234 | 235 | // or disable user interactions 236 | 237 | [FTIndicator showErrorWithMessage:@"Here is a error message." userInteractionEnable:NO]; 238 | 239 | ``` 240 | 241 | * dismiss manually 242 | 243 | ```objective-c 244 | [FTIndicator dismissProgress]; 245 | ``` 246 | 247 | ### Toast 248 | 249 | * show with image 250 | 251 | ```objective-c 252 | [FTIndicator showToastMessage:@"Short Toast."]; 253 | ``` 254 | 255 | * dismiss manually 256 | 257 | ```objective-c 258 | [FTIndicator dismissToast]; 259 | ``` 260 | 261 | 262 | ## Use `FTNotificationIndicator`, `FTProgressIndicator`, `FTToastIndicator` separately 263 | 264 | ### FTNotificationIndicator 265 | 266 | * show with image 267 | 268 | ```objective-c 269 | [FTNotificationIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"] 270 | title:@"Here is a notification title." 271 | message:@"Here is a notification message."]; 272 | ``` 273 | 274 | * show without image 275 | 276 | ```objective-c 277 | [FTNotificationIndicator showNotificationWithTitle:@"Here is a notification title." 278 | message:@"Here is a notification message."]; 279 | ``` 280 | 281 | * dismiss manually 282 | 283 | ```objective-c 284 | [FTNotificationIndicator dismiss]; 285 | ``` 286 | 287 | ### FTProgressIndicator 288 | 289 | * show progress 290 | 291 | ```objective-c 292 | [FTProgressIndicator showProgressWithmessage:@"Here is a progress message."]; 293 | ``` 294 | 295 | ```objective-c 296 | // or disable user interactions 297 | [FTProgressIndicator showProgressWithmessage:@"Here is a progress message." userInteractionEnable:NO]; 298 | ``` 299 | 300 | * show success 301 | 302 | ```objective-c 303 | [FTProgressIndicator showSuccessWithMessage:@"Here is a success message."]; 304 | ``` 305 | 306 | ```objective-c 307 | // or disable user interactions 308 | [FTProgressIndicator showSuccessWithMessage:@"Here is a success message." userInteractionEnable:NO]; 309 | ``` 310 | 311 | * show info 312 | 313 | ```objective-c 314 | [FTProgressIndicator showInfoWithMessage:@"Here is a info message."]; 315 | ``` 316 | 317 | ```objective-c 318 | // or disable user interactions 319 | [FTProgressIndicator showInfoWithMessage:@"Here is a info message." userInteractionEnable:NO]; 320 | ``` 321 | 322 | * show error 323 | 324 | ```objective-c 325 | [FTProgressIndicator showErrorWithMessage:@"Here is a error message."]; 326 | ``` 327 | 328 | ```objective-c 329 | // or disable user interactions 330 | [FTProgressIndicator showErrorWithMessage:@"Here is a error message." userInteractionEnable:NO]; 331 | ``` 332 | 333 | * dismiss manually 334 | 335 | ```objective-c 336 | [FTProgressIndicator dismiss]; 337 | ``` 338 | 339 | ### FTToastIndicator 340 | 341 | * show with image 342 | 343 | ```objective-c 344 | [FTToastIndicator showToastMessage:@"Short Toast."]; 345 | ``` 346 | 347 | * dismiss manually 348 | 349 | ```objective-c 350 | [FTToastIndicator dismiss]; 351 | ``` 352 | 353 | # CHANGELOG 354 | 355 | [CHANGELOG](https://github.com/liufengting/FTIndicator/blob/master/CHANGELOG.md) 356 | 357 | # License 358 | 359 | `FTIndicator` is available under the MIT license. See the LICENSE file for more info. 360 | 361 | 362 | 363 | --------------------------------------------------------------------------------