Tuesday, June 9, 2015

Hiding between the cracks, best of WWDC 2015 news bits

Most people that follow WWDC keynotes are not developers, and are looking for new products or OS features. Most news sites do not list key developer things. There where several blips however that where not talk about in depth that where major things great for developers. In case anyone missed it, 3 things jump out as major developer wows.

First the release of Swift version 2.0 with many major improvements. Several are outlined here at apple swift blog

Second Swift is now open source, and will support Apples iOS, Mac and also Linux. With more platform support to come in the future. The source code will include swift compiler and standard library among other things.

Last and almost under the radar. The consolidation of Mac and iOS developer programs into one thing. Saving money for developers each year.

Saving money if you where like me and had to pay for both iOS and Mac developer programs annually for the past 5 years.

I still like to see for them to remove the annual fee altogether in the future. As Apple takes 30% commission from selling developers apps. That high commission should cover the fee for the program alone. As every other app store before Apple, only tock under 9% commission from selling developers apps.

Still it is a move in the right direction.

Tuesday, April 28, 2015

Adding a no animation segue to iOS

If you want a view to just appear without any animation or transition in iOS then this quick tip for you. First off you do not have to code a custom segue like is suggested on several sites. All that is required is selecting the correct preset segue type and changing a simple setting. Selecting Present Modally and unchecking the Animates checkbox. That all that is needed to have the new view just appear without any animation or transition. That much easier than writing a custom segue.

If you need to see how to do this then watch this short little video;



Thanks and happy coding :)

Saturday, April 25, 2015

iOS Xcode Auto layout device preview

When layout of a unversial app in Xcode for iOS, there a way to preview the unverisal layout on all apple device sizes within Xcode at the same time.

I been working with Xcode Swift with several companies and pretty much all of them never knew this could be done. It is a great little tip and I felt it is worth sharing with the world.




Enjoy and happy coding ;)

Wednesday, March 18, 2015

Livecodes 8 Media Buzz

I started hearing all this buzz about a new Livecode. Like it was a new dawn, mountains where going to be moved, lives where going to be changed and the future was now. There was talk around the world about Livecode 8 so much that one would think alien life landed on the earth last week.

With this kind of media attention, they sure want us to take notice. Usually I would see d.p., alpha, beta as words not ready for release. However Livecode yelled as loud as they could, look at me! look at Livecode 8, Talk about it.

OK lets do this, take a journey with me to my mac desktop. A video screen cast of Livecode 8 and all of its media buzz, they unleashed at this point in time on this product.

I however could not get anything to work. There no UI items in the tool palette and no properties. I ask around if anyone else where seeing these problems also, many where but some say they where not.

I really like the idea what this could do, specially for Android. However I just can not get it to work.

Watch the video below:




Thanks and happy coding ;)

--

Edited: If you comment on this please no cyber bullies. I already had a threaten response over this video, and a few others call me several other foul words (which I will not re post) over this video. That pretty crazy.

Just imagine if your self had similar issues as I did. With this tool or any other. (Like in this video.) Imagine trying to get help and have people be absolute thugs over something so little as documenting something not working.

We had users of our apps before video document bugs. Guess what our response was. Thank you for sharing, we will fix that as soon as we can. 


Thursday, March 12, 2015

Make a custom button with Xojo canvas

Today we look at another Xojo canvas example on how to make a very simple custom button.
Our simple button will draw a button on screen with text that resizes and centers as the window resizes. Also will show how to add a very simple button states and add simple effects on which state is active. The sky really the limit with the canvas object in Xojo. We just touch the surface here, and show how simple it can be to get started making some custom UI elements such as a button with Xojo.

 Check out the video:

If your on iOS device (The video quality is better if you watch va the YouTube app.) here the link




Thanks and Happy coding ;)


Wednesday, March 11, 2015

Xojo draw image to follow mouse

Another look at the Xojo Canvas object.

This time where going to show how simple it is to draw a image to screen to follow the mouse. We made a simple video for that because it easier to see how it works many times more than read about it.




For Xojo canvas docs for desktop: look here
For Xojo graphics doc for desktop: look here


Thanks and happy coding ;)



Tuesday, March 3, 2015

Converting file url to and from strings with swift

There times where you need to display a file url as a string. This might be to display a list of files into a Table View or even a field. 

Below is a custom function I made to do this. It takes one parameter a NSURL and returns a string as a absolute file path

func myFileString(theFile: NSURL) -> String {

return theFile.absoluteString

}


And if you need to convert the string as a absolute file path back to a NSURL this custom function does that. It takes one parameter a string as a absolute file path.

func myFileStringURL(tFileString: String) -> NSURL {

return NSURL(fileURLWithPath: tFileString!)

}


As you can see not very hard, but useful. Making custom functions for later reuse of code for future project can be helpful. These work for Swift and Mac OS X with Swift v 1.1

Thanks, and happy coding ;)


Monday, March 2, 2015

Xojo still choose for crossplatform apps

Many are confused that I stop using Xojo, I never stopped using Xojo. Many of the jobs of making in-house software for companies require Mac, Windows and Linux. For that I still use Xojo.

Over the years I used many different languages and tools from Ruby, Python, Javascript, C#, Lua and more. Just because I decided to start using Swift for iOS and some Mac apps for things, does not  mean I stopped using Xojo.

I had some issues recently with Xojo and my active license not working. After contacting support by email everything was fixed. It is working again.

Another aspect of why I chosen to use Swift is that I would like to put myself in the market to code Swift projects for others. I done this in the past with Unity, where I was hired to help program other companies games in exchange for cash. I also been hired to help program with Livecode, Python, Ruby, Javascript, Xojo and etc projects. It how I currently make a living.

Selling software does not support my family, however programming part of a team as a freelancer does. More languages I know how to code in is a major plus getting more work.

My blog here is about making cool things with code, and I will show many different things and different tools and programming languages.

Hope that clears up the confusion. We usually only made 15 post a year. 2015 we already are past that with ten more months to go. Meaning more content is coming and it will not all be Swift. More Xojo, Livecode and who knows what else will be pack along with Swift for this year.

So stick around I be post other stuff soon.



Saturday, February 28, 2015

Fun with Swift recap

Since 2015 we added a number of Swift tutorials to this blog for Mac OS X and iOS. I mostly have focused on Mac because I discovered there not many code examples around the web for Mac and swift. iOS there thousands of them and many are very good.

I also have been making apps for the Mac since 1997 and would like to see so many more jump on board to the Mac OS platform. Users are actually willing to pay money for a Mac apps, unlike iOS where anything over $0.99 is frowned upon.

I going to recap  back to all of the 2015 post we made so far up to March 1st on Swift.

Saturday, January 17, 2015

Using Swift for Mac OS X apps


The basic intro of using strings.

view topic

Tuesday, January 20, 2015

Hello Mac From Swift


A video walk through of Xcode and how to make outlets and actions. How to setup UI Controls, Windows with layout constrains. How to use and combine text strings.

view topic

Friday, January 23, 2015

Make OS X Web Browser with Swift


A video showing how to make a basic web browser with swift, inculding adding Google search.

view topic

 Saturday, January 24, 2015

 Sliders with Swift


A basic look at how to uses the a slider control.

view topic

Tuesday, January 27, 2015

Alert Messages with Swift


A look at how to present a NSAlert

view topic

Saturday, February 14, 2015

Alerts with Swift for iOS


A look at how to use alerts with iOS.

view topic

Wednesday, February 18, 2015

64-bit requirement for iOS


Simple info about all app store apps require 64-bit support.

view topic

Wednesday, February 18, 2015

Tabbar for iOS with Swift


A video to show how to add more tabs to a iOS tab view app.

view topic

Friday, February 20, 2015

Swift language update


Info about Apple beta release of Swift version 1.2

view topic

Saturday, February 21, 2015

