Saturday, October 10, 2020

How to Implement SkeletonView in a UITableViewController Class with Custom Cell - iOS Swift

 


SkelentonView is a beautiful loading view to add to your app, especially if you are fetching a large amount of data, i.e., getting data with photos from Firestore. It's easy to implement it with a tableview inside a ViewController class, but implementing SkeletonView in a TableViewController with a custom cell and a .xib file is quite tricky.

I spent a couple of hours trying to figure it out, and there wasn't enough information on how to do it, but I eventually got it working. I think many of you have encountered the same problem, that's why I am sharing my solution here.

I am not going to go through the entire process on how to set up a custom cell. I assume you already know that. If you don't know how to set up a custom cell, please leave a comment below if you want me to make a tutorial on that too.

Before we start, make sure you already installed SkeletonView in your project. If you haven't, please follow the instructions from their Github page.

Add a UITableViewController in the storyboard. In my example, I have three sections, and the 3rd section or technically section 2, because the 1st section is at index 0, is the one that has a custom cell.

In the storyboard, please set all objects in the TableView to 'is Skeletonable = On', i.e, tableview cell, content view, label, button, etc. If you use .xib, set all objects to 'is Skeletonable = On' as well.

In the viewDidLoad, add the following code:

tableView.estimatedRowHeight = 200

// register you cell
tableView.register(UINib(nibName: "YOUR_CELL_NIB_NAME", bundle: nil), forCellReuseIdentifier: "YOUR_CELL_REUSE_IDENTIFIER")

// show SkeletonView animation
self.view.showAnimatedGradientSkeleton()
self.tableView.visibleCells.forEach { $0.showAnimatedGradientSkeleton() }
self.tableView.showAnimatedGradientSkeleton()

// call the function that fetches the data, example:
loadCategories()

 

In your viewDidAppear, add the following code:

DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
      self.tableView.stopSkeletonAnimation()
      self.view.hideSkeleton()

}

 

In your cellForRowAt, add this code to hide the SkeletonView once data is loaded:

cell.hideSkeleton()


Then, conform to SkeletonTableViewDataSource and implement the following methods:

extension YourTableViewController : SkeletonTableViewDataSource {

func numSections(in collectionSkeletonView: UITableView) -> Int {

        // return the number of sections in your tableview
        return 3 
    
}

func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int {
        
        if section == 2 {
 
            // return the number of count of your data array
            return sparePartsCategoriesArray.count 

        }
        
        return super.tableView(skeletonView, numberOfRowsInSection: section)
        
    }

func collectionSkeletonView(_ skeletonView: UITableView, cellIdentifierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier {
 
        // return the reuse identifier you set for your custom cell
        return "YOUR_CELL_REUSE_IDENTIFIER" 

    }
     
}

This is how I got my SkeletonView to work on my UITableViewController with custom cell. I hope it works for you, too! Happy coding!

Wednesday, August 5, 2020

How to Fix or Repair Boot for Windows 7 / 10 on Dell Latitude E6530 laptop


First, open your Dell e6530 laptop and press F2 to enter setup.
Then, Choose Boot Sequence.
Click on UEFI in the Boot List Option. Click Apply and Exit.

Then download this gumroad file attached.

Then,

DOWNLOAD ISO in these links:
Download which version you want.

WINDOWS XP:
https://softlay.net/operating-system/windows-xp-sp3-iso-full-version-free-download.html

WINDOWS 7:
https://softlay.net/operating-system/windows-7-ultimate-iso-download.html

WINDOWS 10:
https://www.microsoft.com/en-us/software-download/windows10ISO

Then, open the gumroad file HERE

folder 1-
use this app (attached) to format your usb

Click on the Diskimage button
Select the ISO using the … button
Find the ISO you downloaded

In the bottom part, it is like this:
Type: USB Drive  | Drive:(this is usually like this disk2s1, make sure no other drive is connected to your mac)

Then click OK

Wait for it to Finish



Then this is the tricky part with Dell e6530 laptop...
USE THE READ ME TEXT IN THE GUMROAD FILE TO CONTINUE



Have fun!

Thursday, June 22, 2017

12 Facebook Pages to Follow If You’re an Entrepreneur


Recently, I tried to abstain from Facebook and other social media platforms because of too much stress and I'm too tired of seeing other people whining on social media and sharing disgusting posts. But I could not completely stop from accessing these social media platforms because my businesses are connected to them. So, I decided to login to my other Facebook account where I don’t have any friends except for the 4 members of my family and then I searched for the pages that will give me inspiration and motivation and followed them. I’ve been following these pages for over a month now and I never looked back. I love it because all I read on my newsfeed are pure inspirational and motivational posts that help me in life and business.

Here are the 12 Facebook Pages that I’m following right now:

1.     Inc. Magazine

They post about anything you need to know to start and grow your business.

2.     Entrepreneur

Entrepreneur seeks to inspire, inform and celebrate entrepreneurs. They offer real solutions to the challenges you face as an entrepreneur, including tips, tools and insider news to help build – and grow – your business.

3.     Gary Vaynerchuk

Gary is a successful serial entrepreneur that gives you daily insights on how to earn money and grow your business.

4.     Marie Forleo

Marie is a beautiful and bubbly lady that will help you make a difference, have a positive attitude and be your happiest, wisest and most loving self.

5.     Kim Garst

Kim is a digital and social media marketing strategist & Forbes Top 10 Women Social Media Influencer. She helps small business owners double their business using social and digital media.

6.     Ali Brown

Ali is an entrepreneur, mentor, angel investor who coaches business leaders.

7.     Positive Thoughts

Gives you daily dose of positivity.

8.     Shark Tank

Each time I watch this show I also imagine myself standing in front of these self-made millionaires pitching my business idea. It motivates me to think of new ideas that lead me studying iOS app development.

9.     Young Entrepreneur

YE inspires and empowers next generation of young entrepreneurs.


SUCCESS is a newsstand publication and website that serves as your guide for personal and professional development through inspiration, motivation and training.


Fast Company is the world’s leading progressive business media brand, with a unique editorial focus on innovation in technology, leadership, world changing ideas, and design.

12.   Fortune

With unrivalled access to the people and ideas that are shaping the business world on a daily – even hourly – basis.


If you know other Facebook Pages that provides motivational and inspirational posts and are not listed here, please feel free to write that in the comment box below. Thank you!

Visit ISM AutoLab for more business-related posts.

How to Implement SkeletonView in a UITableViewController Class with Custom Cell - iOS Swift

  SkelentonView is a beautiful loading view to add to your app, especially if you are fetching a large amount of data, i.e., getting data w...