Skip to main content

Posts

How to Designing for iPhone X iOS Swift

Designing for iPhone X iOS Swift

iPhone X features an all-screen Super Retina display, providing more space to display content and create deeply immersive experiences. Learn how to design your app or game to look and feel great on iPhone X, and all iOS devices. Click Here



How Create Animated Circle Progress Bar iOS 11 Swift 4

Animated Circle Progress Bar iOS 11 Swift 4


With MBCircularProgressBar - https://github.com/MatiBot/MBCircularProgressBar


A circular, animatable & highly customizable progress bar from the Interface Builder Swift, Using pod fite MBCircularProgressBar Installation Cocoapods terminal.

pod "MBCircularProgressBar"

That - A Simple Steps to installed pod file -        Open terminal       Command on terminal go to project folder Cd path       set your project path on terminal.       command : pod init       open pod file - open -e podfile       added in pod file with in : pod "MBCircularProgressBar"       Command : Pod install       Close project of Xcode       open your Project from terminals       Command : open PodDemos.xcworkspace After opern StoryBoard and Now drag a UIView over the viewController in storyboard

Or set UIView Constraint width, height or verticle or horzentail space and set a class MBCircularProgressBarView in StoryBoard. Open Atribute inspector and cu…

XML Parsing Web Service with Custom Objects Parameter in iOS With Swift - Tutorial

XML Parsing Web Service or Custom Objects Parameter in iOS With Swift - Example

What is XML? or How to Read XML Files From the WebXML is a text file with special opening and closing tags. Most of these tags look like HTML, however there’s a difference: there are no reserved tags. Parse a simple XML document from URL and convert it into objects. The author makes up whatever tags they want. For example this is properly formed XML-



<?xml version="1.0"?>
<catalog>
    <book id="1">
        <title>To Kill a Mockingbird</title>
        <author>Harper Lee</author>
    </book>
    <book id="2">
        <title>1984</title>
        <author>George Orwell</author>
    </book>
    <book id="3">
        <title>The Lord of the Rings</title>
        <author>J.R.R Tolkien</author>
    </book>
    <book id="4">
        <title&g…

Deep linking Tutorial in ios Swift or Universal Link

Set Up a Universal Links (Deep Linking) for Your App ios 9

Universal Links (Deep Linking) - Deep Linking is a most important in mobile application ios or android apps. Deep Linkingmeans a link from another app or even from a website to your app. On iOS 9, Apple announced “Universal Links” where instead of opening Safari first, the iOS will check if the Universal Link is registered to the domain associated with the link, then checks if the corresponding app is installed. The app is opened if installed, and if not, Safari will be load an http(s) link. This functionality allows one link for both website and app.
Register Your URL Scheme
1- Go to Info.plist
2- Add URL Types then within Item 0
     Set Document Role to Editor.
     Then URL Identifier - app bundle ID.
     Then URL schemes    - (1 item)
     with in item 0     -  DeepLink



Parse JSON Data with GET Method Using JsonDecoder in iOS

Parse JSON Data(GET Method) in UITableViewCell Using JsonDecoder Swift 4 & Xcode 9

1) -- ViewController Class
First Create a new Project (ParseDataGETMethod) after make a struct (GetJsonData) type data parameter

import UIKit
struct GetJsonData:Decodable { let name: String let capital: String let alpha2Code: String let alpha3Code: String let region: String let subregion: String } class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var arrData = [GetJsonData]() @IBOutletvar tableView: UITableView! overridefunc viewDidLoad() { super.viewDidLoad() getJSONData() } func getJSONData(){ let url = URL(string: "https://restcountries.eu/rest/v2/all") let session = URLSession.shared session.dataTask(with: url!) { (data, response, error) in do{ if error == nil { self.arrData = tryJSONDecoder().decode([GetJsonData].self, from: data!) formainarr inself.arrData{ // print(mainarr.name, ":", mainarr.capital, "-", mainarr.alpha2Code ) DispatchQueue.main.sync { s…

One Line JSON Parsing Swift 4 Simple Example

 One Line Parsing JSON in Swift 4.0 With Codable or Decodle

 Swift 4 includes a new way to generate and parse JSON with Swift Codable protocol.


 JSON:-
{
"name" = Rahul'
"id" = 10
"collage" = RTS Collage
"code" = A190
}
 Start:-
 import UIKit
struct  Profile: Codable {
let name: String
let id: Int
let  collage: String
let code: String

 Convert Item(Profile) to JSON
 init?(json: [String: Any]){
 guard let name = json["name" ] as?  String,
           let id= json["id" ] as?  Int,
           let collage= json["collage"  ]as?  String,
           let code= json["code" ] as?  String, else { return nil}
 self.name = name
self.id = id
self.collage = collage
self.code = code
}
}
class ViewController: UIViewController {
  guard let url = URL(string: "https://xxxxxxxxxx") else {return}
  URLSession.shared.dataTask(with: url) { (data, response  , error) in   
   guard let data = data else {return}
    do{
           let decoder = try JS…

Validation Password or Username in Swift 4.0

Validation Password or Username in Swift 4.0
Validation Tutorial Password Or Username Swift 4.0. Two type password validation. Most of the validation same confirm password , Password must one uppercase letter, Password must have more then some characters , Password contain some special character , Password must one digit. etc.


Type First Password Validation - 

Password Mini or Max length is 6 - 10.
One Alphabet in Password.
One Special Character in Password.

^                              - Start Anchor.
(?=.*[a-z])               -Ensure string has one character.
(?=.[$@$#!%?&])   -Ensure string has one special character.
{8,}                           -Ensure password length is 8.
$                               -End Anchor.

See Example -  

func isPasswordValidate(_ password : String)->Bool{
  let validatePassword= NSPredicate(format: "SELF MATCHES %@", "^(?=.*[a-z])(?=.*[$@$#!%*?&])[A-Za-z\\d$@$#!%*?&]{8,}")
    return validatePassword.evaluate(with:…