Xcode swift tip: Access to docs fast


A tip on how to access header files fast in Xcode to quickly speed up development.

view topic

Monday, February 23, 2015

Swift for Mac Cocoa: Radio Buttons


A video show how to program with Radio Buttons and NSMatrix with Swift.

view topic

Wednesday, February 25, 2015

Swift for Mac: Programming Image Views


Another video showing how to load bundle images and present them on screen.

view topic

Thursday, February 26, 2015

Swift for cocoa importing files with open panel


Another video showing how to use a open panel to import and read files selected by the user.

view topic 

See All Swift Posts

View



I will be adding more swift examples this year, however I will also be focusing back on cross platform also.

Thanks and happy coding ;)

Thursday, February 26, 2015

Swift for cocoa importing files with open panel

 Today we look at programming a open panel to import files that the user selects. Most apps do things with files so this is really a good thing to know. With swift this is pretty simple and I think you will find the example easy to do your self.




My example will show importing images that the your selected, but this same panel can open anything. From text, movies, music, folders etc.

Here the video showing how to add open files to a cocoa app using swift:



Thanks again, Happy Coding ;)

Wednesday, February 25, 2015

Swift for Mac: Programming Image Views

Today's Swift example shows how to display images “photos” in a cocoa based app. It is actually easier with Swift and Xcode, than with most third party development tools I used.

Video to watch is here:



Thanks, happy coding ;)

Monday, February 23, 2015

Swift for Mac Cocoa: Radio Buttons

When it comes to Swift for Mac OS X cocoa there very little info to be found anywhere. Google very rarely returns anything useful. The only swift examples found for the most part are for iOS not Mac. The two platforms are not really the same even if they use the same programming languages

Personally I want to use Swift for everything, because I really like it. It is possible to inter-mix Swift and Objective-C but why? Apple set up Swift to work completely on its own two feet.

Today is a basic example on how to use AppKits Radio Buttons for a Mac cocoa base app. I go over how to get which radio the user clicked on and how to set a highlighted radio cell by swift code.

I have a video showing you this in full, Here a my video on YouTube:



Thanks, happy coding ;)



Saturday, February 21, 2015

Xcode swift tip: Access to docs fast

I discovered a faster way to access docs for a certain item already in your code. For those who may not be aware of this tip I like to share it with you, because I think you may like it.

Say you want to know what available to use for UIViewController. my simply command clicking on that text in the code editor will bring up the header file for the selected item. This making it super fast to find what you could use.

The Example below shows the UIViewController with a command click.

This will make the header for this class appear in the edit view.


This makes finding info to what you need to use extremely fast and helpful. I find it better than searching the help Api docs as it returns everything for the selected item.

Thanks, and happy coding ;)

Friday, February 20, 2015

Swift language update

Apple recently announced the Swift  language will soon be entering version 1.2 and with that it will bring several notable changes.

All of the examples I shown part of this blog up to now use Swift v 1.1,  Note I will continued to show Swift version 1.1 until Apple officially releases this new Swift version as GM public release. I am not able to show pre-released , based on my license with Apple.

Currently Swift Version 1.2 is in beta and can be used with Xcode beta 6.3. (this if you have an active Mac and or iOS developer license). You can learn more about it at Apple Swift Blog. Also note there said to be a migration tool that will be able to convert your swift version 1.1 code bases to version 1.2, which should be a major plus.

If your interested in swift I highly suggest you follow Apple swift blog for the new language changes and tips. Swift Blog Here You also can follow the blog va Twitter @SwiftLang



Wednesday, February 18, 2015

Tabbar for iOS with Swift

Working with Xcode and Swift is really simple. I keep getting amazed how fast and simple it is to use.

I keep getting people telling me that Swift and Xcode is hard. Also have some say it is s not as fast as Xojo or Livecode for iOS or Mac OS. Actually for iOS and Mac OS its just as fast if not faster. It is really not that hard once you grasp the basics of Swift and learn the ins and outs of Xcode. 



Today we look at using  Xcode and Swift for a iOS interface, Tab bar views. Xcode comes with a template with two such tabs. My video will go over what you need to do to add more tabs to your tab view controller. Its under 5 minutes long. So enjoy.

Video:



Thanks for watching, Happy Coding.



64-bit requirement for iOS

The app store now requires all iOS builds be built for 32/64 bit binaries. If your using Xcode then this is nothing new. However if your using a 3rd party development tool you need to make sure all apps submitted are compiled to a 32/64 bit universal binary and by Summer 2015 all apps submitted before 2015 also are built with that requirement.

If your using Xojo for iOS the new released 2015 r1 supports this new iOS requirement. If your using Livecode for iOS the new release 6.7.2 or later supports this for Livecode. And if your using Xcode its business as usual, as it been supporting this for a while now.

For Xojo 2015 r1 (released 2/17/2015)  get it here
For Livecode 6.7.2 (released 2/17/2015)  get it here
For Xcode 6.1.1 (released 12/02/2014)  get it here

Saturday, February 14, 2015

Alerts with Swift for iOS

A few weeks ago I went over alerts with swift for Mac OS X. Well just to show how different alerts are between Mac OS X and iOS well take a look at several different type of alerts that can be used with iOS with swift.


First is the most basic alert that includes a title, message and up to 3 action buttons.



below is the code to set up the alert, and call it when a user taps on the button; btnShowAlert

//button action:
@IBAction func btnShowAlert(sender: AnyObject) {
      
       // set up the alert view
        let alertController = UIAlertController(title: "Hello World", message: "this is the obleo's alert message", preferredStyle: UIAlertControllerStyle.Alert)
       
       //set up the action button
        alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
       
        // show a alert view
        self.presentViewController(alertController, animated: true, completion: nil)
    }




That a little different to what we did with Mac OS X and swift. It has more code (however if you have auto complete on, most of its filled in for you.)

Another type alert that I use often is the alert with a text field. It has all the same options as above but includes a text field on the alert. ( you can have several fields if wanted, my example below screen shot show just one.)




To set up the alert with the field is not much different than the normal alert. There is just two added lines of code needed different than an normal alert. 1) add the field to the alert with addTextFieldWithConfigurationHandler and 2) setting up way to get the text added to the text field.

see code below:

//button action:
@IBAction func btnShowAskAlert(sender: AnyObject) {
        
// set up alert view
        let alertTextController = UIAlertController(title: "Your Name", message: "Name:", preferredStyle: UIAlertControllerStyle.Alert)
       
        // add the field to the alert (new)
        alertTextController.addTextFieldWithConfigurationHandler ({ (mainTextfld) -> Void in mainTextfld.text = "Add Your name"; })
       
        //add a button action
        alertTextController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (action) -> Void in
           
            // add code to preform action from user tapping OK button (new)
            let mainTextfld = alertTextController.textFields![0] as UITextField
            // present result on screen in UIText
            self.fldResult.text = mainTextfld.text
        }))
       
        // present the alert with field on screen
        self.presentViewController(alertTextController, animated: true, completion: nil)
       
        }

That it, swift is just amazing no mater if your targeting Mac or iOS. I noticing that swift for Mac is actually easier than iOS and is less lines of code than iOS for many of the same type of things.

Happy Coding ;)
 
PS I know its been a few weeks since I made a video, my old MBP finally died. I ran into issue with screenflow 3 is not working with my new Mac, I need to update screenflow to version 5+ and do not have the  extra cash today to make it happen. ( And yes I tried quicktime, but it not as professional as screenflow)

Tuesday, January 27, 2015

Alert Messages with Swift

Here is a quick look at using a modal alert window with swift for Mac OS X



The main window has a simple button action to present a basic modal alert with a text string.

the code to do this in swift is:

@IBAction func btnShowAlert(sender: AnyObject)
        {
            var myAlert:NSAlert = NSAlert()
            myAlert.messageText = "Alert Text Here."
            myAlert.runModal()

    }


