Skip to content

Instantly share code, notes, and snippets.

View nazmulkp's full-sized avatar

Nazmul Hasan nazmulkp

View GitHub Profile
iOS developer resource ... all kind of plugin
@nazmulkp
nazmulkp / gist:a0e8b54064d4d6facaa4d79ae673f649
Created November 27, 2016 17:04
iOS Apps with REST APIs
Basic set up for API
func fetchJSON(from url: URL) -> RACSignal {
print("Fetching: \(url.absoluteString)")
// 1
return RACSignal.createSignal({(_ subscriber: RACSubscriber) -> RACDisposable in
// 2
var dataTask = self.session.dataTask(withURL: url, completionHandler: {(_ data: Data, _ response: URLResponse, _ .error: Error) -> Void in
// TODO: Handle retrieved data
})
// 3
dataTask.resume()
The following viewDidLoad will (1) set two locations, (2) remove all the previous annotations, and (3) call user defined helper functions (to get route points and draw the route).
var loc1: CLLocationCoordinate2D
loc1.latitude = 29.0167
loc1.longitude = 77.3833
var origin = Annotation(title: "loc1", subTitle: "Home1", andCoordinate: loc1)
objMapView.addAnnotation(origin)
// Destination Location.
var loc2: CLLocationCoordinate2D
loc2.latitude = 19.076000
@nazmulkp
nazmulkp / gist:c0b57185f76fb426634c65eb0476889e
Last active February 15, 2017 09:30
how can i reuse UIView Swift ?
var sparteLine : UIView = {
var view = UIView()
view.backgroundColor = UIColor.blue
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
//Dish Comment
var disComment : LeftPaddingLabel = {
var label = LeftPaddingLabel()
@nazmulkp
nazmulkp / gist:81996ad27b641dc179385d169d66e166
Last active February 16, 2017 06:49
UITableViewCell subviews not moving when editing enabled in NSLayoutConstraint
override func setEditing(_ editing: Bool, animated: Bool) {
// Toggles the edit button state
super.setEditing(editing, animated: animated)
// Toggles the actual editing actions appearing on a table view
tableView.setEditing(editing, animated: true)
}
@nazmulkp
nazmulkp / gist:8b6927c16254e9956d99395f74eff535
Last active March 7, 2017 10:57
How to switch views programmatically in a ViewController?
talk with segue :
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//TODO:
// showShop(shop: shops[indexPath.row])
performSegue(withIdentifier: "ShopIdentifire", sender: indexPath)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
item[details]
Mixed Herbs + €0, Base - Regular Base, Sauce - Our Signature Tomato Sauce, Cheese - Mozzarella, Topping 1 - None, Topping 2 - None, Topping 3 - None, Topping 4 - None, Would You Like Any Extra Toppings? (€1 per topping) - Ham, ,
item[dishId]
464
item[price]
6.99
item[quantity]
1
item[shopId]
51
What responsibilities will you get when working with us?
Writing clean, architecturally sound and maintainable code.
Maintaining the current iOS apps by fixing bugs and improving application performance.
Working with the other iOS engineers to create a seamless app.
Delivering features in tight deadlines.
Creating a multiple-language mobile app for the entire Middle East.
Collaborating with cross-functional teams to create, design and ship new features.
Unit-test code for robustness, include edge cases, usability and reliability.
Working with our testing team to ensure 100% test coverage.
@nazmulkp
nazmulkp / Jerky Scrolling TableView After insert Sectionsng Section
Last active July 27, 2017 03:23
The initial feed will download with 4 post for previewing, but if the user scrolling down then load more posts, so i need to add section to the bottom table view and section remove from the top.
import UIKit
//import XCGLogger
typealias CheckResult = (Bool)->()
class NewsViewController: BaseViewController {