Skip to content

iOSHw/SwiftUIDemo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Based UI Demo

This repository consist small Xcode project for various UI element used within iOS application. All sample build in such a way that you will get clear idea how to use practically each UI Element within swift based application. You can use this free for personal or commercial use.

Platform & Supported Device

  • Swift3, Xcode8, iOS10
  • iPhone 4s, 5, 5s, 5c, SE, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus and all iPad having iOS9 or iOS10.

Index

Demo-1: UILabel

Sample project that demonstrate how to use Label.

ScreenShot ScreenShot

Demo-2: UIButton

Sample project that demonstrate how to use Button.

ScreenShot ScreenShot

Demo-3: UISegmentedControl

Sample project that demonstrate how to use Segmented Control.

ScreenShot ScreenShot

Demo-4: UITextField

Sample project that demonstrate how to use UITextField with delegate, close keyboard when clicked anywhere on the screen, move editing from one text field to next text field when Next button clicked within keyboard.

ScreenShot ScreenShot

Demo-5: UITextView

Sample project demonstrate how to use UITextView that allows multi line editing and support newline character. This demo also shows how to close the keyborad by placing action within UIButton (Note: Return key within keyboard will not close the keyboard for textview becuase return key will add newline "\n" character). Newline character support must for UITextView due it's usage for long text having paragraph, so we must close keyboard by any other way that appropriate.

ScreenShot ScreenShot

Demo-6: UISlider

Sample project demonstrate how to use UISlider within swift based application. It shows how to read slider value and use it for changing font size etc.

ScreenShot ScreenShot

Demo-7: UISwitch

Sample project demonstrate how to use UISwitch, set various properties or value for UITextLabel based on UISwitch toggle status.

ScreenShot ScreenShot

Demo-8: UIActivityIndicatorView

Sample project demonstrate how to use UIActivityIndicatorView. i.e. How to Start/Stop spinning programmatically and hide it.

ScreenShot ScreenShot

Demo-9: UIProgressView

Sample project demonstrate how to use UIProgressView. i.e. how to increment progress programmaticaly, reset it etc. Used NSTimer for auto increment progress at certain interval. This example also demonstrate how to use NSTimer practically.

ScreenShot ScreenShot

Demo-10: UIStepper

Sample project demonstrate how to use UIStepper for increment counter and font size at run time.

ScreenShot ScreenShot

Demo-11: UIImageView

Sample project that demonstrate how to use UIImageView and set ContentMode runtime. (e.g. ScaleToFill, ScaleAspectFit, ScaleAspectFill, Redraw, Center, Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight).

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-12: UIScrollView

Sample project demonstrate how to use UIScrollView. i.e. How to set scroll view content size, content offset, zoom scale etc. It shows how to add UIImageView runtime and set Default, Minimum, and Maximum Zoom scale. It's using UIScrollViewDelegate method for detecting zoom.

ScreenShot ScreenShot

Demo-13: UIDatePicker

Sample project demonstrate how to use UIDatePicker i.e. read date value and assign to label when user change it runtime.

ScreenShot ScreenShot

Demo-14: UIPickerView

Sample project demonstrate how to use UIPickerView having custom component. It shows how to fillup data within each component using UIPickerViewDataSource and read selected component value at runtime.

ScreenShot ScreenShot

Demo-15: UIView

Sample project demonstrate how to use UIView and change its property (corner radious, border thickness) runtime using UISlider etc.

ScreenShot ScreenShot

Demo-16: UIContainerView

Sample project demonstrate how to use UIContainerView to load UIViewController within specific area of the screen. This demo also shows how to show/hide external view via UISegmentedControl and how external view behaves when navigate via bar button.

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-17: UIVisualEffectView

Sample project demonstrate how to apply Blur and Vibrancy using UIVisualEffectView. It provides three options i.e. Extra Light, Light and Dark.

ScreenShot ScreenShot

Demo-18: UIAlertController

Sample project demonstrate how to show Alert and ActionSheet using UIAlertController having different action button i.e Ok, Cancel, Yes, No, Delete etc.

ScreenShot ScreenShot

Demo-19: UIWebView

Sample projet demonstrate how to load web url within UIWebView component.

ScreenShot ScreenShot

Demo-20: UINavigationBar

Sample project demonstrate how to navigate screen using 'segue', It also shows how to set the title for the destination screen by overriding the prepareForSegue function.

ScreenShot ScreenShot

Demo-21: UITabBar

Sample project demonstrate how to implement tab based application flow using UITabBar. Contact screen consist top bar button (Map) that link with "Location Map" screen via segue and navigation controller.

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-22: UITableView

Sample project demonstrate how to use UITableView. i.e. how to display multiple section and fillup data for each. When clicked on particular row, it will pass the selected item name to details view controller and item name displayed accordingly on details screen.

ScreenShot ScreenShot

Demo-23: UICollectionView

Sample project demonstrate how to use UICollectionView. i.e. Creating custom cell that consist image, change image corner radioous at runtime as when stepper value changed.

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-24: UIToolbar

Sample project demonstrate how to use UIToolbar. UIToolbar can be used for various action button. This project also demonstrate how to show hide toobar using UIView Animation technique.

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-25: UISearchBar

Sample project demonstrate how to use UISearchBar to perform keyword search within data set and fillup UITableView accordingly. It is using UISearchBarDelegate to perfom search operation while user type the keyword.

ScreenShot ScreenShot

Demo-26: UIStackView - Horizontal

Sample project demonstrate UIStackView usage (horizontal mode) and how to add images runtime within it.

ScreenShot ScreenShot

Demo-27: UIStackView - Vertical

Sample project demonstrate UIStackView usage (vertical mode) and how to add images runtime within it.

ScreenShot ScreenShot

Demo-28: UITapGestureRecognizer

Sample project demonstrate how to use UIGestureRecognizer. i.e. how increase counter while tapped on the screen.

ScreenShot ScreenShot

Demo-29: UIPinchGestureRecognizer

Sample project demonstrate UIPinchGestureRecognizer usage. i.e. How to change view scale on pinch.

ScreenShot ScreenShot

Demo-30: UIRotationGestureRecognizer

Sample project demonstrate how to rotate object using UIRotationGestureRecognizer.

ScreenShot ScreenShot

Demo-31: UISwipeGestureRecognizer

Sample project demonstrate how to move object using UISwipeGestureRecognizer i.e. Swipe Left, Right, Up, Down.

ScreenShot ScreenShot

ScreenShot ScreenShot

Demo-32: UIPanGestureRecognizer

Sample project demonstrate how to implement object drag using UIPanGestureRecognizer.

ScreenShot ScreenShot

Demo-33: UIScreenEdgePanGestureRecognizer

Sample project demonstrate how to detect screen edge swipe (Left, Right etc.) using UIScreenEdgePanGestureRecognizer.

ScreenShot ScreenShot

Demo-34: UILongPressGestureRecognizer

Sample project demonstrate how to detect long press gesture using UILongPressGestureRecognizer. It will put circle at the location where long press detected on the screen.

ScreenShot ScreenShot

Demo-35: UIPageControl

Sample project demonstrate how to use UIPageControl. This example using gesture recognizer for detecting swipe left or right. i.e. upon swipe gestrure detected, it will change UIPageContol currentPage properties and set appropriate value for current page number label.

ScreenShot ScreenShot

Demo-36: Indexed Table View

Sample project demonstrate how display indexed list within UITableView from array. i.e. first sort product list array, group items based on section and store into dictionary, and fillup data within UITableView accordingly.

ScreenShot ScreenShot

Demo-37: Grouped Table View

Sample project demonstrate how display Grouped + Indexed list within UITableView from array. i.e. first sort product list array, group items based on section and store into dictionary, and fillup data within UITableView accordingly. (Note: This is same as indexed table view example, just change table style property to Grouped.)

ScreenShot ScreenShot

Image Source

Images shown within sample are taken from unsplash and used for demo purpose only. I does not claim ownership over any images or icon used.

License

SwiftUIDemo is available under the MIT license. See the LICENSE file for more info.

About

UI demo based on Swift 3, Xcode 8, iOS 10

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%