Alerts can be more in depth than this. This was just the basics to show how easy they are to add and use in swift. Alerts can also sheet from the main window by using;

beginSheetModalForWindow()

Instead of using the runModal()


Happy Coding;)

Saturday, January 24, 2015

Sliders with Swift

Here a quick one how to display a value of a NSSlider with swift in a field.Here the running example:


To basically only get the value from the slider we only need to make an outlet for the text field and an action for the slider. ( However if you want to set the slider by code you also need to make it an outlet also.)

The Slider action is as follows:

// field Outlet
@IBOutlet weak var fldSliderValue: NSTextField!

// NSSlider Action
@IBAction func mySlider1(sender: AnyObject) {

// x holds the value as a double as the slider changes position
var x: Double = sender.doubleValue

// to get the value to display as text string in the field do this
var mystring = x.description

// display the value in the field
fldSliderValue.stringValue = mystring

 }

Below is the source view:


Swift for Mac OS X is really fun. Will be sharing more soon.  

Friday, January 23, 2015

Make OS X Web Browser with Swift

Make OS X Web Browser with Swift



The last swift example we did was using basic text strings. This next example takes what we learned using basic text string and shows how they can be used to make a very basic web browser. By taking basically the user inputed text we will load a web page. Also we will take a basic user field input and take that string and do a basic google web search. The video still stays in the realm of basic, however you can see how quickly the project could and should start using functions and be broken into separate sources files.




Swift for Mac OS X is really not very hard to pick up and makes in a good choice for those who came from Apple Script, Basic, Ruby, Javascript or a Small Talk language to pick up quickly as it is very similar to what you already know.

Swift makes you start  to see very fast why you should consider using it over a 3rd party tool, as it simple to learn and use. Best of all it has access to everything Mac or iOS and is free to use. (note for iOS the webview is done differently. It is kind of the same, however you need to use UIWebview instead. It is also more limited than the webview for Mac in what it can do.)

This video a little long at 30 minutes but covers a bunch. Will likely revisit this project in the future with more advance topics.

Here the video:

(It supports up to 1080p and may even work with the new 1440p Beta resolution.
It may take a while for youTube to Process higher video resolutions upto a hour from posting, I suggest 1080p or higher to read the sourcecode.)

And if you on a mobile device and want to view on the you-Tube app instead here the video link (video quality is better for mobile on youTube app) http://youtu.be/khhi52p9szQ




Thanks and happy coding ;)



Tuesday, January 20, 2015

Hello Mac From Swift

After my last post about using swift to make cocoa apps on Mac OS X, I got a few questions on how to make an outlet. I guess it is easier to see it happen. Also got questions on how to do window layout constrains with Xcode for Mac also.  As I said it is easier to see this than read about it, So I show you in this video with a very simple basic Cocoa app Hello Mac again with using swift.

There a million swift examples for iOS but not to many for Mac OS X cocoa based apps, so again I keep sharing more swift for Mac stuff in the future. As I am a more a Mac OS developer more than an iOS one.

Here the video; Enjoy.

Note: (If you do not see 1080p resolution then wait for YouTube to process the higher res version. should be not to long)

 

Saturday, January 17, 2015

Using Swift for Mac OS X apps

Yesterday I ran into an issue out of my control with a 3rd party cross platform tool I use. The issue was something that may end my development with it for Mac OS X. Now I not 100% sure if I will not find a work around with that tool. However it is very clear that I need to stop putting all my eggs into one basket and make a real move into using Apple's Xcode to build for Mac OS X in the future.

I already been learning swift for iOS, however when it comes to Mac OSX there very little info or example projects floating around. Even Apple developer site has only 3 swift examples for Mac OSX but have a ton for iOS. Mac and iOS are not the same.

I decided I going to do, if my schedule allows it one or more Mac swift project a day for the next 2 months and really learn how this is done. I have already meet a dozen other developers who want to learn swift for Mac also and are trying to find examples to.

