问题
I am quite new in iOS. I have a problem and not able to get the exact idea for implementation. I am uploading two images here, so please suggest me how can I implement it using Swift.
Here is my images:
In Images you can see that for a single viewController there is two tabs one is "YOUR GROUP" and another one is "SHARED BY". In that I have a tableView also. I have created two custom UITableViewCells one for "YOUR GROUP" and another one for "SHARED BY".
Actually basic idea I know that using UIPageViewController I can implement but for tab bar what I have to do.
Here below is the code for my custom cells:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if(1 == tagTableView)
{
var groupSharedByCell = tableView.dequeueReusableCell(withIdentifier: "GroupSharedByCell") as? GroupSharedByCell
if (nil == groupSharedByCell) {
var nib:Array = Bundle.main.loadNibNamed("GroupSharedByCell", owner: self, options: nil)!
groupSharedByCell = nib[0] as? GroupSharedByCell
}
groupSharedByCell?.selectionStyle = UITableViewCellSelectionStyle.none
//cell.
return groupSharedByCell!
}
else
{
var yourGroupCell = tableView.dequeueReusableCell(withIdentifier: "YourGroupCell") as? YourGroupCell
if (nil == yourGroupCell) {
var nib:Array = Bundle.main.loadNibNamed("YourGroupCell", owner: self, options: nil)!
yourGroupCell = nib[0] as? YourGroupCell
}
yourGroupCell?.selectionStyle = UITableViewCellSelectionStyle.none
//cell.
return yourGroupCell!
}
}
These cells are perfect, but using UITabBar and UIPageViewController how can I get the exact requirement? Or is there any alternative?
来源:https://stackoverflow.com/questions/41852780/how-to-create-pageview-with-uitabbar-or-segment-control-using-swift