dot-globe
  • July 25, 2025

A SceneKit and Metal Powered interactive globe for UIKit and SwiftUI

Features


  • Display an interactive 3D globe
  • Customize the appearance of the globe, including earth color, glow color, and reflection color etc.
  • Control the radius of the earth and size of the dots on the globe.
  • Enable/disable particle effects, such as stars.
  • Works with SwiftUI.
  • Works with iOS, MacOS, iPadOS, and even with WatchOS!

TODOs:


  • Add animation and interaction with the globe — Working on
  • Add country grouping and add necessary methods to SwiftUI and UIKit

Showroom


 earthmap.mp4 

Usage


UIKit


import UIKit
import DotGlobe

class ViewController: UIViewController {
override func viewDidLoad() {
// initialize controller here
let globeController = GlobeViewController()
globeController.earthColor = UIColor(red: 0.0, green: 0.482, blue: 0.871, alpha: 1.0)
globeController.glowColor = UIColor(red: 0.0, green: 0.22, blue: 0.482, alpha: 1.0)
globeController.reflectionColor = UIColor(red: 0.0, green: 0.482, blue: 0.871, alpha: 1.0)

present(globeController, animated: true, completion: nil)
}
}

Customization:

  • dotCount: Amounts of dots used to draw the earth map, adjust it for your needs
  • earthRadius: Adjusts the radius of the earth in the globe.
  • dotSize: Sets the size of the dots displayed on the globe, by default, it is 0.005.
  • enablesParticles: Enables or disables particle effects, by default, background is starry.
  • particles: Sets the particle system for the globe’s background.
  • background
  • earthNode: You can directly access to the earthNode to customize the earth itself
  • earthColor: Sets the color of the earth on the globe.
  • glowColor: Sets the color of the earth’s glow effect.
  • reflectionColor: Sets the color of the earth’s reflection effect.
  • glowShininess: Adjusts the shininess of the earth’s glow effect.

SwiftUI


import SwiftUI
import DotGlobe

struct ContentView: View {
var body: some View {
GlobeView()
}
}

GitHub


View Github

YOU MIGHT ALSO LIKE...
SwiftUI Router

With SwiftUI Router you can power your SwiftUI app with path-based routing. By utilizing a path-based system, navigation in your app becomes ...

FlowStacks

This package takes SwiftUI's familiar and powerful NavigationStack API and gives it superpowers, allowing you to use the same API not just ...

Concepts

This framework uses three main concepts: Route - an identifiable value that represents a destination in your app Transition - a visual ...

SideMenu – SwiftUI

Install Swift Package Manager Open Xcode, go to File -> Swift Packages -> Add Package Dependency and enter https://github.com/akardas16/SideMenu.git as Branch main You need to add import ...

Swift Structures vs. Classes: Properties, Memberwise Initializers, Value vs. Reference & Identity

Modeling Custom Types with Structures and Classes In Swift, structures (struct) and classes (class) are the two primary building blocks ...