A swift package(SPM) with iOS UI component that loads and displays images from remote urls or local assets and displays in a slide-show form with auto scroll feature.

Overview

MDBannersView

A swift package with an iOS UI component that loads and displays images from remote urls, local assets and displays in a slide-show form with an auto scroll feature.

MDBannersViewSS.mov

Supports iOS 13+

Installation

Swift Package Manager (SPM)

You can use The Swift Package Manager to install MDBannersView by adding it to your Package.swift file:

import PackageDescription

let package = Package(
    name: "Your App",
    targets: [],
    dependencies: [
        .Package(url: "https://github.com/Madhav-Deva/MDBannersView.git", .upToNextMajor(from: "1.0.2"))
    ]
)

[OR]

  • File > Swift Packages > Add Package Dependency
  • Add https://github.com/Madhav-Deva/MDBannersView.git
  • Select "Up to Next Major" with "1.0.2"

CocoaPods

 pod 'MDBannersView'

Usage

In Storyboard, add UIView of desired size. Change its Custom Class name to BannerView and Module to MDBannersView. Have this as reference in your viewcontroller. Below is the sample code, to load local assets you can create a function like loadLocalImages(). To download and display images from url, you can use a function like loadRemoteImages().

import MDBannersView

@IBOutlet weak var slidesView: BannerView!

override func viewDidLoad() {
    super.viewDidLoad()
    self.loadRemoteImages()
}

// To Download images using image urls
private func loadRemoteImages() {
    let remoteImageUrls = ["https://cdn.pixabay.com/photo/2017/01/18/16/46/hong-kong-1990268_1280.jpg",
    "https://cdn.pixabay.com/photo/2016/11/13/12/52/kuala-lumpur-1820944_1280.jpg",
    "https://cdn.pixabay.com/photo/2014/01/30/18/26/skyline-255116_1280.jpg",
    "https://cdn.pixabay.com/photo/2018/04/25/09/26/eiffel-tower-3349075_1280.jpg",
    "https://cdn.pixabay.com/photo/2021/10/28/09/59/city-6749295_1280.jpg"]
    self.slidesView.loadImages(imageUrls: remoteImageUrls)
    self.slidesView.didSelectItemAt = { indexPath in
        debugPrint(indexPath)
    }
    
}

// To display images from assets
private func loadLocalImages() {
    let imageNames = ["img_1", "img_2", "img_3", "img_4", "img_5"]  // Images names used in your assets
    self.slidesView.setImage(names: imageNames)
    self.slidesView.didSelectItemAt = { indexPath in
        debugPrint(indexPath)
    }
}

BannersView component comes with default caching and shimmer animation(used when images are downloaded using urls). You can customise the component by accessing the public functions.

You might also like...
Swift iOS app to track when your favorite tv show airs next ๐Ÿ“†
Swift iOS app to track when your favorite tv show airs next ๐Ÿ“†

Upcoming TV Swift iOS app to track when your favorite tv show airs next ๐Ÿ“† Requirements iOS 13 TMdB API key Credits TMdB Contact github.com/dkhamsing

A Figma component preview for your SwiftUI views
A Figma component preview for your SwiftUI views

FigmaPreviewSwiftUI A Figma component preview for your SwiftUI views. You can use Figma components instead of real views within your app until you imp

SwiftUI component for QuickLook
SwiftUI component for QuickLook

GXQuickLookView SwiftUI + QuickLook. ๐Ÿ”ท ะขั€ะตะฑะพะฒะฐะฝะธั โœ… Xcode 12.0 โœ… Swift 5+ โœ… iOS

A SwiftUI component which handles logging in with Apple to Firebase
A SwiftUI component which handles logging in with Apple to Firebase

Login with Apple Firebase SwiftUI I made this SwiftUI component to handle logging in with Apple to Firebase. Demo Gif Usage in SwiftUI struct ContentV

BottomBar component for SwiftUI
BottomBar component for SwiftUI

