আমি কীভাবে সুইফটে একটি ইউআইএলআর্টভিউ তৈরি করব?


481

আমি সুইফটে একটি ইউআইএলআর্টভিউ তৈরির জন্য কাজ করছি, তবে কোনও কারণে আমি বিবৃতিটি সঠিকভাবে পেতে পারি না কারণ আমি এই ত্রুটিটি পেয়েছি:

সরবরাহ করা আর্গুমেন্ট গ্রহণ করে এমন 'আরআইডি' এর জন্য কোনও ওভারলোড খুঁজে পাওয়া যায়নি

আমি এখানে এটি লিখেছি:

let button2Alert: UIAlertView = UIAlertView(title: "Title", message: "message",
                     delegate: self, cancelButtonTitle: "OK", otherButtonTitles: nil)

তারপরে ফোন করতে আমি ব্যবহার করছি:

button2Alert.show()

এই মুহূর্তে এটি ক্রাশ হচ্ছে এবং আমি ঠিক বাক্যটি সঠিকভাবে পেয়েছি বলে মনে হচ্ছে না।


5
UIAlertViewএবং আইওএস 8 এ UIActionSheetপ্রতিস্থাপন করা হয়েছে UIAlertController, আপনি কি এটি দেখেছেন?
পোপিয়ে

selfপ্রোটোকল অবলম্বন করে এমন শ্রেণিটি নিশ্চিত করুন UIAlertViewDelegate( সুইফটে এটি করার প্রস্তাবিত উপায়টি একটি এক্সটেনশনের সাথে রয়েছে) Make
নিকোলাস মিয়ারি

@ অ্যাডাম: আমি আপনার পিছনে ফিরে এসেছি। Swift3 ট্যাগের জন্য হয় "সরাসরি অ্যাপলের সুইফট প্রোগ্রামিং ভাষা সংস্করণ 3 পরিবর্তনের সম্পর্কিত প্রশ্নের।" এবং আমি মনে করি না যে "যদি উত্তরগুলি পরিষ্কার করে দেয় যে প্রশ্নে সমস্যাটি প্রশ্নকর্তা যা বলেছিলেন সেগুলি বাদ দিয়ে অন্য কোনও কারণে হয়েছিল, তবে ফিরিয়ে দেওয়া খুব সহায়ক very" মেটা.স্ট্যাকওভারফ্লো / প্রশ্ন / 252079/… থেকে এখানে প্রযোজ্য।
মার্টিন আর

1
@ মার্টিনআর আমি জানি না যে প্রশ্নগুলি কীভাবে আপডেট করা যেতে পারে তা দেখানোর জন্য যে সুইফটের বর্তমান সংস্করণে প্রযোজ্য উত্তরগুলি রয়েছে; এখানে প্রচুর পুরানো, অকেজো জিনিস রয়েছে এবং [দ্রুত] এগুলি দরকারীের পাশাপাশি খুঁজে পায়। আমি এই রেট্যাগটি উল্টে যাওয়া সম্পর্কে দৃ strongly়তার সাথে অনুভব করি না তবে আমি আশা করি এই সমস্যাটি সমাধানের একটি নির্দিষ্ট উপায় ছিল। (আমি উত্তরগুলি ট্যাগ থাকতে ইচ্ছুক।)
অ্যাডাম এবারবাচ

উত্তর:


897

UIAlertViewক্লাস থেকে :

// ইউআইএলআর্টভিউ অবলম্বন করা হয়েছে। ব্যবহারের UIAlertController পরিবর্তে UIAlertControllerStyleAlert একটি preferredStyle সঙ্গে

আইওএস 8 এ, আপনি এটি করতে পারেন:

let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)

আইওএস 8-এ UIAlertControllerআমরা কীভাবে জানতাম UIAlertViewএবং তার সাথে ইন্টারঅ্যাক্ট করার জন্য এখন একক শ্রেণি classUIActionSheet

সম্পাদনা করুন: ক্রিয়াগুলি পরিচালনা করতে:

alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: { action in
    switch action.style{
    case .Default:
        print("default")

    case .Cancel:
        print("cancel")

    case .Destructive:
        print("destructive")
    }
}}))

সুইফট 3 এর জন্য সম্পাদনা করুন:

let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)

সুইফট 4.x এর জন্য সম্পাদনা করুন:

let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
      switch action.style{
      case .default:
            print("default")

      case .cancel:
            print("cancel")

      case .destructive:
            print("destructive")


}}))
self.present(alert, animated: true, completion: nil)

3
আপনি কোথায় দেখতে পেলেন যে ইউআইএলআর্টভিউ অবলম্বন করা হয়েছে? ডকুমেন্টেশনে আমি তা দেখছি না?
ব্লুবিয়ার

9
Cmd + UIAlertViewক্লাসে ক্লিক করুন , এবং মন্তব্যটি শ্রেণীর ঘোষণার ঠিক উপরে।
অস্কার সোয়ানরোস

2
আমি কৌতূহলযুক্ত অন্য কারও জন্য আমার নিজের প্রশ্নের উত্তর দেব adএডএ্যাকশন (শিরোনাম: "বাতিল করুন", শৈলী: UIAlertActionStyle.Cancel, হ্যান্ডলার: {(অ্যাকশন: UIAlertAction!)}))
আলটিয়াস

5
বাতিল এবং ধ্বংসাত্মক মামলাগুলির মূল বিষয়টি কীহেতু এটি সর্বদা আপনার নির্দিষ্ট হিসাবে থাকবে .Default?
ব্যবহারকারী

4
আপনি যে স্যুইচ কেসটি করেছিলেন এই উত্তরটি পড়া অপ্রয়োজনীয় । যদি টাইপ, বা শিরোনামটি হার্ডকোড না করা থাকে তবে সেগুলি গতিশীল নয়: যদি স্যুইচটি হার্ডকোড না হয় তবে আপনার পরিবর্তনশীল বোতামগুলির একটি সিরিজ থাকতে পারে
হানি

465

একটি বোতাম

একটি বোতামের স্ক্রিনশট

class ViewController: UIViewController {

    @IBAction func showAlertButtonTapped(_ sender: UIButton) {

        // create the alert
        let alert = UIAlertController(title: "My Title", message: "This is my message.", preferredStyle: UIAlertController.Style.alert)

        // add an action (button)
        alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil))

        // show the alert
        self.present(alert, animated: true, completion: nil)
    }
}

দুটি বোতাম

দুটি বোতাম সতর্কতা স্ক্রিনশট

class ViewController: UIViewController {

    @IBAction func showAlertButtonTapped(_ sender: UIButton) {

        // create the alert
        let alert = UIAlertController(title: "UIAlertController", message: "Would you like to continue learning how to use iOS alerts?", preferredStyle: UIAlertController.Style.alert)

        // add the actions (buttons)
        alert.addAction(UIAlertAction(title: "Continue", style: UIAlertAction.Style.default, handler: nil))
        alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil))

        // show the alert
        self.present(alert, animated: true, completion: nil)
    }
}

তিনটি বাটন

এখানে চিত্র বর্ণনা লিখুন

class ViewController: UIViewController {

    @IBAction func showAlertButtonTapped(_ sender: UIButton) {

        // create the alert
        let alert = UIAlertController(title: "Notice", message: "Lauching this missile will destroy the entire universe. Is this what you intended to do?", preferredStyle: UIAlertController.Style.alert)

        // add the actions (buttons)
        alert.addAction(UIAlertAction(title: "Remind Me Tomorrow", style: UIAlertAction.Style.default, handler: nil))
        alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil))
        alert.addAction(UIAlertAction(title: "Launch the Missile", style: UIAlertAction.Style.destructive, handler: nil))

        // show the alert
        self.present(alert, animated: true, completion: nil)
    }
}

বোতামের ট্যাপগুলি হ্যান্ডলিং করা হচ্ছে

handlerছিল nilউপরের উদাহরণগুলোতে হবে। যখন ব্যবহারকারী কোনও বোতামটি ট্যাপ করেন তখন nilকোনও কাজ করার জন্য আপনি একটি ক্লোজার দিয়ে প্রতিস্থাপন করতে পারেন। উদাহরণ স্বরূপ:

alert.addAction(UIAlertAction(title: "Launch the Missile", style: UIAlertAction.Style.destructive, handler: { action in

    // do something like...
    self.launchMissile()

}))

মন্তব্য

  • একাধিক বোতাম অগত্যা বিভিন্ন UIAlertAction.Styleধরণের ব্যবহারের প্রয়োজন হয় না । তারা সব হতে পারে .default
  • অ্যাকশন শীট ব্যবহারের জন্য তিনটির বেশি বোতাম বিবেচনা করুন। সেটআপটিও বেশ অনুরূপ। এখানে একটি উদাহরণ।

2
ইউআইএলআরলেটকন্ট্রোলারে কোনও প্রতিনিধি সম্পত্তি আছে কি? ইউআইএলআর্টভিউতে এমন একটি প্রতিনিধি সম্পত্তি রয়েছে যা আমরা মাঝে মাঝে স্ব-স্ব সেট করেছিলাম, ইউআইএআরএলআর্ট কন্ট্রোলার এ কি এরকম কিছু নেই ?? আমি নতুন, দয়া করে আমাকে সহায়তা করুন
ArgaPK

সুন্দর উত্তর - এখন আমরা কীভাবে হ্যান্ডলারের মধ্যে একটি নতুন দৃশ্যে যেতে পারি?
That1Guy

114

আপনি স্ট্যান্ডার্ড কন্সট্রাক্টর ব্যবহার করে একটি ইউআইএলার্ট তৈরি করতে পারেন, তবে 'লিগ্যাসি' কাজটি করেনি বলে মনে হচ্ছে:

let alert = UIAlertView()
alert.title = "Alert"
alert.message = "Here's a message"
alert.addButtonWithTitle("Understood")
alert.show()

8
ইউআইএলআর্টভিউ অবহিত করা হয়েছে। পরিবর্তে ইউআইএএলআরএল্টকন্ট্রোলার স্টাইলআলার্টের পছন্দসই স্টাইলের সাথে ইউআইআইএলআরএল্টকন্ট্রোলার ব্যবহার করুন।
জোড়ায়র

16
@ জোড়ায়ার ইউআইএলআরএল্টকন্ট্রোলার কেবলমাত্র আইওএস 8 থেকে পাওয়া যাবে, দয়া করে এটির ব্যবহারের পরামর্শ দেওয়ার সময়ও উল্লেখ করুন mention এমন পরিস্থিতি রয়েছে যেখানে iOS7 সমর্থন এখনও পছন্দসই এবং লোকেরা সমস্যাটি মিস করতে পারে। অবমাননার অর্থ এই নয় যে "এটি আর কখনও ব্যবহার করবেন না"।
সামি কুহমনেন

2
এটি এখনও কার্যকর হয় যদি আপনার অ্যাপ্লিকেশনটি এখনও আইওএস 7 লক্ষ্য করে চলেছে তবে আদর্শভাবে ইউআইএলআর্টভিউ কেবল তখনই ব্যবহার করা উচিত যখন ইউআইএলআরএল্টকন্ট্রোলার উপলব্ধ না থাকে। যদি এনএসক্লাসফ্রমস্ট্রিং ("ইউআইএলআরলেটকন্ট্রোলার")! = নিল {/ * ইউআইএলার্টকন্ট্রোলার ব্যবহার করুন * /} অন্য {/ * ইউআইএলআর্টভিউ ব্যবহার করুন * /}
ফটব্লাত

UIAlertview () এখন iOS 9 এর মধ্যে অবচিত
রিজওয়ান আহমেদ

31

সুইফটে 4.2 এবং এক্সকোড 10 এ

পদ্ধতি 1:

সরল সতর্কতা

let alert = UIAlertController(title: "Your title", message: "Your message", preferredStyle: .alert)

     let ok = UIAlertAction(title: "OK", style: .default, handler: { action in
     })
     alert.addAction(ok)
     let cancel = UIAlertAction(title: "Cancel", style: .default, handler: { action in
     })
     alert.addAction(cancel)
     DispatchQueue.main.async(execute: {
        self.present(alert, animated: true)
})

পদ্ধতি 2:

ভাগ করা শ্রেণীর সাথে সতর্কতা

আপনি যদি ভাগ করা শ্রেণীর শৈলী চান (যেখানে একবার ব্যবহার করুন একবার লিখুন)

import UIKit
class SharedClass: NSObject {//This is shared class
static let sharedInstance = SharedClass()

    //Show alert
    func alert(view: UIViewController, title: String, message: String) {
        let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
        let defaultAction = UIAlertAction(title: "OK", style: .default, handler: { action in
        })
        alert.addAction(defaultAction)
        DispatchQueue.main.async(execute: {
            view.present(alert, animated: true)
        })
    }

    private override init() {
    }
}

এখন প্রতিটি ওয়্যারে এভাবে সতর্কতা কল করুন

SharedClass.SharedInstance.alert(view: self, title: "Your title here", message: "Your message here")

পদ্ধতি 3:

সমস্ত উইন্ডো প্রাইসেন্ট অ্যালার্ট শীর্ষ

আপনি যদি সমস্ত দর্শনের শীর্ষে সতর্কতা উপস্থাপন করতে চান তবে এই কোডটি ব্যবহার করুন

func alertWindow(title: String, message: String) {
    DispatchQueue.main.async(execute: {
        let alertWindow = UIWindow(frame: UIScreen.main.bounds)
        alertWindow.rootViewController = UIViewController()
        alertWindow.windowLevel = UIWindowLevelAlert + 1

        let alert2 = UIAlertController(title: title, message: message, preferredStyle: .alert)
        let defaultAction2 = UIAlertAction(title: "OK", style: .default, handler: { action in
        })
        alert2.addAction(defaultAction2)

        alertWindow.makeKeyAndVisible()

        alertWindow.rootViewController?.present(alert2, animated: true, completion: nil)
    })
}

ফাংশন কলিং

SharedClass.sharedInstance.alertWindow(title:"This your title", message:"This is your message")

পদ্ধতি 4:

এক্সটেনশন সহ সতর্কতা

extension  UIViewController {

    func showAlert(withTitle title: String, withMessage message:String) {
        let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
        let ok = UIAlertAction(title: "OK", style: .default, handler: { action in
        })
        let cancel = UIAlertAction(title: "Cancel", style: .default, handler: { action in
        })
        alert.addAction(ok)
        alert.addAction(cancel)
        DispatchQueue.main.async(execute: {
            self.present(alert, animated: true)
        })
    }
}

এখন এই মত কল

//Call showAlert function in your class
@IBAction func onClickAlert(_ sender: UIButton) {
    showAlert(withTitle:"Your Title Here", withMessage: "YourCustomMessageHere")
}

পদ্ধতি 5:

পাঠ্যক্ষেত্রের সাথে সতর্কতা

আপনি যদি সতর্কতার জন্য পাঠ্য ক্ষেত্রগুলি যুক্ত করতে চান।

//Global variables
var name:String?
var login:String?

//Call this function like this:  alertWithTF() 
//Add textfields to alert 
func alertWithTF() {

    let alert = UIAlertController(title: "Login", message: "Enter username&password", preferredStyle: .alert)
    // Login button
    let loginAction = UIAlertAction(title: "Login", style: .default, handler: { (action) -> Void in
        // Get TextFields text
        let usernameTxt = alert.textFields![0]
        let passwordTxt = alert.textFields![1]
        //Asign textfileds text to our global varibles
        self.name = usernameTxt.text
        self.login = passwordTxt.text

        print("USERNAME: \(self.name!)\nPASSWORD: \(self.login!)")
    })

    // Cancel button
    let cancel = UIAlertAction(title: "Cancel", style: .destructive, handler: { (action) -> Void in })

    //1 textField for username
    alert.addTextField { (textField: UITextField) in
        textField.placeholder = "Enter username"
        //If required mention keyboard type, delegates, text sixe and font etc...
        //EX:
        textField.keyboardType = .default
    }

    //2nd textField for password
    alert.addTextField { (textField: UITextField) in
        textField.placeholder = "Enter password"
        textField.isSecureTextEntry = true
    }

    // Add actions
    alert.addAction(loginAction)
    alert.addAction(cancel)
    self.present(alert, animated: true, completion: nil)

}

পদ্ধতি 6:

এক্সটেনশন সহ শেয়ারডক্লাসে সতর্কতা

//This is your shared class
import UIKit

 class SharedClass: NSObject {

 static let sharedInstance = SharedClass()

 //Here write your code....

 private override init() {
 }
}

//Alert function in shared class
extension UIViewController {
    func showAlert(title: String, msg: String) {
        DispatchQueue.main.async {
            let alert = UIAlertController(title: title, message: msg, preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
            self.present(alert, animated: true, completion: nil)
        }
    }
}

এখন সরাসরি কল করুন

self.showAlert(title: "Your title here...", msg: "Your message here...")

পদ্ধতি 7:

সতর্কতার জন্য পৃথক শ্রেণিতে এক্সটেনশন সহ আউট শেয়ার্ড ক্লাস সহ সতর্কতা।

একটি নতুন সুইফ্ট ক্লাস তৈরি করুন, এবং import UIKit। কোডটি নীচে অনুলিপি করুন এবং আটকান।

//This is your Swift new class file
import UIKit
import Foundation

extension UIAlertController {
    class func alert(title:String, msg:String, target: UIViewController) {
        let alert = UIAlertController(title: title, message: msg, preferredStyle: UIAlertControllerStyle.alert)
        alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default) {
        (result: UIAlertAction) -> Void in
        })
        target.present(alert, animated: true, completion: nil)
    }
}

