Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

630 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

QuickTableViewController

GitHub ActionsCodecovCarthage compatibleCocoaPods CompatiblePlatformSwift 5

A simple way to create a table view for settings, including:

  • Table view cells with UISwitch
  • Table view cells with center aligned text for tap actions
  • A section that provides mutually exclusive options
  • Actions performed when the row reacts to the user interaction
  • Easy to specify table view cell image, cell style and accessory type

Usage

Set up tableContents in viewDidLoad:

import QuickTableViewController
finalclassViewController:QuickTableViewController{overridefunc viewDidLoad(){
super.viewDidLoad()
tableContents =[Section(title:"Switch", rows:[SwitchRow(text:"Setting 1", switchValue:true, action:{ _ in}),SwitchRow(text:"Setting 2", switchValue:false, action:{ _ in})]),Section(title:"Tap Action", rows:[TapActionRow(text:"Tap action", action:{[weak self]inself?.showAlert($0)})]),Section(title:"Navigation", rows:[NavigationRow(text:"CellStyle.default", detailText:.none, icon:.named("gear")),NavigationRow(text:"CellStyle", detailText:.subtitle(".subtitle"), icon:.named("globe")),NavigationRow(text:"CellStyle", detailText:.value1(".value1"), icon:.named("time"), action:{ _ in}),NavigationRow(text:"CellStyle", detailText:.value2(".value2"))], footer:"UITableViewCellStyle.Value2 hides the image view."),RadioSection(title:"Radio Buttons", options:[OptionRow(text:"Option 1", isSelected:true, action:didToggleSelection()),OptionRow(text:"Option 2", isSelected:false, action:didToggleSelection()),OptionRow(text:"Option 3", isSelected:false, action:didToggleSelection())], footer:"See RadioSection for more details.")]}
// MARK: - Actions
privatefunc showAlert(_ sender:Row){
// ...
}privatefunc didToggleSelection()->(Row)->Void{return{[weak self] row in
// ...
}}}

NavigationRow

Detail Text Styles

NavigationRow(text:"UITableViewCellStyle.default", detailText:.none)NavigationRow(text:"UITableViewCellStyle", detailText:.subtitle(".subtitle")NavigationRow(text:"UITableViewCellStyle", detailText:.value1(".value1")NavigationRow(text:"UITableViewCellStyle", detailText:.value2(".value2"))

Subtitle and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.

Accessory Type

  • The NavigationRow shows with different accessory types based on the action and accessoryButtonAction closures:
varaccessoryType:UITableViewCell.AccessoryType{switch(action, accessoryButtonAction){case(nil,nil):return.none
case(.some,nil):return.disclosureIndicator
case(nil,.some):return.detailButton
case(.some,.some):return.detailDisclosureButton
}}
  • The action will be invoked when the table view cell is selected.
  • The accessoryButtonAction will be invoked when the accessory button is selected.

Images

enumIcon{case named(String)case image(UIImage)case images(normal:UIImage, highlighted:UIImage)}
  • Images in table view cells can be set by specifying the icon of each row.
  • Table view cells in UITableViewCellStyle.value2 will not show the image view.

SwitchRow

  • A SwitchRow is representing a table view cell with a UISwitch as its accessoryView.
  • The action will be invoked when the switch value changes.

TapActionRow

  • A TapActionRow is representing a button-like table view cell.
  • The action will be invoked when the table view cell is selected.
  • The icon, detail text, and accessory type are disabled in TapActionRow.

OptionRow

  • An OptionRow is representing a table view cell with .checkmark.
  • The action will be invoked when the selected state is toggled.
letdidToggleSelection:(Row)->Void={[weak self]iniflet option = $0 as?OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}}

RadioSection

  • RadioSection allows only one selected option at a time.
  • Setting alwaysSelectsOneOption to true will keep one of the options selected.
  • OptionRow can also be used with Section for multiple selections.

Customization

Rows

All rows must conform to Row and RowStyle. Additional interface to work with specific types of rows are represented as different protocols:

  • NavigationRowCompatible
  • OptionRowCompatible
  • SwitchRowCompatible
  • TapActionRowCompatible

Cell Classes

A customized table view cell type can be specified to rows during initialization.

// Default is UITableViewCell.
NavigationRow<CustomCell>(text:"Navigation", detailText:.none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text:"Switch", switchValue:true, action:{ _ in})
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text:"Tap", action:{ _ in})
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text:"Option", isSelected:true, action:{ _ in})

Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:

letaction:(Row)->Void={switch $0 {caseletoption as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case letoption as OptionRowCompatible:
// matches all option rows
default:break}}

Overwrite Default Configuration

You can use register(_:forCellReuseIdentifier:) to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.

Table view cell classes that conform to Configurable can take the customization during tableView(_:cellForRowAt:):

protocolConfigurable{func configure(with row:Row&RowStyle)}

Additional setups can also be added to each row using the customize closure:

protocolRowStyle{varcustomize:((UITableViewCell,Row&RowStyle)->Void)?{get}}

The customize closure overwrites the Configurable setup.

UIAppearance

As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.

tvOS Differences

  • UISwitch is replaced by a checkmark in SwitchCell.
  • TapActionCell does not use center aligned text.
  • NavigationRow.accessoryButtonAction is not available.
  • Cell image view's left margin is 0.

Limitation

When to use QuickTableViewController?

QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad.

It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.

When not to use it?

QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.

Documentation

Requirements

QuickTableViewControlleriOStvOSXcodeSwift
~> 0.1.08.0+-6.41.2
~> 0.2.08.0+-7.02.0
~> 0.3.08.0+-7.32.2
~> 0.4.08.0+-8.02.3
~> 0.5.08.0+-8.03.0
~> 0.6.08.0+-8.33.1
~> 0.7.08.0+-9.03.2
~> 0.8.08.0+-9.14.0
~> 0.9.08.0+-9.34.1
~> 1.0.08.0+9.0+9.44.1
~> 1.1.08.0+9.0+10.14.2
~> 1.2.08.0+9.0+10.25.0

Installation

Use Swift Package Manager

Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1 or later. (requires Xcode 11)

Create a Podfile with the following specification and run pod install.

platform:ios,'8.0'use_frameworks!pod'QuickTableViewController'

Create a Cartfile with the following specification and run carthage update QuickTableViewController. Follow the instructions to add the framework to your project.

github "bcylin/QuickTableViewController"

Use Git Submodule

git submodule add -b master git@github.com:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
  • Drag QuickTableViewController.xcodeproj to your app project as a subproject.
  • On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.

License

QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.

About

A simple way to create a UITableView for settings in Swift.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages