neroicloud.blogg.se

Swift share custom text social media
Swift share custom text social media












swift share custom text social media
  1. #Swift share custom text social media how to
  2. #Swift share custom text social media code

  • Drag the first button which is facebook button and create an action of it.
  • Now to make the connection between the objects and view we need to drag and drop all objects one by one to our viewcontroller.h file.
  • UIButtons – We will be going to use two buttons here so that we can add action to them later to handle facebook and twitter share feature.Īfter doing all the objects designing our view will looks similar to this.Īs you can see that I have added two images to my asset folder and using them to set an image on buttons so that both of them looks different and are identical.
  • UILabel – With the help of this Label I am going to write a text to it which is “Social Sharing Buttons” so that the design looks better here.
  • I will be using Hexa color #008040 for my design you can choose a color of your choice.
  • UIView – We will be going to add a custom color to our view.
  • Now we need to add few objects to our view controller. Establishing Connection Between Variables and Elements Then name the view controller file as SocialViewController as shown below.Īttach that viewcontroller file with the view in which we will going to make our designing and functionality. Go to File -> New -> File -> Cocoa Touch Class -> UIViewController. Now we will be going to design the interface for our application and to this, we need to add few objects to our view controller.īut first, we will be going to create our own view and to do this. Now head to the framework section of your Xcode and add the Social Framework to your application as I mentioned below. Go to the Xcode and select create a new application and after this Click on the SingleViewApplication.Īfter this Name your application as Social Sharing Application as mentioned in the image below. If you’re not familiar with the SLComposeViewController, this is what it looks like within your app. This also allows developers to preset the initial text, attach images and also adding URL to the post, If you want to implement the simple sharing feature, this is the only class you need to know and that we will go through today. The SLComposeViewController class presents a standard view controller for users to compose the tweet or Facebook post. The social framework comes with a very handy class named SLComposeViewController.

    #Swift share custom text social media code

    You just need to write a few lines of code to bring up the composer and users can tweet/publish a Facebook post on your app. The social framework simplifies everything.

    #Swift share custom text social media how to

    Even you don’t have to implement any of the Twitter/Facebook APIs, how to handle network connection, handle single sign-on, etc. This framework gives you an interface to interact with different social media and it enables you from learning the internals. Currently, it supports Facebook and Twitter.

    swift share custom text social media

    This framework enables users to integrate your app with any supported social networking services.

    swift share custom text social media

    Establishing Connection Between Variables and ElementsĪfter the introduction of iOS 6 version, a new framework arrives which is known as “Social Framework”.














    Swift share custom text social media