আপনার সমস্ত ক্লাসে এখনই সতর্কতা ফাংশনটি কল করুন (একক লাইন)।

UIAlertController.alert(title:"Title", msg:"Message", target: self)

এটা কেমন....


Perfekt! +1 আপনি কি দয়া করে একটি ইন্টিগ্রেটেড টাইমআউট সহ একটি পদ্ধতি যুক্ত করতে পারেন? ধন্যবাদ!
পাসক্যালস

@ পাস, দুঃখিত আমি বুঝতে পারি না, দয়া করে সংক্ষেপে ব্যাখ্যা করতে পারেন।
আইওএস

আমার একটি সতর্কতা নিয়ন্ত্রণকারী দরকার যা 'ঠিক আছে' বোতামটি ক্লিক না করা বা একটি সময়সীমা না হওয়া পর্যন্ত উপস্থাপিত হয়। পদ্ধতি 6 বা 7 এর মতো তবে একটি অতিরিক্ত ইনপুট ভেরিয়েবল 'টাইমআউট' রয়েছে।
পাসক্লস

এক্সটেনশন ইউআইভিউকন্ট্রোলার {ফান্ট অ্যালার্টউইথটাইম (শিরোনাম: স্ট্রিং, চিত্র: স্ট্রিং, টাইম ইন্টারভাল: টাইম ইন্টারভাল) {ডিসপ্যাচকিউ.ইমেন.সিএনসিএল alert সতর্কতা = ইউআইএলআরটিস কনট্রোলার (শিরোনাম: শিরোনাম, বার্তা: চিত্র, পছন্দসই স্টাইল: .লার্ট) সতর্কতা.অ্যাডশন (ইউআইএলআর্টঅ্যাকশন) : "ঠিক আছে", শৈলী: .ডিফল্ট, হ্যান্ডলার: নীল)) স্ব.প্রেজেন্ট (সতর্কতা, অ্যানিমেটেড: সত্য, সমাপ্তি: শূন্য) যদি # উপলভ্য থাকে (আইওএস 10.0, *) , ব্লক: alert _ এ্যালার্ট.ডিজমিস (অ্যানিমেটেড: সত্য, সমাপ্তি: শূন্য)})} অন্য {// পূর্ববর্তী সংস্করণগুলিতে ফলব্যাক}}}}
আইওএস

1
আপনি যদি সময়কাল 0 এর ক্ষেত্রে উল্লেখ করেন তবে আপনি যদি সতর্কতা বন্ধ করতে না চান তবে শর্ত থাকলে ব্যবহার করুন। if timeInterval != 0 { if #available(iOS 10.0, *) { Timer.scheduledTimer(withTimeInterval: timeInterval, repeats: false, block: { _ in alert.dismiss(animated: true, completion: nil) }) } else { // Fallback on earlier versions } }
আইওএস

19

ভিউ ক্লিক করুন

@IBAction func testClick(sender: UIButton) {

  var uiAlert = UIAlertController(title: "Title", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
  self.presentViewController(uiAlert, animated: true, completion: nil)

  uiAlert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in
   println("Click of default button")
  }))

  uiAlert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: { action in
   println("Click of cancel button")
  }))

}

দুটি বোতামে সম্পন্ন হয়েছে ওকে বাতিল করুন


12

আপনি যদি আইওএস 7 এবং 8 কে টার্গেট করছেন তবে আপনার প্রতিটি সংস্করণের জন্য সঠিক পদ্ধতিটি ব্যবহার করছেন তা নিশ্চিত করার জন্য আপনার এর মতো কিছু দরকার, কারণ UIAlertViewআইওএস 8 এ অবহিত রয়েছে, তবে UIAlertControllerআইওএস 7 এ উপলব্ধ নয়:

func alert(title: String, message: String) {
    if let getModernAlert: AnyClass = NSClassFromString("UIAlertController") { // iOS 8
        let myAlert: UIAlertController = UIAlertController(title: title, message: message, preferredStyle: .Alert)
        myAlert.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil))
        self.presentViewController(myAlert, animated: true, completion: nil)
    } else { // iOS 7
        let alert: UIAlertView = UIAlertView()
        alert.delegate = self

        alert.title = title
        alert.message = message
        alert.addButtonWithTitle("OK")

        alert.show()
    }
}

অথবা আপনি সময় সাশ্রয় করতে পারবেন এবং UIAlertViewআইওএসের জন্য সমর্থন বাদ না দেওয়া পর্যন্ত ব্যবহার করতে পারবেন Apple. অ্যাপল তার জন্য আপনার অ্যাপ্লিকেশনটিকে প্রত্যাখ্যান করবে না।
cprcrack

2
অবমাননার অর্থ এই নয় যে "এটি ব্যবহার করবেন না" বা এটি "ভুল পদ্ধতি" হবে, এর অর্থ কেবল এটি পরে কাজ করবে না। আইওএস 8-তে যদি ইউআইএলআরএল্টকন্ট্রোলারটি বিশেষভাবে ব্যবহার করার প্রয়োজন নেই তবে যদি কারওর জন্য কেবলমাত্র প্রাথমিক সতর্কতাগুলির প্রয়োজন হয়। তারা আগের মতোই কাজ করবে। অনেকগুলি এপিআই রয়েছে যা আইওএস 4 বা 5 এ অবনতি হয়েছে এবং এখনও আইওএস 8 এ কাজ করে। তবে অবশ্যই উচ্চতর আইওএস স্তরকে লক্ষ্যযুক্ত অ্যাপ্লিকেশনগুলিকে তাদের ব্যবহার করা উচিত নয় এবং এজন্যই হ্রাস করার সতর্কতা রয়েছে।
সামি কুহমনেন

1
@ সামিকোহমনেন না, তবে আপনি যখন যা করছেন তা কেন এটি স্পষ্ট করে তোলে এবং যখন আপনার ন্যূনতম সংস্করণটি করার মতো পর্যাপ্ত পরিমাণ থাকে তখন অবহেলিত পদ্ধতির সমর্থন সরিয়ে নেওয়া সহজ করে তোলে।
অ্যাস্ট্রোসিবি

