{"id":15037665,"url":"https://github.com/mspvirajpatel/swiftybase","last_synced_at":"2025-10-04T03:31:57.673Z","repository":{"id":24534614,"uuid":"101853218","full_name":"mspvirajpatel/SwiftyBase","owner":"mspvirajpatel","description":"SwiftyBase - A Swift library for Create Project in iOS ( Base Project) ","archived":false,"fork":false,"pushed_at":"2025-07-11T07:13:39.000Z","size":27114,"stargazers_count":41,"open_issues_count":16,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-22T05:26:26.370Z","etag":null,"topics":["awesome","basebutton","baseproject","baseview","cocoapods","extension","fullscreen","imagecache","imageviewer","imageviewer-component","locationmanager","navigationcontroller","sidemenu","swift","swift-extensions","swift-library","swift3","viewcontroller"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mspvirajpatel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-30T07:52:10.000Z","updated_at":"2025-07-19T07:35:00.000Z","dependencies_parsed_at":"2024-09-28T22:11:04.501Z","dependency_job_id":null,"html_url":"https://github.com/mspvirajpatel/SwiftyBase","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mspvirajpatel/SwiftyBase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mspvirajpatel%2FSwiftyBase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mspvirajpatel%2FSwiftyBase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mspvirajpatel%2FSwiftyBase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mspvirajpatel%2FSwiftyBase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mspvirajpatel","download_url":"https://codeload.github.com/mspvirajpatel/SwiftyBase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mspvirajpatel%2FSwiftyBase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278259829,"owners_count":25957547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awesome","basebutton","baseproject","baseview","cocoapods","extension","fullscreen","imagecache","imageviewer","imageviewer-component","locationmanager","navigationcontroller","sidemenu","swift","swift-extensions","swift-library","swift3","viewcontroller"],"created_at":"2024-09-24T20:35:16.711Z","updated_at":"2025-10-04T03:31:53.101Z","avatar_url":"https://github.com/mspvirajpatel.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftyBase\n\n[![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=59a6f3aeb749970001234046\u0026branch=master\u0026build=latest)](https://dashboard.buddybuild.com/apps/59a6f3aeb749970001234046/build/latest?branch=master)\n[![Build Status](https://travis-ci.org/mspvirajpatel/SwiftyBase.svg?branch=master)](https://travis-ci.org/mspvirajpatel/SwiftyBase)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![codecov](https://codecov.io/gh/mspvirajpatel/SwiftyBase/branch/master/graph/badge.svg)](https://codecov.io/gh/mspvirajpatel/SwiftyBase)\n[![Version](https://img.shields.io/cocoapods/v/SwiftyBase.svg?style=flat)](http://cocoapods.org/pods/SwiftyBase)\n[![License](https://img.shields.io/cocoapods/l/SwiftyBase.svg?style=flat)](http://cocoapods.org/pods/SwiftyBase)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftyBase.svg?style=flat)](http://cocoapods.org/pods/SwiftyBase)\n[![Language: Swift 3](https://img.shields.io/badge/language-swift3-f48041.svg?style=flat-square)](https://developer.apple.com/swift)\n\n\nSwiftyBase makes it easy to deal with new Project create in Swift.\n\n1. [Why use the SwiftyBase](#why-use-the-swiftybase)\n2. [Requirements](#requirements)\n3. [Integration](#integration)\n4. [Usage](#usage)\n\t- [Initialization](#initialization)\n\t- [BaseViewController](#baseviewcontroller)\n\t- [BaseView](#baseview)\n\t- [BaseNavigationController](#basenavigationcontroller)\n\t- [BaseImageView](#baseimageview)\n\t- [BaseButton](#basebutton)\n\t- [BaseProgressHUD](#baseprogresshud)\n\t- [BaseRoundMenu](#baseroundmenu)\n\t- [BaseLabel](#baselabel)\n\t- [BaseTextField](#basetextfield)\n\t- [SideMenu](#sideMenu)\n\t- [AppImageUploadManager](#appimageuploadmanager)\n\t- [AppPlistManger](#appplistmanger)\n\t- [AppPreferencesExplorer](#apppreferencesexplorer)\n    - [AppEventBus](#appeventbus)\n    - [BaseScrollView](#basescrollview)\n    - [BaseSegment](#basesegment)\n    - [BasePopOverMenu](#basepopovermenu)\n    - [BaseNotificationBadge](#basenotificationbadge)\n    - [AppLocationManager](#applocationmanager)\n5. [In Progress](#in-progress)\n6. [Author](#author)\n\n\n## Why use the SwiftyBase?\n\n- In software development we all know that we have to reuse code as per as requirement so we have to utilise our code with less effort I will show you one demo on that first make one viewcontroller of baseviewcontroller then make one view of base view initialize this view in controller we can use this view in another controller too ...that’s the main purpose of baseview In storyboard or in one view controller have its own view..We all know that if we have work in owns view, then it will not use for another controller so we can implement on baseview \u0026 use it another times with simple initialize.\n\n\nIn Base Project included:\n1. BaseViewController.swift\n2. BaseView.swift\n3. BaseNavigationController.swift\n4. SideMenu\n\nExtensions : \n1. Data\n2. Date\n3. Dictionary\n4. NSArray\n5. NSDictionary\n6. UIColor\n7. UINavigationController\n8. UIScrollView\n9. UITableView\n10. UITextField\n11. UIViewController\n12. UIFont\n13. UIView\n14. String\n15. UIImage\n\nUtilities:\n\n1. AppBaseLayout\n2. AppConstants \n3. AppUtility\n4. AppInterFaceUtility \n5. AppLocationManager\n6. AppTimer\n7. AppAlert\n8. AppPreferencesExplorer\n9. AppPlistManger\n10. AppImageUploadManager\n11. AppEventBus\n\nControls: \n\n1. BaseImageView - with set Url image with catch support \u0026 Clear Catch\n2. BaseButton - Multiple Button with single class access\n3. Full screen Image Viewer  (ImageViewer)\n4. BaseRoundMenu\n5. BaseProgressHUD - Like MBProgressView\n6. BaseLabel - Multiple BaseLabel with single class access \n7. BaseTextField - Multiple Textfield with single class access\n8. BaseScrollView\n9. BaseSegment\n10. BasePopOverMenu\n11. BaseNotificationBadge\n\n## Requirements\n\n- iOS 9.0+ \n- Xcode 8\t\n\n\n## Integration\n\n#### CocoaPods (iOS 9)\n\nYou can use [CocoaPods](http://cocoapods.org/) to install `SwiftyBase`by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n    pod 'SwiftyBase'\nend\n```\n\nNote that this requires CocoaPods version 36, and your iOS deployment target to be at least 9.0:\n\n\n#### Carthage (iOS 9+)\n\nYou can use [Carthage](https://github.com/Carthage/Carthage) to install `SwiftyBase` by adding it to your `Cartfile`:\n\n```\ngithub \"mspvirajpatel/SwiftyBase\"\n```\n\n#### Manually (iOS 9+)\n\nTo use this library in your project manually you may:  \n\n1. Just drag ‘SwiftyBase/’ to the project tree\n\n\n\n## Usage\n\n#### Initialization\n\n```swift\nimport SwiftyBase\n```\n\n#### BaseViewController\n\n```swift\n//If Create ViewContoller using BaseViewController\n\nclass ListController: BaseViewController {\n\n    // MARK: - Attributes -\n    \n    // MARK: - Lifecycle -\n    \n    init() {\n\n    }\n\n}\n```\n\n#### BaseView\n\n```swift\n//If Create ListView using BaseView\n\nclass ListView: BaseView{\n    \n    // MARK: - Attributes -\n    \n    // MARK: - Lifecycle -\n    \n    override init(frame: CGRect) {\n        super.init(frame:frame) \n        \n    }\n}\n\n```\n \n\n#### BaseNavigationController\n\n```swift\n//using BaseNavigationController\nlet listview : ListController = ListController()\n        \nlet baseNavigation : BaseNavigationController = BaseNavigationController(rootViewController: listview)\n\n```\n\n\n#### BaseImageView\n\n```swift\n//using BaseImageView for set Image Local or Remote URL\n\nlet imgView : BaseImageView = BaseImageView(type: .profile, superView: self)\nimgView.layer.setValue(\"imgView\", forKey: ControlConstant.name)\n\n//Set Remote URL for Download and set in Image View\nimgView.setImageURL(\"Enter Your URL\")\n        \n//For Full Screen Image Show on tap on Image\nimgView.setupForImageViewer()\n\n```\n\n\n#### BaseButton \n\n```swift\n//using BaseButton for set Button with case primary, secondary, radio, rounded Close, close, checkbox, dropdown, transparent \n \nlet btnPrimary : BaseButton = BaseButton.init(ibuttonType: .primary, iSuperView: self)\nbtnPrimary.layer.setValue(\"btnPrimary\", forKey: ControlConstant.name)\nbtnPrimary.setTitle(\"Primary Button\", for: UIControlState())\n        \nlet btnSecondary : BaseButton = BaseButton.init(ibuttonType: .secondary, iSuperView: self)\nbtnSecondary.layer.setValue(\"btnSecondary\", forKey: ControlConstant.name)\nbtnSecondary.setTitle(\"Secondary Button\", for: UIControlState())\n\n\n```\n\n\n#### BaseProgressHUD \n\n```swift\n\n//Just the loader\n\nBaseProgressHUD.shared.showInView(view: view)\n\n```\n\n```swift\n\n// Add title and footer text\nBaseProgressHUD.shared.showInView(view: view, withHeader: \"Loading\", andFooter: \"Please wait...\")\n\n```\n\n```swift\n\n// Set color to the header, footer, loader or to the background view\n\nBaseProgressHUD.setHeaderColor(color: UIColor.blue)\nBaseProgressHUD.setFooterColor(color: UIColor.blue)\nBaseProgressHUD.setLoaderColor(color: UIColor.blue)\nBaseProgressHUD.setBackgroundColor(color: UIColor.white)\n\n```\n\n```swift\n\n// Customize: Set color the the background view and let header, footer and loader infer a contrast color\nBaseProgressHUD.setBackgroundColor(color: UIColor.white, automaticTextColor: true)\n\n```\n\n```swift\n\n// Or show in a window\nBaseProgressHUD.shared.showInWindow(window: window, withHeader: \"Loading\", andFooter: \"Please wait...\")\n\n```\n\n```swift\n\n// Hide the HUD\nBaseProgressHUD.shared.hide()\n\n```\n\n```swift\n\n// Check if HUD is already being displayed\nif BaseProgressHUD.shared.isActive {\n    print(\"Currently showing HUD\")\n} else {\n    print(\"HUD is currently hidden\")\n}\n\n```\n\n\n####  BaseRoundMenu\n\n```swift\n//using BaseRoundMenu for set Button with case center,topLeft,topRight,bottomLeft,bottomRight\n\nlet btncenter = BaseRoundMenu(withPosition: .center, size: 50.0, numberOfPetals: 10, images:[])\nlet btntopLeft = BaseRoundMenu(withPosition: .topLeft, size: 50.0, numberOfPetals: 4, images:[])\nlet btntopRight = BaseRoundMenu(withPosition: .topRight, size: 50.0, numberOfPetals: 4, images:[])\nlet btnbottomLeft = BaseRoundMenu(withPosition: .bottomLeft, size: 50.0, numberOfPetals: 4, images:[])\nlet btnbottomRight = BaseRoundMenu(withPosition: .bottomRight, size: 50.0, numberOfPetals: 4, images:[])\n\nself.view.addSubview(btncenter)\nself.view.addSubview(btntopLeft)\nself.view.addSubview(btntopRight)\nself.view.addSubview(btnbottomLeft)\nself.view.addSubview(btnbottomRight)\n\nbtncenter = { (indexSelected) in\n    debugPrint(\"Selected Index: \\(indexSelected)\")\n}\n\n\n```\n\n####  BaseLabel\n\n```swift\n\n//using BaseLabel for set diffrent types of Buttons\n\nlet lblUserName : BaseLabel = BaseLabel(labelType: .small, superView: self)\n\nlet lblUserRealName = BaseLabel(labelType: .large, superView: self)\n\n\n```\n\n####  BaseTextField\n\n```swift\n\n//using BaseTextField for set diffrent types of BaseTextField like Password, Email\n\nlet baseTextField : BaseTextField = BaseTextField.init(iSuperView: self, TextFieldType: .primary)\n\nlet baseTextField : BaseTextField = BaseTextField.init(iSuperView: self, TextFieldType: .showPassword)\n\nlet baseTextField : BaseTextField = BaseTextField.init(iSuperView: self, TextFieldType: .withoutClear)\n\nlet baseTextField : BaseTextField = BaseTextField.init(iSuperView: self, TextFieldType: .noAutoScroll)\n\n```\n\n####  SideMenu\n\n```swift\n\n//using SideMenu for set Application Menu SideMenu\n//SideMenu is a simple and versatile side menu control\n\nlet menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)\nmenuLeftNavigationController.leftSide = true\n// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration \n// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:\n// let menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: \"LeftMenuNavigationController\") as! UISideMenuNavigationController\nSideMenuManager.menuLeftNavigationController = menuLeftNavigationController\n\nlet menuRightNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)\n// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration\n// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:\n// let menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: \"RightMenuNavigationController\") as! UISideMenuNavigationController\nSideMenuManager.menuRightNavigationController = menuRightNavigationController\n\n// Enable gestures. The left and/or right menus must be set up above for these to work.\n// Note that these continue to work on the Navigation Controller independent of the view controller it displays!\nSideMenuManager.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)\nSideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)\n\n\n// For Custom Open with Button Click\npresent(SideMenuManager.menuLeftNavigationController!, animated: true, completion: nil)\n\n// Similarly, to dismiss a menu programmatically, you would do this:\ndismiss(animated: true, completion: nil)\n\n\n```\n\n\n####  AppImageUploadManager\n\n```swift\n\n//using AppImageUploadManager for Multiple Image Upload and track with number of remain with Progress\n\n//Add Upload in Multiple Images \n\nvar arrImage : [UIImage]? = [Add Your Images]\n\nlet isUploadAdded : Bool = AppImageUploadManager.sharedInstance.addImageForUpload(arrImage: arrImage!)\nif isUploadAdded\n{\n    print(\"new Image Added\")\n}\n\n\n//Progress Getting\n\nAppImageUploadManager.sharedInstance.setUpdateProgressStatusEven { (wasSuccessfull, object) in\n    // object is Kind of \"object as! NSArray\"\n\n    self.updateImageProgress(arrCount: object as! NSArray)\n}\n\nopen func updateImageProgress(arrCount : NSArray) -\u003e Void\n{\n    print(\"Uploading (\\(arrCount[0])\\\\\\(arrCount[1]))\")\n\n    let uploadedImg : Float = Float(arrCount[0] as! Int)\n    let totalImg : Float = Float(arrCount[1] as! Int)\n\n    print(\"Completed : \\(arrCount.firstObject)\" , \"Total : \\(arrCount[1])\")\n    print(\"Progress : \\(uploadedImg / totalImg)\")\n\n    if arrCount[0] as! Int == arrCount[1] as! Int\n    {\n        print(\"Upload is completed...\")\n    }\n}\n\n\n```\n\n\n####  AppPlistManger\n\n```swift\n\n//using AppPlistManger for Management of Plist file store \u0026 read Data\n\n//For Read Plist File (Link :- \"Menu\")\nfor menuData in AppPlistManager().readFromPlist(\"Your Plist File Name without .plist Extension\") as! NSMutableArray\n{\n    let dicMenu : NSMutableDictionary = menuData as! NSMutableDictionary\n    var arrItem : [NSDictionary] = []\n    ...\n}\n\n\n```\n\n####  AppPreferencesExplorer\n\n```swift\n\n//using AppPreferencesExplorer open Settings Page in IPhone or IPad\n\ndo{\n    try AppPreferencesExplorer.open(.locationServices)\n}\ncatch let error{\n    print(error.localizedDescription)\n}\n\n\n```\n\n\n####  AppEventBus\n\n```swift\n\n//AppEventBus using Notification Handling with hole Application \n\n//implement event handling methods\n\nAppEventBus.onMainThread(target, name: \"someEventName\") { result in\n    // UI thread\n}\n\n// or\n\nAppEventBus.onBackgroundThread(target, name:\"someEventName\") { result in\n    // API Access\n}\n\n//Post events\n\nAppEventBus.post(\"someEventName\")\n\n//Post events with Parameters\n\nAppEventBus.post(\"someEventName\", sender: \"VIRAJ\")\n\n// Expecting parameters\n\nAppEventBus.onMainThread(target, name:\"personFetchEvent\") { result in\n    let person : Stirng = result.object as Stirng\n    println(person) // will output \"VIRAJ\"\n}\n\n//Remove all the observers from the target\n\nAppEventBus.unregister(target)\n\n//Remove observers of the same name from the target\n\nAppEventBus.unregister(target, \"someEventName\")\n\n```\n\n\n####  BaseScrollView\n\n```swift\n\n//using BaseScrollView ( ScrollTypes : both , horizontal, vertical )\n\nlet scrollView = BaseScrollView.init(scrollType: .both, superView: self)\n\n\n```\n\n\n####  BaseSegment\n\n```swift\n\n//using BaseSegment \n\nlet baseSegment = BaseSegment.init(titleArray: [\"Sign In\", \"Sign Up\", \"Forgot\"], iSuperView: containerView)\nbaseSegment.setSegmentTabbedEvent { (selectedIndex) in\n    print(\"SelectedIndex Segment:\\(selectedIndex)\")\n}\n\n\n```\n\n\n####  BasePopOverMenu\n\n```swift\n\n//using BasePopOverMenu set Globle Variable For Custom\n\nlet configuration = AppConfiguration.shared\nconfiguration.menuRowHeight = ...\nconfiguration.menuWidth = ...\nconfiguration.textColor = ...\nconfiguration.textFont = ...\nconfiguration.tintColor = ...\nconfiguration.borderColor = ...\nconfiguration.borderWidth = ...\nconfiguration.textAlignment = ...\nconfiguration.ignoreImageOriginalColor = ...;\n//// set 'ignoreImageOriginalColor' to YES, images color will be same as textColor\n\n//From SenderView, Menu Without Images.\n//\nBasePopOverMenu.showForSender(sender: sender,with: [\"Share\"],\n    done: { (selectedIndex) -\u003e () in\n        print(selectedIndex)\n    }) {\n}\n\n//From SenderView, Menu With Images.\n//\nBasePopOverMenu.showForSender(sender: sender,with: [\"Share\"],menuImageArray: [\"iconImageName\"],\n    done: { (selectedIndex) -\u003e () in\n\n        print(selectedIndex)\n    }) {\n   \n}\n\n//From SenderFrame/NavigationItem, Menu Without Images.\n//\nBasePopOverMenu.showFromSenderFrame(senderFrame: sender.frame,with: [\"Share\"],\n    done: { (selectedIndex) -\u003e () in\n\n    }) {\n\n}\n\n//From SenderFrame/NavigationItem, Menu With Images.\n//\nBasePopOverMenu.showFromSenderFrame(senderFrame: sender.frame,with: [\"Share\"],menuImageArray: [\"iconImageName\"],\n    done: { (selectedIndex) -\u003e () in\n\n    }) {\n    \n}\n\n\n```\n\n\n####  BaseNotificationBadge\n\n```swift\n\n//using BasePopOverMenu \n\n//To add a badge with default settings use this (This also applies to updating an existing badge):\n\nview.badge(text: \"5\")\n\nbarButtonItem.badge(text: \"7\")\n\n\n//To remove the badge:\n\nview.badge(text: nil)\n\nbarButtonItem.badge(text: nil)\n\n\n//Advanced Usage\n\nlet badgeAppearnce = AppBadgeAppearnce()\nappearnce.backgroundColor = UIColor.blue //default is red\nappearnce.textColor = UIColor.white // default is white\nappearnce.alignment = .center //default is center\nappearnce.textSize = 15 //default is 12\nappearnce.distenceFromCenterX = 15 //default is 0\nappearnce.distenceFromCenterY = -10 //default is 0\nappearnce.allowShadow = true\nappearnce.borderColor = .blue\nappearnce.borderWidth = 1\nview.badge(text: \"Your text\", appearnce: badgeAppearnce)\n\n\n```\n\n\n####  AppLocationManager\n\n```swift\n\n//using AppLocationManager \n\nAppLocationManager.shared.locate { result in\n    switch result {\n        case .success(let locator):\n            ...\n            break\n        case .failure( _):\n            ...\n            break\n    }\n}\n\n```\n\n\n## In Progress\n\n- Description after some time added.(In Progress)\n\n\n## Author\n\nViraj Patel, mspviraj@hotmail.com\n\n## License\n\nSwiftyBase is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmspvirajpatel%2Fswiftybase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmspvirajpatel%2Fswiftybase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmspvirajpatel%2Fswiftybase/lists"}