|
|
|
Use the static variable all to get the list of CountryFlagInfo objects:
import FlagAndCountryCode
let countries = CountryFlagInfo.allEach CountryFlagInfo contains:
name - name of the country ("United States")
code - 2 letter country code ("US")
dialCode - dial code ("+1")
languageNative - original name of the language ("Español")
languageEnglish - name of the language in English ("Spanish")
Use getCountryImage on a CountryFlagInfo of choice. It has both UIKit and SwiftUI implementations, returning a UIImage and a View respectively. Pass your desired flag style as a parameter.
country.getCountryImage(with: .roundedRect)roundedRect - 21 x 15 with rounded corners
square - 15 x 15 with rounded corners
circle - 15 x 15
To try the FlagAndCountryCode examples:
- Clone the repo
https://github.com/exyte/FlagAndCountryCode.git - Open
FlagAndCountryCodeExample.xcodeprojin the Xcode - Try it!
dependencies: [
.package(url: "https://github.com/exyte/FlagAndCountryCode.git")
]- iOS 15+
- Xcode 15+
PopupView - Toasts and popups library
AnchoredPopup - Anchored Popup grows "out" of a trigger view (similar to Hero animation)
Grid - The most powerful Grid container
ScalingHeaderScrollView - A scroll view with a sticky header which shrinks as you scroll
AnimatedTabBar - A tabbar with a number of preset animations
MediaPicker - Customizable media picker
Chat - Chat UI framework with fully customizable message cells, input view, and a built-in media picker
OpenAI Wrapper lib for OpenAI REST API
AnimatedGradient - Animated linear gradient
ConcentricOnboarding - Animated onboarding flow
FloatingButton - Floating button menu
ActivityIndicatorView - A number of animated loading indicators
ProgressIndicatorView - A number of animated progress indicators
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation





