Skip to main content

Posts

https://github.com/ioscreator/ioscreator

https://github.com/ioscreator/ioscreator
Recent posts

Common API Request Class

// //    Connection.swift //    Norwood // //    Created by Praveen Reddy on 10/01/19. //    Copyright © 2019 Apple. All rights reserved. // import  Foundation import  Alamofire import  SwiftyJSON class  Connection {           func  requestPOST( _  url:  String , params :  Parameters ?, headers :  HTTPHeaders ?, success: @escaping  ( Data ) ->  Void , failure: @escaping  ( Error ) ->  Void )      {                   print( "URL = " ,url)          print( "Parameter = " ,params!)                   //          if Connectivity.isConnectedToInternet() //          {              i...

Network Reachability

import  Foundation import  Alamofire class  Connectivity {      class   func  isConnectedToInternet() -> Bool      {          return  NetworkReachabilityManager()!.isReachable      } }

API Calling Example

import  Foundation import  Alamofire class  HomeViewModel {           let  sharedInstance = Connection()      var  reloadHandler:  DataHandler  = { }      typealias  DataHandler = () ->  Void      init () { }           //--------------------------------------------------      // MarK : fetchInitialSetup    API Integration      //--------------------------------------------------      func  fetchInitialSetup(success: @escaping  ( GetLocationAndDevicesModel ) ->  Void , failure: @escaping  ( Error ) ->  Void )      {          let  URL = AddDeviceList().getUrlString(url: .CREATE_API)                   let  headers :...

TAGS in swift

github link : https://github.com/ElaWorkshop/TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient way is to use Storyboard. Drag a view to Storyboard and set Class to  TagListView  (if you use CocoaPods, also set Module to  TagListView ). Then you can play with the attributes in the right pane, and see the preview in real time thanks to  @IBDesignable . You can add tag to the tag list view, or set custom font and alignment through code: tagListView. textFont = UIFont. systemFontOfSize ( 24 ) tagListView. alignment = . Center // possible values are .Left, .Center, and .Right tagListView. addTag ( " TagListView " ) tagListView. addTags ([ " Add " , " two " , " tags " ]) tagListView. insertTag ( " This should be the second tag " , at : 1 ) tagListView. setTitle ( " New Title " , at : 6 ) // to repla...

BASE CLASS

// //   ConstantUtill.swift //   GoLoad // //   Created by adaps on 11/12/18. //   Copyright © 2018 adaps. All rights reserved. import Foundation let objAJProgressView = AJProgressView () let appDelegate: AppDelegate = UIApplication . shared . delegate as ! AppDelegate func show_AlertView_OK(vc: UIViewController , titleStr: String , messageStr: String ) -> Void {     let alert = UIAlertController (title: titleStr, message: messageStr, preferredStyle: UIAlertController . Style . alert )     alert. addAction ( UIAlertAction (title: "Ok" , style: UIAlertAction . Style . default , handler: nil ))     vc. present (alert, animated: true , completion: nil ) } func showHUD () {     objAJProgressView . imgLogo = UIImage (named: "goload_icon" )!          // Pass the color for the layer of progressView     objAJProgressView . firs...