This is a must-have library/pod for any iOS developer who uses Swift as his main programming language.
MIT License
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 !! .
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.
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.
#### Unified result closure :
A close that returns a result of any type and an error string.
#### Loggers :
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.
### Note :
>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.
>
```ruby
# 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 the iOS_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 importing iOS_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.
As a developer trying this pod out for the first time, you can make a valuable contribution by improving the documentation.
Ahmad Mahmoud Saleh
iOS_Bootstrap is released under the MIT license. See License for details.