Skip to content

A SwiftUI extension package with IOS 6 UI style

Notifications You must be signed in to change notification settings

lxuan2/IOS6SwiftUI

Repository files navigation

IOS6SwiftUI

swift v5.1 platform iOS deployment target iOS 13

A packge that provides IOS6 style UI elements. Mainly implemented with SwiftUI and similar behaviors as SwiftUI.

Public API

View

  • IOS6NavigationView
  • IOS6NavigationLink
  • IOS6RootView
  • IOS6TabView
  • IOS6Form
  • IOS6List
  • IOS6Slider
  • IOS6Badge
  • IOS6ListBadge

Modifer

  • ios6RootBackground
  • ios6StatusBar
  • ios6FormCellPosition
  • ios6FormSectionFont
  • ios6FormSectionFontBold
  • ios6ListSectionHeader
  • ios6SliderStyle
  • ios6TabBarStyle
  • ios6TabItem
  • ios6Tag
  • ios6NavigationTitle
  • ios6ForegroundColor
  • present
  • scaledFont
  • etched

Environment Key

  • ios6PresentationMode

Style

ButtonStyle

  • IOS6DefaultButtonStyle
  • IOS6FormButtonStyle
  • IOS6ListButtonStyle

ToggleStyle

  • IOS6ToggleStyle

IOS6TabBarStyle

  • IOS6BlueDiamondTabBarStyle

IOS6TabBarStyle

  • IOS6BlueSliderStyle

IOS6NavigationViewStyle

  • IOS6StackNavigationViewStyle
  • IOS6DoubleColumnNavigationViewStyle

IOS6NavigationAppearance

  • IOS6BlueNavigationAppearance
  • IOS6GrayNavigationAppearance

Protocol

  • IOS6TabBarStyle
  • IOS6SliderStyle
  • IOS6NavigationViewStyle
  • IOS6NavigationAppearance

Preset view (Recommanded)

  • IOS6PresetTableCell
  • IOS6PresetSignBadge

Availability

Device: iPhone and iPad System: IOS 13.0.0 ~ IOS 13.6.1. ( IOS 14 has not been tested yet. )

Installation

In Xcode 11 or greater, under your project, select: File > Swift Packages > Add Pacakage Dependency. Copy the address from github into search bar and hit the enter key. For more details, just google Add Swift Package in Xcode

How to Use

(Suggestions: Preset views are recommanded pre-implemented elements. Designed for saving time.)

Everything listed in the Feature section are useable. Here is an recommended implementation:

import SwiftUI
import IOS6SwiftUI

struct ContentView: View {
    @State private var isOn = false
    @State private var progess = 0.0
    
    var body: some View {
        IOS6RootView {
            IOS6NavigationView {
                IOS6Form {
                    Section(header: Text("App:").ios6FormSectionFontBold(), footer: Text("This is the comment").ios6FormSectionFont()) {
                        IOS6Slider(value: self.$progess)
                            .ios6FormCellPosition(.top)
                        
                        IOS6Toggle(isOn: self.$isOn) {
                            IOS6PresetTableCell(image: Image("AppleIDiCloud"), title: "iCloud")
                        }
                        .ios6FormCellPosition(.mid)
                        .ios6ToggleColor(Color(red: 255.0/255.0, green: 127.0/255.0, blue: 2.0/255.0))
                        
                        IOS6NavigationLink(destination: Text("Game Center").ios6NavigationBarTitle("Game Center")) {
                            IOS6PresetTableCell(image: Image("AppleIDMessages"), title: "Messages", comment: "New Messages")
                        }.ios6FormCellPosition(.mid)
                        
                        IOS6NavigationLink(destination: Text("FaceTime").ios6NavigationBarTitle("FaceTime")) {
                            IOS6PresetTableCell(image: Image("AppleIDFaceTime"), title: "FaceTime", comment: IOS6ListBadge(text: "1"))
                        }.ios6FormCellPosition(.mid)
                        
                        IOS6NavigationLink(destination: Text("Game Center").ios6NavigationBarTitle("Game Center")) {
                            IOS6PresetTableCell(image: Image("AppleIDGameCenter"), title: "Game Center")
                        }.ios6FormCellPosition(.bottom)
                    }
                }
                .ios6NavigationBarTitle("Demo")
            }
        }
    }
}

Upcoming Features

  • Optimize for IOS 14
  • Add notification icon to tab item

Finished Tasks

  • Archive v.1.0.0 [passed]
  • More Navigation Styles (eg. Map)
  • iPad Double Column NavigationView Style
  • Reimplement IOS6NavigationView and improve efficiency
  • Test IOS6Slider init and fix min/max label and add onEditChange
  • add ios6SliderStyle
  • Fix IOS6Slider range and adopt new APIs
  • Allow tab item changing on time
  • Add an example project
  • Add tag, ios6tabview now memorize loaded view
  • Add IOS6TabBarStyle
  • Add more documents
  • fix toggle disable mode
  • Fix over extended toggle touch area
  • Add IOS6List
  • Undismissable sheet
  • present customized system model
  • allow multi-modal in same level
  • set private framework
  • bring presentMode to IOS6NavigationView
  • add disabled navigation control
  • rename IOS6FormRow to IOS6TableCell
  • ios6ForegroundColor, IOS6FormRowAdv
  • Test modal is enabled at start
  • present Model
  • generalize all items not to list
  • IOS6Button
  • Combine IOS6NavigationLinkItem and IOS6ToggleItem into IOS6FormRow
  • update IOS6Toggle API
  • ios6NavigationBarTitle modifer
  • anti refresh
  • without section, navigation links give correct the shape

About

A SwiftUI extension package with IOS 6 UI style

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages