Networking, tableview, user defaults, data parsing, etc..., are the most common things among many more which we use in almost every project, so why do we repeat the same work again and again if there is something that do that work for us like a boss !! 😎😎.
- Features
- Upcoming features
- Requirements
- Installation
- Quick start
- How to use
- FAQs
- Credits
- Help me improve the documentation
- Author
- Contributers
- Contact US
- License
- Only import boot strap.
- Abstract network layer (Unified error + unified result closure).
- Generic error manager.
- Unified parser.
- Tableview adapter with empty data set handler.
- Reusable table view adapter.
- Toast messages component ( Like the one in Android 😉 ).
- Simplified syntax ( Dequeue cell, go to Viewcontroller programatically ).
- Custom pickers ( List, date, time, date & time, multi lists ).
- Customizable progress dialog.
- Unified base model for objects parsing (Serialize & deserialize).
- Unified base push notification model for push notification payload parsing.
- User defaults manager.
- Base collection and table view cells.
- Only one delegate for collection view & one for table view ( Including empty data set ).
- Singleton logger class ( Like the one in Android 😉 ).
- Useful extensions (String to dictionary, remove duplicates from array, hex to UI color, UIlabel partial text formatting, UIimage + GIF)
- Customizable UIview.
- Customizable Cardview.
- Customizable UIbutton.
- Customizable toggle button ( Check box + radio button ).
- Keyboard handler
- Collection view adapter.
- Reusable collection view adapter.
- Table and collection views pagination handler.
- Image loading ad caching from network out of the box.
- Coordinator design pattern + viewcontrollers naviagator base class + examples
- Simple depenfancy injection implementation.
- Refresh token plugin for moya.
- Refresh token RX Swift plugin.
- Real time listeners for token update/expire event ( Work with 29 or 30 but not alone ).
- Out of the box build variants ( Debug - Staging - Release ) auto handler.
- Read/Write Files/Folder managers.
- In app localization manager ( No need tor restart your app 😉 ).
- Cleaner localization syntax.
- UI button show/hide loading extension.
- Show/hode loading in any vew controller
- BaseTableAdapterController, BaseTableAdapterPresenter, BaseCollectionAdapterController, BaseCollectionAdapterPresenter to save you somtime and code when you implement table or collection view.
- You can call getUserDefaults from BaseController and BasePresenter by default.
- Phone number validator string extension.
- Includes SCLAlertView awesone swift library.
- ViewPager (AKA : Segmented controller) as the one in Android 😁.
- Automated Contexts injection.
- Added UITabBar controller MVP base class.
- Updated the default configurations Class to use builder design pattern instead of static methods.
- Added a new network gneric completion handler in addition to the older ones.
- Cancel any newtowrk request out of the box.
- Base side menu controller + Base tabbar controller + base table and collection view controller, all with MVP out of the box.
- You can hide the notch for iPhone X series 😁.
- Side menu out of the box.
- Event bus helper class.
- Added Skeleton helper class to add skeleton effect to UIViews, table and collection views.
- Added dropdown banner component.
- Includes RXvalidation.
- Out of the box table and collection view live data.
- How to use + examples + documentation + references.
- Push notification manager.
- More extensions! Please if there is an extension you are constantly using, send a PR now.
- iOS 9.1+
- Xcode 9.2+
- Swift 4.1 +
You can integrate iOS_Bootstrap into your project using CocoaPods.
CocoaPods is a dependency manager for iOS Cocoa projects, You can install it with the following command:
$ gem install cocoapods
CocoaPods 1.1+ is required to build iOS_Bootstrap.
To integrate iOS_Bootstrap into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'iOS_Bootstrap'
Then run the following command:
$ pod install
Once your project is integrated with the iOS_Bootstrap , you can pull updates using the following command:
$ pod update
There is a project generator to help you build things faster at thils Link, Enjoy 😎.
Just import iOS_Bootstrap
and your are ready to go.
- For almost every feature available in this Pod their is an example or how to use file or a link to an example or explanation.
- For any thing not clear or for help, please contact me or open a bug and i will assist you as soon as i can.
Ues this
let cell : TableViewCell = tableview.dequeueReusableCell(forIndexPath: indexPath)
Instead of this
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? TableViewCell
Deal with tableview in case the data source is empty or nil.
Use this
let storyboard = UIStoryboard.getStoryboardWithName(Storyboard.home.rawValue)
let homeVC : HomeVC = storyboard.instantiateInitialViewController()
present(homeVC, animated: true, completion: nil)
Instead of this
let storyboard : UIStoryboard = UIStoryboard(name: "Home", bundle:nil)
let homeVC = storyboard.instantiateViewControllerWithIdentifier("nextView") as! HomeVC
self.presentViewController(homeVC, animated:true, completion:nil)
When you use Alamofire, you get success and fail result and the failure closure will be called only if there is a network failure but if there is a server failure like forexample 404, 500, etc.., they all come in the success closure and you have to handle this by yourself, i found this wierd so if you used the GenericErrorHandler
along with the network abstract layer, you can do filter the result of the result closure using the following operators .filterSuccessfulStatusCodes()
& processErrors()
, you can even localise the server messages in case your app. were in different languages.
- Your network request will be something simple like that (A request to get all the world countries) :
func getAllCountries (completion: @escaping completionHandler<[Country]>) {
networkRequest = apisProvider.rx
.request(.getWorldCountries())
.filterSuccessfulStatusAndRedirectCodesAndProcessErrors()
.refreshAuthenticationTokenIfNeeded(tokenRefreshDelegate: self)
.map([Country].self)
.subscribe { event in
switch event {
case .success(let countries):
completion(.success(countries))
case .error(let error):
completion(.failure(error.localizedDescription))
}
}
}
A close that returns a result of any type and an error string.
Instead of filling your code with statemetns which is not good plus it will affetct your code when your release it to production, you can use Log
class which is pretty readable in the console plus it works only in the debug mode and you can debug with error, info., warning, server and more.
Log.error("There is an error ")
Many many more ( About 56 features ), you can find more details in the examples associated with the pod and if anything is not clear just contact me.
Due to a bug in Cocoapods, so the Storyboard sometimes many fail to render if you added a custom
@IBDesignable
view to a component in storyboard and this custom@IBDesignable
view was in the pod files path (Any pod not just my pod) and not your project files path, so to solve this problem please add the following code to the end of your pod file.
# Workaround for Cocoapods issue #7606
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end
For more details, please see this link
-
Do i need to add Alamofire pod to my project ?
No, you do not need to do so since Alamofire will be installed once you add theiOS_Bootstrap
to your project. -
Waht if i need to use Alamofire or anyother dependacy from the
iOS_Bootstrap
, What i have to do ?
All you have to do is to import the library instead of importingiOS_Bootstrap
.
The following awesome libraries are used as dependancies in my pod :
In addition, the following Repos helped me alot either by including their codes directly into my pod or using some portion of their codes to improve my library or to learn something new so thank you for sharing your awesome codes for free to the community.
- EZLoadingActivity.
- MoyaSugar.
- Lucid.
- ActionSheetPicker-3.0.
- ADTPagerController.
- Bartinter.
- SlideMenuControllerSwift.
- HairPowder.
- SwiftEventBus.
- BRYXBanner
- RxValidator
As a developer trying this pod out for the first time, you can make a valuable contribution by improving the documentation.
- Send a feedback about something you thought was confusing or simply missing.
- Suggesting better wording or ways of explaining certain topics.
- A pull request via GitHub.
- Bug reports, feature requests, patches, well-wishes, and rap demo tapes are always welcome.
Ahmad Mahmoud Saleh
iOS_Bootstrap is released under the MIT license. See License for details.