BottomBar-SwiftUI BottomBar component for SwiftUI inspired by this concept Requirements Xcode 11 iOS 13 Installation In Xcode go to File - Swift Pack

An iOS app that visually clones Spotify's app and consumes the official Spotify's Web API to show(and play) songs, podcasts, artists and more.
An iOS app that visually clones Spotify's app and consumes the official Spotify's Web API to show(and play) songs, podcasts, artists and more.

SpotifyClone An iOS app that visually clones Spotify's app and consumes the official Spotify's Web API to show(and play) songs, podcasts, artists and

Get location of user and show near cities and weather of the cities for next 6 days. (iOS)

technical-assignment-Weather-App This project written in Swift by Emre Kฤฑlฤฑnc You need to have Xcode installed. Please open weather_app.xcworkspace wi

An iOS app demo to show list and detail screen of artworks.
An iOS app demo to show list and detail screen of artworks.

Artworks iOS Demo Application Architecture MVP Clean Architecture (check Known Issues) Dependency Injection Features Localization Dark mode support Ba

CountryList - iOS app to show country info
CountryList - iOS app to show country info

CountryList iOS app to show country info Overview 'CountryList App' fetch and di

Releases(1.0.2)
Owner
Madhav Deva
iOS Developer
Madhav Deva
Firebase xcframework integration with SPM

Firebase xcframework integration with SPM A small mirror for https://github.com/firebase/firebase-ios-sdk, to add support for using their binary depen

Ashleigh Kaffenberger 80 Dec 23, 2022
BRD - the simple and secure wallet for bitcoin, ethereum, and other digital assets

BRD is the simple and secure wallet for bitcoin, ethereum, and other digital assets. Today, BRD is one of the largest non-custodial mobile wallets used by over 6 million users and protects an estimated nearly $7B USD.

bread 647 Jan 7, 2023
Icons generator for XCode assets project

SwiftUI-PictGen Icons generator for XCode assets project. Small project in Swift

Laurent Llexti 0 Dec 29, 2021
GroceryMartApp-iOS-practice - To Practice fundamental SwiftUI feature like navigation, state mamagement, customazing etc

?? GroceryMartApp-iOS-practice ์•„๋ž˜์˜ ๋‚ด์šฉ์€ ์Šค์œ—ํ•œ SwiftUI ์ฑ…์˜ ์‹ค์ „ ์•ฑ ๊ตฌํ˜„ํ•˜๊ธฐ ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ •๋ฆฌํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค

Jacob Ko 0 Jan 7, 2022
Ios-exercise - In this exercise applicant should implement a new feature into an existing sample app

Cooking app In this exercise applicant should implement a new feature into an ex

Kristฤซne 0 Feb 7, 2022
A MVVM Project using two way binding with DidSet swift feature

FawryTask Description Fawry Task is a MVVM Project using two way binding with DidSet swift feature , follow Solid princepl by uncle bob esecially Sing

null 1 Dec 6, 2021
Paginated endless scroll using the SwiftUI and Combine frameworks

Article related to this project Infinite List Scroll with SwiftUI and Combine. InfiniteListSwiftUI A sample project showcasing how to build an infinit

Vadim Bulavin 69 Nov 16, 2022
Vector editor to showcase advanced scroll view and SwiftUI

ShapeEdit ShapeEdit is a showcase for Advanced ScrollView, inspired by WWDC sample with the same name. ShapeEdit is build in SwiftUI, with exception o

Dmytro Anokhin 34 Dec 29, 2022
Weatherflow-local - Basic frame-out of a SwiftUI macOS app to receive & display WeatherFlow UDP broadcast messages

WeatherFlow Local A very basic/skeleton SwiftUI macOS app for receiving and disp

boB Rudis 4 Feb 6, 2022
A type-safe auto-generated Swift wrapper around fluentui-emoji

fluentui-emoji.swift A type-safe auto-generated Swift wrapper around fluentui-emoji. Usage Requirements iOS 13+ macOS 10.15+ tvOS 13+ watchOS 6+ Insta

Yubo Qin 11 Dec 27, 2022