That why I going to share much of what I learn each learning project I do here as, it may help some what.

I decided to skip the Hello world app and start with working with basic text strings and very basic button actions for my first mac demo.

Now first off for a Mac swift project there only one source file the AppDelegate.swift file that all your code goes in.

You still design the interface in Interface builder much like it was done with objective c. Just like with Objective-c each object needs to be assigned an outlet or a action however this is done in the same  AppDelegate.swift file.


This example will simply take the text from each 3 fields and add it together with the process button. And secondly with the clear button remove the text from all 4 fields.

The photo below shows the outlets for all 4 text fields. to create the outlet, first put Xcode into 2 views. the left one the interface view the right one the source code view for AppDelegate.swift. (If that file does not appear in the right side of the subview. At top left corner has 4 boxes like icon, click there to get a sub menu to switch the source code for the view.) To create the outlet simple select a field while holding down the control button and drag the string like graphic to the source code view as like the photo below. This will present you with a pop over window where you name the field (such as fldFieldName) that in turn makes an outlet. do this for each field. (below is an image of the added outlets, Note the window outlet was pre made by Xcode as was the functions for app launching and will terminate) 


Next Adding actions to the buttons. This is done similar to how you create a outlet however you need to add this code after the last function Xcode made but between the last "}" symbol. Also note when the pop over appear there a pop up menu if you select that, you can change the outlet to action. That what you want to do for the button, then assign it a name and hit return.

for my mini app I have the following:
 @IBAction func btnProcessName(sender: AnyObject) {
}

Now between the {} you add your code. Working with strings in Xcode is pretty simple and is similar to many other development languages. we take the object dot property such as:

@IBAction func btnProcessName(sender: AnyObject) {
        fldFullname.stringValue
    }

To assign as value to this fields string value (text) use the = symbol and basically just add the text together. This example does not current check if a field has no text however doing such would not be hard. 

The final action that makes a full name from 3 text fields for first, middle and last name looks like this:

 @IBAction func btnProcessName(sender: AnyObject) {
        fldFullname.stringValue = fldFirstName.stringValue + " " + fldMidName.stringValue + " " + fldLastName.stringValue   
    }
And last to clear all text from the text field as simple action very similar to many programming languages. 

 @IBAction func btnClearAllText(sender: AnyObject) {
        fldFirstName.stringValue = ""
        fldMidName.stringValue = ""
        fldLastName.stringValue = ""
        fldFullname.stringValue = ""
    }
And below are additional images of this very simple swift learning example for Mac OSX.

The full source code (and yes you can make your Xcode editor any color, like mine.)

And last an screen shot of the app test running (like my input;) )


I know I did not do a video, but my upstair neighbors are very loud with there yelling and screaming that a video would not work today. If you think a video would help I could do one in the future when they calm down upstairs.

I hope this helps some as it help me making it to learn myself.

Happy coding ;) thanks for visiting.

Friday, January 2, 2015

Happy New Year

Happy New Year

When I first started this blog part of posterous.com over 6 years now, (moved it to blogger 3 years ago) we meet some pretty cool people. Between my video collections at Vimeo, Screencast.com and YouTube we made over 100 free videos for just learning something cool to do with programing. Some of these videos are now outdated, as the technology world changes every second, (ok it seems like it does, every 6 to 14 months) and that causes some of this stuff to no longer work :(

This blog went from 583 unique visitors a month from 2013 to 8,704 in 2014. Wow! I almost feel I do not give that much content to deserve those numbers. Thank you.

We always try to make more content, but we do not get paid for this blog. We do it when we are in-between programming and multi- media work and jobs. If its slow we give more content, and if busy it will be less.

We also tell it like it is, no candy coating here, not many fancy edits. Why? because we are real people, only fake people edit out there flaws.

Thanks everyone for watching in 2014 and for supporting my little corner of the internet. Hope to see you here again in 2015.

Your friend,

Obleo ;) Happy Coding.