12

সুইফট 2 এর প্রোটোকল এক্সটেনশনের সাহায্যে আপনি এমন একটি প্রোটোকল তৈরি করতে পারেন যা আপনার দর্শন নিয়ন্ত্রকদের একটি ডিফল্ট বাস্তবায়ন সরবরাহ করে:

ShowsAlert.swift

import UIKit

protocol ShowsAlert {}

extension ShowsAlert where Self: UIViewController {
    func showAlert(title: String = "Error", message: String) {
        let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert)
        alertController.addAction(UIAlertAction(title: "Ok", style: .Default, handler: nil))
        presentViewController(alertController, animated: true, completion: nil)
    }
}

ViewController.swift

class ViewController: UIViewController, ShowsAlert {
    override func viewDidLoad() {
        super.viewDidLoad()
        showAlert(message: "Hey there, I am an error message!")
    }
}

1
পুরোপুরি কাজ করে। সুইফট 3 এর জন্য 'উপস্থিত ভিউ কন্ট্রোলার' থেকে 'বর্তমান' পরিবর্তন করুন।
ভিনসেন্ট

11

তাত্ক্ষণিক ভাষায় ইউআইএলআর্টভিউটি দেখান: -

প্রোটোকল ইউআইএলার্টভিউডেলিগেট

let alert = UIAlertView(title: "alertView", message: "This is alertView", delegate:self, cancelButtonTitle:"Cancel", otherButtonTitles: "Done", "Delete")
alert.show()

তাত্ক্ষণিক ভাষায় ইউআইএলআর্টভিউ কনট্রোলারটি দেখান: -

let alert = UIAlertController(title: "Error", message: "Enter data in Text fields", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)

11

কেবল কনস্ট্রাক্টরে অন্যান্য বাটনটিটেল সরবরাহ করবেন না।

let alertView = UIAlertView(title: "Oops!", message: "Something
happened...", delegate: nil, cancelButtonTitle: "OK")

alertView.show()

তবে আমি অস্কারের সাথে একমত নই, এই শ্রেণিটি আইওএস 8 এ অবমূল্যায়ন করা হয়েছে, সুতরাং আপনি যদি কোনও আইওএস 8 অ্যাপ্লিকেশন করছেন তবে ইউআইএলআর্টভিউয়ের কোনও ব্যবহার হবে না। অন্যথায় উপরের কোডটি কাজ করবে।


9

আমি এটি খুঁজে পেয়েছি,

var alertView = UIAlertView();
alertView.addButtonWithTitle("Ok");
alertView.title = "title";
alertView.message = "message";
alertView.show();

যদিও ভাল না, তবে এটি কাজ করে :)

হালনাগাদ:

তবে আমি শিরোনাম ফাইলটিতে এটি খুঁজে পেয়েছি:

extension UIAlertView {
    convenience init(title: String, message: String, delegate: UIAlertViewDelegate?, cancelButtonTitle: String?, otherButtonTitles firstButtonTitle: String, _ moreButtonTitles: String...)
}

কেউ এটি ব্যাখ্যা করতে পারেন।


স্পষ্টতই ইউআইএলআর্টভিউ আইওএস 8-এ অবমুক্ত করা হয়েছে এবং আমরা এখন ইউআইএলআরল্টকন্ট্রোলার স্টাইল অ্যালার্টের পছন্দসই স্টাইলের সাথে ইউআইএএলআর্টকন্ট্রোলার ব্যবহার করি।
ব্লুবিয়ার

6
আপনি যদি এমন একটি অ্যাপ্লিকেশন চালান যা iOS7.1 এর সাথে পিছনের দিকে সামঞ্জস্যপূর্ণ হওয়া দরকার এবং আপনি এটি সুইফটে লিখছেন তবে ইউআইএলআরএল্টকন্ট্রোলার লক্ষ্য ডিভাইসটি ক্র্যাশ করবে। আইওএস 7 এর জন্য আপনার উত্তরাধিকারের ইউআইএলআর্টভিউগুলি সমর্থন করা দরকার।
জো

আমি মনে করি যে এটি সুইফট নয় যা কোনও বিপর্যয়ের কারণ হয়ে দাঁড়াবে, বরং এটি সত্য যে ইউআইএলআরলেট কনট্রোলার আইওএস 8 এর আগে উপলব্ধ নয়
অ্যাডা

7

জন্য SWIFT4 আমি মনে করি, ব্যাপ্ত UIViewControllerএবং একটি পুনর্ব্যবহারযোগ্য নিশ্চিতকরণ নিয়ন্ত্রণ সবচেয়ে মার্জিত উপায় তৈরি করছে।

আপনি UIViewControllerনীচের হিসাবে প্রসারিত করতে পারেন :

extension UIViewController {

func AskConfirmation (title:String, message:String, completion:@escaping (_ result:Bool) -> Void) {
    let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
    self.present(alert, animated: true, completion: nil)

    alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { action in
        completion(true)
    }))

    alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { action in
        completion(false)
    }))
  }
}

তারপরে আপনি এটি যে কোনও সময় ব্যবহার করতে পারেন:

 AskConfirmation(title: "YOUR MESSAGE TITLE", message: "YOUR MESSAGE") { (result) in
        if result { //User has clicked on Ok

        } else { //User has clicked on Cancel

        }
    }

5
    class Preview: UIViewController , UIAlertViewDelegate
    {
        @IBAction func MoreBtnClicked(sender: AnyObject)
        {
            var moreAlert=UIAlertView(title: "Photo", message: "", delegate: self, cancelButtonTitle: "No Thanks!", otherButtonTitles: "Save Image", "Email", "Facebook", "Whatsapp" )
            moreAlert.show()
            moreAlert.tag=111;
        }

        func alertView(alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int)
        {
            if alertView.tag==111
            {
                if buttonIndex==0
                {
                    println("No Thanks!")
                }
                else if buttonIndex==1
                {
                    println("Save Image")
                }
                else if buttonIndex == 2
                {
                    println("Email")
                }
                else if buttonIndex == 3
                {
                    println("Facebook")
                }
                else if buttonIndex == 4
                {
                    println("Whatsapp")
                }
            }
        }
    }

