4

i want to create Onboarding / Walkthrough screens in swift but my screens are transparent , i need to create each image of this screens with transparent background or better way to do this , please tell me better way to this.First image,Second Image,Third Image,Fourth Image I want transparent background also. Suggest me better way for this.

Asmita
  • 439
  • 6
  • 18
  • you can create a perticular UIView for each design. give black colour as backgroundColour with 0.7 or 0.8 alpha . and finally add this view in any class you want. – Er.Gopal Vasani Sep 29 '17 at 10:29
  • yes but i also want background tables and details view as background , can i ask for designer to give me that table view image as background or what? @GOPALVASANI – Asmita Sep 29 '17 at 10:33
  • you just make your view semi transparent – Lu_ Sep 29 '17 at 10:34
  • can you tell how can i add other controller on uiview @Lu_ – Asmita Sep 29 '17 at 10:37
  • 3
    you can create your own views with all the features or check these links : https://github.com/ephread/Instructions and https://github.com/yukiasai/Minamo – Amit Sep 29 '17 at 10:39
  • no @Asmita , if you are giving the black colour with minimum alpha as bgColor and when you are add those Views inside any class , you can easilly see the background Views. – Er.Gopal Vasani Sep 29 '17 at 10:46
  • @Asmita Refer to library [here](https://github.com/ephread/Instructions) – NightFury Sep 29 '17 at 10:48
  • i am created pageviewcontroller for this how i should i set for that pageview controller bgcolor with minimum alpa i get other view controller as backround @GOPALVASANI – Asmita Sep 29 '17 at 10:49
  • No need to create another UIViewController For this type of functionality , just Create a one UIView , add CollectionView and Pagecontrol inside the View and add those view in any class you want . – Er.Gopal Vasani Sep 29 '17 at 10:54
  • combination of collectionView and pageControl is very easy although @Asmita – Er.Gopal Vasani Sep 29 '17 at 10:54
  • @GOPALVASANI can you help in this please – Asmita Sep 29 '17 at 11:08
  • its a long task @Asmita – Er.Gopal Vasani Sep 29 '17 at 11:09
  • i mean i can't give you instruction on a stackoverflow. – Er.Gopal Vasani Sep 29 '17 at 11:16
  • Possible duplicate of [Present a transparent modal UIViewController](https://stackoverflow.com/questions/25260774/present-a-transparent-modal-uiviewcontroller) – Tamás Sengel Sep 29 '17 at 12:43
  • Follow @Amit solution. I also work with Instructions. Yes, it is a hassle to setup and may take some time to get comfortable with the system. But trust me, it is way faster than making a good walkthrough on your own. – J. Doe Sep 29 '17 at 15:09

1 Answers1

2

You can create an UIViewController with a UIScrollView and a pagination (scrollView pagination enabled and a pageControl). Your different tutorial views are defined inside each page in the scrollView.

the key part here is to set modalPresentationStyle of your modal controller to .overCurrentContext when you call it :

let VC = self.storyboard!.instantiateViewController(withIdentifier: "myViewController") as! MyViewController
VC.modalPresentationStyle = .overCurrentContext
VC.view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.2)
self.present(VC, animated: true, completion: nil)
Damien Bannerot
  • 2,965
  • 2
  • 17
  • 27