কম্পিউটার টিউটোরিয়াল

সুইফটে UITableView-এ নতুন সেল (Cell) ইনসার্ট করার পদ্ধতি


UITableView-এ সেল ইনসার্ট করতে কাস্টম সেল তৈরি করে cellForRowAt মেথডে ডিকিউ (dequeue) করুন।

  • ViewController-এ TableView আউटलেট যোগ করুন।
  • Storyboard-এ প্রোটোটাইপ সেল তৈরি করুন, ক্লাস: CustomCell, Identifier: "CustomCell"।
  • সেলে একটি লেবেল যোগ করুন।
func numberOfSections(in tableView: UITableView) -> Int { return 1 }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 5 }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "CustomCell") as! CustomCell
    return cell
}

রান করলে ৫টি সেলের টেবিল দেখাবে।

সুইফটে UITableView-এ নতুন সেল (Cell) ইনসার্ট করার পদ্ধতি


  1. সুইফটে WKWebView ব্যবহার করে iOS-এ ওয়েব ভিউ তৈরি করা

  2. JDBC ব্যবহার করে MySQL ডেটাবেসে ফাইল ইনসার্ট/স্টোর কীভাবে করবেন?

  3. Java ব্যবহার করে MySQL কলামে DATE ইনসার্ট করার পদ্ধতি

  4. পাওয়ারপয়েন্টে PDF যুক্ত করার সহজ পদ্ধতি: অবজেক্ট, স্ক্রিন ক্লিপিং, কনভার্সন এবং আরও