শুধু কোডের একগুচ্ছ লেখা খুব কার্যকর নয়। যে কোনও প্রশ্নের উত্তর দেওয়ার সময় (বিশেষত একটি স্বীকৃত উত্তর সহ বেশ কয়েকটি উত্তর সহ একটি পুরানো প্রশ্ন) দয়া করে কোডের একটি অংশের চেয়ে বেশি লিখুন। আপনার কোডটি কী করে, এটি কীভাবে প্রশ্নের উত্তর দেয় এবং অন্যান্য উত্তরের চেয়ে এটি কীভাবে আলাদা (বা আরও ভাল) হয় তার একটি ব্যাখ্যা যুক্ত করুন।
এড্রিয়ান এইচএইচ এইচ

5

আমার আর একটি কৌশল আছে মনে করুন আপনার 5 টি ক্লাস রয়েছে যেখানে একটি লগআউট সতর্কতা প্রয়োগ করতে হবে। দ্রুত শ্রেণির এক্সটেনশান দিয়ে চেষ্টা করুন।

ফাইল- নতুন- সুইফ্ট ক্লাস- এটির নাম দিন।

নিম্নলিখিত যুক্ত করুন:

public extension UIViewController
{

    func makeLogOutAlert()
    {
        var refreshAlert = UIAlertController(title: "Log Out", message: "Are You Sure to Log Out ? ", preferredStyle: UIAlertControllerStyle.Alert)

        refreshAlert.addAction(UIAlertAction(title: "Confirm", style: .Default, handler: { (action: UIAlertAction!) in
            self.navigationController?.popToRootViewControllerAnimated(true)
        }))

        refreshAlert.addAction(UIAlertAction(title: "Cancel", style: .Default, handler: { (action: UIAlertAction!) in
            refreshAlert .dismissViewControllerAnimated(true, completion: nil)
        }))

        presentViewController(refreshAlert, animated: true, completion: nil)
    }
}

ব্যবহার করে প্রয়োগ করুন: self.makeLogOutAlert ()। আশা করি এটা সাহায্য করবে.


5

আপনার অ্যাপের যে কোনও জায়গা থেকে এটিকে সুবিধাজনক করার জন্য আমি একটি সিঙ্গলটন ক্লাস তৈরি করেছি: https://github.com/Swinny1989/Swift- পপআপস

তারপরে আপনি এই জাতীয় একাধিক বোতামের সাথে একটি পপআপ তৈরি করতে পারেন:

Popups.SharedInstance.ShowAlert(self, title: "Title goes here", message: "Messages goes here", buttons: ["button one" , "button two"]) { (buttonPressed) -> Void in
    if buttonPressed == "button one" { 
      //Code here
    } else if buttonPressed == "button two" {
        // Code here
    }
}

বা একক বোতামের মতো পপআপগুলি:

Popups.SharedInstance.ShowPopup("Title goes here", message: "Message goes here.")

ধন্যবাদ। আমি সেখানে কিছু সমস্যা জমা দিই
djdance

1
আরে @ Swinny89 আমাদের সাথে এই সমাধান ভাগ করে নেওয়ার জন্য অনেক লোককে ধন্যবাদ! আমি ক্লোজার জিনিসটির সাথে আটকে গেলাম এবং আপনি কেবল আমাকে বাঁচালেন!
ব্রুনো ক্যাম্পোস

5

সুইফট 3

সুইফট 3 দিয়ে একটি বোতাম দিয়ে কীভাবে একটি সাধারণ সতর্কতা তৈরি করা যায় তার একটি সহজ উদাহরণ নীচে দেওয়া হল।

let alert = UIAlertController(title: "Title",
                              message: "Message",
                              preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default))
present(alert, animated: true)

উপরের উদাহরণে অ্যাকশনের হ্যান্ডেল কলব্যাক বাদ দেওয়া হয়েছে কারণ একটি বোতামের সাথে একটি সতর্কতা দর্শনের ডিফল্ট আচরণটি বোতামটি ক্লিক করা হলে অদৃশ্য হয়ে যায়।

এখানে আরও একটি ক্রিয়া কীভাবে তৈরি করা যায়, যা "সতর্কতা.অ্যাডএ্যাকশন (ক্রিয়া)" সহ সতর্কতার সাথে যুক্ত করা যেতে পারে। বিভিন্ন স্টাইলগুলি হ'ল .ডিফল্ট, .ডেসট্রাকটিভ এবং .ক্যান্সেল।

let action = UIAlertAction(title: "Ok", style: .default) { action in
    // Handle when button is clicked    
}

4

UIAlertViewত্রুটি ছাড়াই সংকলন করার জন্য আমি নিম্নলিখিত সূচনা কোডটি পেয়েছি (আমি শেষ কথা, ভ্যারিয়েডিক অংশটি সম্ভবত জটিল)। তবে আমাকে নিশ্চিত করতে হয়েছিল যে ক্লাসের self(যেটি আমি প্রতিনিধি হিসাবে পাশ করছি) ক্লাসটি UIAlertViewDelegateসংকলনের ত্রুটিগুলি দূরে যাওয়ার জন্য প্রোটোকল গ্রহণ করছে :

let alertView = UIAlertView(
                  title: "My Title",
                  message: "My Message",
                  delegate: self,
                  cancelButtonTitle: "Cancel",
                  otherButtonTitles: "OK"
                )

যাইহোক, এটি আমি পেয়ে যাচ্ছিলাম ত্রুটি (এক্সকোড 6.4 হিসাবে):

'ইউআইএলআর্টভিউ' টাইপের জন্য কোনও প্রাথমিককরণ খুঁজে পাওয়া যায় না যা টাইপের একটি আর্গুমেন্টের তালিকা গ্রহণ করে (শিরোনাম: স্ট্রিং, বার্তা: স্ট্রিং, প্রতিনিধি: মাইভিউকন্ট্রোলার, বাতিলবাটনটিটিল: স্ট্রিং, অন্যান্যবটনটিটলস: স্ট্রিং) '

অন্যরা যেমন উল্লেখ করেছে, আপনি যদি আইওএস 8.x + টার্গেট করতে পারেন তবে আপনার ইউআইএলার্টকন্ট্রোলারে স্থানান্তরিত হওয়া উচিত। আইওএস 7 সমর্থন করতে, উপরের কোডটি ব্যবহার করুন (আইওএস 6 সুইফট দ্বারা সমর্থিত নয়)।


4
 let alertController = UIAlertController(title: "Select Photo", message: "Select atleast one photo", preferredStyle: .alert)
    let action1 = UIAlertAction(title: "From Photo", style: .default) { (action) in
        print("Default is pressed.....")
    }
    let action2 = UIAlertAction(title: "Cancel", style: .cancel) { (action) in
        print("Cancel is pressed......")
    }
    let action3 = UIAlertAction(title: "Click new", style: .default) { (action) in
        print("Destructive is pressed....")

    }
    alertController.addAction(action1)
    alertController.addAction(action2)
    alertController.addAction(action3)
    self.present(alertController, animated: true, completion: nil)

}

4

আপনি এই সাধারণ এক্সটেনশনটি এন সংখ্যার বোতাম এবং সম্পর্কিত ক্রিয়া swift4 এবং উপরের সাথে ব্যবহার করতে পারেন

extension UIViewController {
    func popupAlert(title: String?, message: String?, actionTitles:[String?], actions:[((UIAlertAction) -> Void)?]) {
        let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
        for (index, title) in actionTitles.enumerated() {
            let action = UIAlertAction(title: title, style: .default, handler: actions[index])
            alert.addAction(action)
        }
        self.present(alert, animated: true, completion: nil)
    }
}

আপনি এটি ব্যবহার করতে পারেন,

self.popupAlert(title: "Message", message: "your message", actionTitles: ["first","second","third"], actions:[
            {action1 in
                //action for first btn click
            },
            {action2 in
                //action for second btn click
            },
            {action3 in
                //action for third btn click
            }, nil]) 

আপনি দয়া করে সদৃশ উত্তর পোস্ট করবেন না। আপনি যদি আপনার উত্তর সম্পাদনা করতে চান।
আইওএস

দুর্দান্ত উত্তর। এটাই আমার দরকার। ধন্যবাদ!
গ্রেগরি উইলসন পুলিয়াট্টু

3

এটি কারণ কাজ করে না কারণ আপনি ফাংশনে পাস হওয়া কিছু মান সঠিক নয়। সুইফট অবজেক্টিভ-সি পছন্দ করে না, আপনি কোনও ধরণের বাধা ছাড়াই ক্লাসের ধরণের আর্গুমেন্টগুলিকে শুদ্ধ করতে পারেন (হতে পারে)। আর্গুমেন্ট অন্যান্য বাটন টিটলগুলি অ-alচ্ছিক হিসাবে সংজ্ঞায়িত করা হয় যা এর প্রকারটির শেষে (?) থাকে না। সুতরাং আপনাকে অবশ্যই এটির জন্য একটি কংক্রিট মান দিতে হবে।


3
@IBAction func Alert(sender: UIButton) {

    var alertView:UIAlertView = UIAlertView()
    alertView.title = "Alert!"
    alertView.message = "Message"
    alertView.delegate = self
    alertView.addButtonWithTitle("OK")

    alertView.show()

}

এটা চেষ্টা কর


3

একটি সতর্কতা দর্শন প্রদর্শন করতে এই কোডটি ব্যবহার করুন

  let alertController = UIAlertController(title: "Hello  Coders", message: "your alert message", preferredStyle: .Alert)
        let defaultAction = UIAlertAction(title: "Close Alert", style: .Default, handler: nil)
        alertController.addAction(defaultAction)

        presentViewController(alertController, animated: true, completion: nil)

রেফারেন্স: ইউআইএলআর্টকন্ট্রোলার ব্যবহার করে সুইফট শো সতর্কতা


3

এক্সকোড 9 এ

let alert = UIAlertController(title: "Alert", message: "message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)

3

সুইফট 4: কেবলমাত্র ইউআইভিউউকন্ট্রোলারকে নিম্নরূপে একটি এক্সটেনশন তৈরি করুন:

extension  UIViewController {        
    func showSuccessAlert(withTitle title: String, andMessage message:String) {
        let alert = UIAlertController(title: title, message: message,
                                  preferredStyle: UIAlertController.Style.alert)
        alert.addAction(UIAlertAction(title: "OK".localized, style:
        UIAlertAction.Style.default, handler: nil))
        self.present(alert, animated: true, completion: nil)
    }
}

এখন আপনার ভিউকন্ট্রোলারে, সরাসরি উপরে ফাংশনটি কল করুন যেন তারা ইউআইভিউউকন্ট্রোলার সরবরাহ করেছেন।

    yourViewController.showSuccessAlert(withTitle: 
      "YourTitle", andMessage: "YourCustomTitle")

সাধারণত, উত্তরগুলি আরও কার্যকর হয় যদি সেগুলিতে কোডটি কী করা উচিত এবং কেন এটি অন্যকে পরিচয় করিয়ে না দিয়ে সমস্যার সমাধান করে তার ব্যাখ্যা অন্তর্ভুক্ত করে। উত্তরের রেফারেন্স মানটি উন্নত করার জন্য এবং এটি আরও বোধগম্য করার জন্য ধন্যবাদ!
টিম ডাইকম্যান

2

এটা চেষ্টা কর. বেলো কোডটি বোতামে রাখুন।

let alert = UIAlertController(title: "Your_Title_Text", message: "Your_MSG", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Your_Text", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated:true, completion: nil)

1

সুইফটে একটি মজার উদাহরণ এখানে দেওয়া হয়েছে:

private func presentRandomJoke() {
  if let randomJoke: String = jokesController.randomJoke() {
    let alertController: UIAlertController = UIAlertController(title:nil, message:randomJoke, preferredStyle: UIAlertControllerStyle.Alert)
    alertController.addAction(UIAlertAction(title:"Done", style:UIAlertActionStyle.Default, handler:nil))
    presentViewController(alertController, animated:true, completion:nil)
  }
}

1

এখানে সুইফটে অ্যালার্টভিউয়ের একটি খুব সাধারণ কাজ রয়েছে:

class func globalAlertYesNo(msg: String) {
        let alertView = UNAlertView(title: "Title", message: msg)

        alertView.messageAlignment = NSTextAlignment.Center
        alertView.buttonAlignment  = UNButtonAlignment.Horizontal

        alertView.addButton("Yes", action: {

            print("Yes action")

        })

        alertView.addButton("No", action: {

            print("No action")

        })

        alertView.show()

    }

আপনি যেখানে স্ট্রিং হিসাবে এই ফাংশনটি ব্যবহার করেন আপনাকে স্ট্রিং হিসাবে বার্তা দিতে হবে।


1

ওল্ড ওয়ে: ইউআইএলআর্টভিউ

let alertView = UIAlertView(title: "Default Style", message: "A standard alert.", delegate: self, cancelButtonTitle: "Cancel", otherButtonTitles: "OK")
alertView.alertViewStyle = .Default
alertView.show()

// MARK: UIAlertViewDelegate

 func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) {
 switch buttonIndex {

    // ...
   }
  }

নতুন উপায়: ইউআইএলআর্টকন্ট্রোলার

let alertController = UIAlertController(title: "Default Style", message: "A standard alert.", preferredStyle: .Alert)

let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
// ...
 }
 alertController.addAction(cancelAction)

 let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
// ...
 }
 alertController.addAction(OKAction)
 self.presentViewController(alertController, animated: true) {
 // ...
}

1

আইওএস 9 এ, আপনি এটি করতে পারেন

let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)

1

// ইউআইএলআর্টভিউয়ের জন্য জেনেরিক ক্লাস

//MARK:- MODULES
import Foundation
import UIKit

//MARK:- CLASS
class Alert  : NSObject{

static let shared = Alert()

var okAction : AlertSuccess?
typealias AlertSuccess = (()->())?
var alert: UIAlertController?

/** show */
public func show(title : String?, message : String?, viewController : UIViewController?, okAction : AlertSuccess = nil) {

    let version : NSString = UIDevice.current.systemVersion as NSString
    if  version.doubleValue >= 8 {
        alert = UIAlertController(title: title, message: message, preferredStyle:.alert)
        alert?.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action: UIAlertAction) in

            if let okAction = okAction {
                okAction()
            }
        }))
        viewController?.present(alert ?? UIAlertController(), animated:true, completion:nil);
    }
}

/** showWithCancelAndOk */
public func showWithCancelAndOk(title : String, okTitle : String, cancelTitle : String, message : String, viewController : UIViewController?, okAction : AlertSuccess = nil, cancelAction : AlertSuccess = nil) {
    let version:NSString = UIDevice.current.systemVersion as NSString;

    if  version.doubleValue >= 8 {
        alert = UIAlertController(title: title, message: message, preferredStyle:.alert)

        alert?.addAction(UIAlertAction(title: cancelTitle, style: .default, handler: { (action: UIAlertAction) in

            if let cancelAction = cancelAction {
                cancelAction()
            }
        }))
        alert?.addAction(UIAlertAction(title: okTitle, style: .default, handler: { (action: UIAlertAction) in

            if let okAction = okAction {
                okAction()
            }
        }))
        viewController?.present(alert!, animated:true, completion:nil);
    }
}

/** showWithTimer */
public func showWithTimer(message : String?, viewController : UIViewController?) {

    let version : NSString = UIDevice.current.systemVersion as NSString
    if  version.doubleValue >= 8 {
        alert = UIAlertController(title: "", message: message, preferredStyle:.alert)
        viewController?.present(alert ?? UIAlertController(), animated:true, completion:nil)
        let when = DispatchTime.now() + 1
        DispatchQueue.main.asyncAfter(deadline: when){
            self.alert?.dismiss(animated: true, completion: nil)
        }
    }
}
}

ব্যবহার করুন: -

Alert.shared.show(title: "No Internet Connection", message: "The internet connection appers to be offline.", viewController: self) //without ok action

Alert.shared.show(title: "No Internet Connection", message: "The internet connection appers to be offline.", viewController: self, okAction: {
                            //ok action
                        }) // with ok action

Alert.shared.show(title: "No Internet Connection", message: "The internet connection appers to be offline.", viewController: self, okAction: {
                            //ok action 
}, cancelAction: {
 //cancel action
}) //with cancel and ok action

Alert.shared.showWithTimer(message : "This is an alert with timer", viewController : self) //with timer

1
  // UIAlertView is deprecated. Use UIAlertController 
  // title = title of the alert view.
  // message = Alert message you want to show.
  // By tap on "OK" , Alert view will dismiss.

 UIAlertView(title: "Alert", message: "Enter Message here.", delegate: nil, cancelButtonTitle: "OK").show()

আপনি কি পোস্ট করেছেন কোডে একটি ব্যাখ্যা যোগ করতে পারেন? যেমনটি এখন, আপনার উত্তরটি সত্যিকার অর্থে বিধি দ্বারা সঠিক উত্তর হিসাবে যোগ্যতা অর্জন করে না।
নিকো ভ্যান বেল

সতর্কতা দর্শন এখন দ্রুত পরিবর্তন হয়েছে ৪. সতর্কতা নিয়ন্ত্রক
সন্দীপ সিং
আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.